App server reset error, protocol error, please verify that the server and the device are compatible

1. What is the problem? Be very detailed.
I cannot reset the app server. I developed an application with two forms, namely household and household_members. I reset the app server, which is odk sync endpoint, successfully on the mid way of the development. After I finalized my survey form I cannot reset the app server. The error message was, “protocol error, please verify that the service and device are compatible”. I tried to reset using three Samsung Glaxy Tab A". All produced the same error.

Actually, the resetting start, but it never get to the end. It stopped after syncing the household_member table, with the error message. When I check the tables through the web ui, household_members table was there, but household table was not. (that’s why i thought the problem was with household table, but finally found out that not only my household table, other tables with the name ‘household’ were also not accepted.)

2. What app or server are you using and on what device and operating system? Include version numbers.
My odk tool suits are of 2.1.3 rev 2.3.2. App designer is running on Windows 10 professional. The app server is set up on AWS EC2 linux, t2.small.

3. What you have you tried to fix the problem?
I even tried to reset the server using the sample tables and forms in the app designers. The same error appeared. The strange thing is that when I removed the “household” tables from the sample apps and reset the server using the remaining tables, the reset was successful.

The resetting process is not just rejecting my application, it doesn’t accept any table name “household”. But when I change my table name from household to another and trying reset, the error reappears.

I also tried restarting the docker stack deploy and rebooting the T2 instance. Nothing seems to be the problem.

My household form is quite big, with 12 user defined sheets and more than one hundred questions.

4. What steps can we take to reproduce the problem?
Whatever I tried is reproducing the problem. I just don’t know how not to reproduce the problem.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
I think that 's all . I looked for the odk forum and github page for the solution, I noticed some people have also been facing the problems. I couldn’t find out whether they finally got their answer or not.

The sync-endpoint and mobile device have safety features so you don’t accidentally reset a server with data on it that is incompatible with the data on the device.

You can use ODK-X Suitecase to clear the server. The idea was that you should have to intentionally to clear the server so you do not accidentally lose data by hitting the reset server button on a server with information that you did not intent to remove data from.

Thank you, but I forgot to mention that I use the suitcase at my desktop and clean the server before I reset from the mobile app.

I found the problem and solution. One of my sheet contain an illegal character (Myanmar unicode character) in the name column. It cause the resetting crushed. There has been two lessons for me. First is that, the error messages given by the apps are quite vague and sometimes misleading. Second, the apps do not allow unicode characters (may be not all but some) in its variable names (i.e. the name column). Please correct me if I am wrong.

Another interesting thing is that, I can no longer use the name ‘household’ for my table names. If there is a table named ‘household’, even though the contents were totally different, the reset fails. I finally have to set up a new table and form with a different name, and copy everything from previous household table (after removing the illegal character). Then, all goes smoothly. For this part, I still have no clues what has happened underneath.

I get the same issue - if a reset fails on a particular table then that table name can no longer be synced, even if the errors have been fixed.

The only way I could fix this is by logging in to the surver, and running the following commands to stop sync-endpoint, wipe any data stored within and then restart sync-endpoint:
docker stack rm syncldap
docker volume rm syncldap_db-vol
docker stack deploy -c docker-compose.yml syncldap

In issue queue: https://github.com/opendatakit/tool-suite-X/issues/111

We had the same issue recently using v2.1.6, except for us it was after start of data collection and actually because one of the text inputs had too many characters (284, whereas standard text input limits to 255 as per ODK-X XLSX Converter Reference — ODK-X Docs)

Debugging was a bit tricky, but the steps taken were:

  • Look through the log files on the device (default/output/logging) folder
  • Identify all error logs (starting E/). The message seen was the final error log (so I’m guessing more of an overall summary), but there was another specific log related to one of my tables so took that as a good place to start
  • Identify the table rows not synced (I examined the sqlite .db file, but I think also could have just exporting the csv file from the tables app)
  • Try to manually upload the rows (I used the rest api, but I think also could have used the suitcase app)

It was during the manual upload I received a new error message more clearly specifying that the maxLength had been exceeded for one of my columns:

<Error><type>BAD_REQUEST</type><message>Bad arguments: Value is too long (284) for field F9_SUMMARY</message></Error>

After reducing the length of the data in the column it uploaded fine.

As we are mid data collection and making changes to table schema is difficult we have left the 255 limit for now (instead of specifying a larger limit in the models), but added a inputAttributes.maxlength column to the form to prevent the user inputting too many characters as per HTML input maxlength Attribute

4 Likes

NOTE: This is a dangerous suggestion and should only be done if you have the skills
@chrismclarke if you are skilled in sql you could gain access to the postgres database (by default sync-endpoint prevents this) and possibly manually change the table definition using ALTER TABLE and ALTER COLUMN to alter the column definition. The limitation is the database definition. However, you would want to test your commands on a test server first because if you mess up the database it will be hard to recover from that. I believe the sqlite database on Android does not use varchar size limits only the server DB.

2 Likes

Thanks for the suggestion @W_Brunette - yes I thought about trying that and added phppgadmin to my docker-compose setup to make it easier to backup/restore the database - but the table structure was indeed a bit intimidating so decide best against it. Good to know that it could in theory work though, if needed as a last resort.

Do you already have any roadmap or github issues more generally around schema changes? (e.g. adding/removing columns to active tables/forms, changing data types etc.). I expect this would be quite a challenge but would definitely be an incredibly useful function for the projects I work with, so more than happy to try and contribute what I can if anyone else is working on this.

1 Like