Sometimes the sync stops or drops, and there might be several reasons or ways it might have happened. Let us explain each of them in short, so you know what is going on behind the scenes.
Article outline
Prerequisites
Overview
Taking a long time
Sync failed (got an email or message in Org Model)
Sync fails almost instantly
Sync returns a "Salesforce token not found" error
An item (e.g. object) doesn't seem to be in Org Model
You might be also interested in
Prerequisites
You have to have a message or email informing you about sync failure
Overview
We're sorry you have had to come here. We know you want to see your Salesforce Org metadata, and it is frustrating when your sync fails or seems to be taking a long time. Furthermore, we use the Salesforce APIs to get the data from Salesforce. There are a number of reasons that the sync fails - but we are not always told why. Here are some of the symptoms.
Taking a long time
The time depends on the loading of the Salesforce servers. A brand-new Dev Org takes 5-10 mins. A huge Org (60,000 items) takes 2-3 hours.
TIP Sandboxes run slower than Production.
It is a good practice to have the sync scheduled during the night to make sure the delays do not slow you down during the day.
Sync failed (got an email or message in Org Model)
Sometimes it seems like Salesforce servers just "lost the plot" and stopped. We're not told why. It may be that some metadata has synced.
Simply re-running the sync works. I know it sounds awful, but usually, it runs fine.
Sync fails almost instantly
This normally means that the "Remote Site Setting" is incorrect, so Salesforce won't let Elements sync. This could be for the following reasons:
One of the two Remote Site Settings is missing or incorrect. There should be https://api.q9elements.com and then EITHER https://na99.salesforce.com where na99 is your server OR https://AAA.my.salesforce.com where AAA is your MyDomain.
Your Org has been moved to a new pod, i.e. na53 to na57. So, you need to update the Remote Site Setting, e.g. https://na53.salesforce.com changes to https://na57.salesforce.com.
You have implemented MyDomain which means you need to ADD a new Remote Site Setting, e.g. https://AAA.my.salesforce.com where AAA is your MyDomain.
The Org has 'Lock Sessions to the IP address from which they originated' in Security/Session Settings enabled. This stops Salesforce from being able to make REST API calls to itself, which the Elements Sync requires. This setting will also stop the Salesforce Workbench from being able to make REST API calls. Here is a detailed article on Salesforce Session Settings and login IP ranges
Sync returns a "Salesforce token not found" error
This means that either:
in Elements app, the connection has not been authenticated; or
in Elements app, the Salesforce user that was authenticated does not belong to this Org or does not have the right to access the API.
You can refresh (and reset) the user token in the settings tab against the Org connection.
An item (e.g. object) doesn't seem to be in Org Model
For some reason, an item caused an error and won't sync. There is no consistent pattern. Rather than stop the whole sync, we skip it and keep going. We can look back into the log files and work with you to resolve the issue.
Contact us at success@elements.cloud with your email, the Org Model name and Space name.
We can then wade through the huge (500k) log file to find out what happened.
You might be also interested in
Simply re-running the sync works - this might be a solution while we work to eradicate such issues
Refresh (and reset) the user token - helpful tip in case of error "Salesforce token not found"
Salesforce Session Settings and login IP ranges - find out if this is what stops your Org sync