As described earlier, Sync has four stages:

  1. Prepare the data to sync: this process is usually really quick. When this stage finishes, the Sync progress bar is about 1/4 complete.
  2. Send changes from the device to the backend -- when this stage finishes, the Sync progress bar is about 1/2 complete.
  3. Fetch the latest app definition and data from the backend -- after this stage, the Sync progress bar is about 3/4 complete.
  4. Prepare the data to run on the device -- usually really quick.

Most errors in Sync are observed in the second stage:

  1. If there are network errors, the step is retried a few times. If the failure persists, the Sync is halted. The solution is to retry later when connectivity is better.
  2. If you have poor connectivity or if large images have to be sent as part of the Sync, this step can take a long time and can potentially timeout. The solution is to retry later when connectivity is better.

You can always retry a failed Sync request.

Unable to fetch data
If your users see errors like this during sync: "The remote server returned an error: (403) Forbidden" , it means that our service is unable to fetch the data from your cloud service (eg: Google Sheets) because the cloud service has explicitly denied permissions. There are two possible reasons:

  1. You have enabled the "run as app user" security option in your app. Therefore, our service tries to access the data using the identity of the user of the app. And this app user does not have access to the data/spreadsheet. This option ("run as app user") should be used only for extra security and in these situations, such a failure is appropriate.
  2. Your app creator account has been denied permission to access the data/spreadsheet in the cloud service. This can happen if you built the app from a shared spreadsheet and someone else removed your access to the sheet.  

Unable to update row
If you have made changes in the app and Sync, you may see an error of the form: "Unable to update row in table 'Your-Table-Name. Execution of request failed: Unable to complete sync.". The error may say: "Google sheets service seems to be unresponsive".

This error occurs when the AppSheet backend is unable to send your changes onto the cloud storage provider (in this case, Google Sheets). Almost always, this is because the request times out. If this error occurs often, it is usually a clear sign that there are complex cross-sheet formulas in the Google Sheet. Making a simple update to the sheet takes a lot of time to complete because all the formulas are recomputed by Google Sheets. You will need to simplify your Google Sheet, in particular avoiding some cross-sheet formulas. 

This Change Cannot be Applied
The message "This change cannot be applied because there is a newer version of your app" is displayed if a client attempts to sync after the app definition has been changed on the server. For example, you will see this message if columns have been added or removed from a table and the client is not using the latest version of the application. You may also see an error message indicating that the number of columns is incorrect or that a column is missing. The local changes queued on the device cannot be applied by the server when this happens.

You can verify this by comparing the app and backend application version numbers. You can obtain the app version number by clicking the menu at the top left and selecting 'About'. You can obtain the backend application version number by opening the application in the Editor and going to the Info > Properties tab.

There are two possible remedies when this occurs. With both the remedies, the changes queued up in the app will be copied to a recovery file and will need to be manually applied to the spreadsheet.

Recovery mode: With this option, you will place the app in "Recovery Mode" via and then this allows the sync to proceed. Follow the steps below:

  1. Go the Manage -> Deploy pane of the app editor and click the button to move the app to Recovery Mode.
  2. On the device where the sync fails, try the sync again. This time, it should go through successfully. 
  3. On the Manage -> Deploy pane, move the app back to Normal mode.
  4. You will find a special Recovery folder within the root folder for the app (in the app owner's cloud file system). The changes from the app will be written into this recovery folder in recovery.txt files. Note that row images will still be saved in the app's usual image folder.
  5. Now examine the row values from the recovery folder and copy them to the spreadsheet as appropriate. The row values are saved in JSON format. You might want to copy these into an online service like to convert them into a tabular format that is convenient to copy into a spreadsheet.

Manual recovery: As an end-user of the app,  you can manually abandon the changes on the device following the steps below:

  1. First capture the app's changes by clicking "Show Changes" in the "hamburger" menu at the top left of the mobile app. This will allow you to send yourself or the app owner a copy of the changes via email, so that someone can manually process the changes and add them to the spreadsheet.
  2. This will also create a copy of the changes in a special Recovery folder in the root folder for the app (in the app owner's cloud file system). 
  3. In the app, click "Reset Changes" in the menu. This will permanently discard the queued up changes and synchronize the app with the backend
Did this answer your question?