Field Kit - syntax error: unexpected token o in JSON at Position 0

Hi I have v0.5.0 and I am Farmier hosted. Whenever I try to sync logs I get the error:
“syntax error: unexpected token o in JSON at Position 0”.
I did not want to post this as a bug because may well be my operator error. Is there something I am doing wrong with Field Kit on my android phone to cause this? Cheers…

2 Likes

Thanks for the report @Logger! Let’s see if we can figure out what the issue is…

First, were you just pulling logs from the server? Or were you trying to push new logs or changes to existing logs back?

If the latter, could you walk us through what was in the new logs, or what changes you made, that caused the issue?

@Logger - Can you try logging out and back in via the Field Kit menu? It could be that there’s a conflict with the old token variable that was stored previously, and the new token variable used for OAuth.

Logging out and back in will clear the storage, so you are starting fresh. If that fixes it, then that is probably what the issue was.

WARNING Logging out will delete any unsynced logs/changes you have!!! So if you have anything in Field Kit that has not been synced to the server, you will lose it when you log out. You may need to manually copy changes if you are unable to sync.

We might have a fix we can try rolling out to by end-of-day if you don’t want to lose data but can afford to wait a little.

1 Like

Hi guys I was trying to push new logs. No data was important as I was just feeling my way around the app with dummy entries. I created a couple of new entries in in the general tab. Include name and a picture from phone camera. The latter being what I wanted to test to see if the picture synced across to the web app.
I am unable to log out to clear storage. I get the warning screen about data loss but nothing happens when I press the red Logout button.

1 Like

Hm that’s peculiar.

Version 0.5.1 just went out on the Play Store for Android, which should fix the token issue. Can you try again when you get the update?

1 Like

Version 0.5.1 installed now. That got rid of the syntax error. Can seemingly pass the logout prompt now.
BUT I am now having login problems.

I enter my credentials firstname lastname & pw and press submit.
then I see a long list of observations including anything I just added. When I press sync I see the button I see the rotating sync graphic beside new items to be update, but then it fails and throws me back to login page with username and pw are incorrect.

I have two users in my account and I have tried both of them in field kit. One for me and one for my son. However when I look at /farm/people in the main farmos interface I see the two users are somehow getting tangled up with each other. If I go in to edit my own user dialog it has my sons name and email address listed beneath my name?

EDIT I went into my farmos site and tidied up my two users to they appear to be descrete now. Logged in and out on web to confirm they work. On field kit I force stopped the app and logged back in as my user name. It opened with a empty log list. Created two new items and pressed sync all. The activity sync things spun. Then the screen refreshed showing all my logs, so it must have access to my site, but the app logs me out, prompting the log in screen again.

Thanks for the info @Logger

It sounds like the username/email mixup may have been unrelated - not sure how that happened, but glad to hear you figured it out!

Then the screen refreshed showing all my logs, so it must have access to my site, but the app logs me out, prompting the log in screen again.

This definitely sounds like a bug. We will take a look and see if we can find the cause…

Hi @Logger, I believe I’ve found the source of this issue. I still don’t know how to fix it, but it does seem to be a native Android (and possibly iOS) issue only. While we work on resolving it, you may want to try the Progressive Web App (PWA), which has all the same functionality and can be added to your homescreen like a native app. You can access it by going to https://farmos.app.

1 Like

@Logger - can you give it another try? We deployed a fix to Farmier that should work. Still ironing out the official commit to farmOS, but let us know if it’s working for you now.

1 Like

YES it is working now. Items are syncing from Field Kit & it is no longer logging me out. So good job you guys have fixed whatever it was. It is going to be a super handy tool.

Is there a Field Kit suggestions thread? 1) Open My Logs list to current time instead of to end of time. 2) Differentiate non synced items by colouring the cloud icon. up arrow vs check mark inside the cloud graphic does not jump out. Perhaps cloud could be red when not synced or check mark could be red? 3) Photos taken with phone in portrait mode end up displayed in FarmOS landscape. All trivial & you are probably aware of them all but I couldn’t help myself.

3 Likes

Great! Glad to hear it’s working for you now!

Ah, this was actually a recent change requested by several users to sort the logs in descending order, as opposed to ascending order, so they could see the most recent logs at the top. Currently, the My Logs screen is designed as a kind of “To-Do” app, mixed with an observations app. It’s a convoluted history, which I’ve documented here, and we’re hoping to streamline it in the future so that there are multiple screens, instead of just My Logs, each with a different purpose.

Good idea! I think there are some unresolved issues with syncing. We’ve talked about syncing automatically whenever network was available, instead of making the user do so manually, but I agree, how we communicate the synced status could be better, and will be important no matter which path we take.

Hmm, yea, photos are another thing that need to be overhauled. Lots of things I’d love to improve upon there!

Thanks for all the feedback, it’s definitely appreciated. We’re a small team and move slowly but it’s all noted and hopefully we can get to it all soon!

1 Like