mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

android firefox beta and firefox #122

Open duperray opened 6 years ago

duperray commented 6 years ago

On firefox {Beta,} 4 android, I get this stack trace (I run my own 1.5 sync server, which sync prefectly well with a debian firefox 52 desktop):

05-26 09:53:10.418 14629 14774 E FxAccounts: firefox_beta :: FxAccountSyncAdapter :: Got exception syncing. 05-26 09:53:10.418 14629 14774 E FxAccounts: org.mozilla.gecko.tokenserver.TokenServerException$TokenServerInvalidCredentialsException: {"status":"invalid-client-state","errors":[{"name":"X-Client-State","location":"header","description":"Unacceptable client-state value new value with no generation change"}]} 05-26 09:53:10.418 14629 14774 E FxAccounts: at org.mozilla.gecko.tokenserver.TokenServerClient.processResponse(TokenServerClient.java:183) 05-26 09:53:10.418 14629 14774 E FxAccounts: at org.mozilla.gecko.tokenserver.TokenServerClient$TokenFetchResourceDelegate.handleHttpResponse(TokenServerClient.java:281)

could it be related to android? Specific configuration of sync server for android?

regards,

Pierre

rfk commented 6 years ago

"Unacceptable client-state value new value with no generation change"

I have a very vague recollection of seeing this error before, but I don't recall exactly where or why. I think it might have been caused when upgrading the syncserver install past a certain version. @duperray did you recently make any changes to your syncserver setup, such as config changes or updating to the latest version?

duperray commented 6 years ago

Yep, exactly,

I updated to lastest master, because I had another problem (I can't remember the error, but found a thread tellin I had to upgrade to get rid

of this error).

On 05/28/2018 03:50 AM, Ryan Kelly wrote:

"Unacceptable client-state value new value with no generation change"

I have a very vague recollection of seeing this error before, but I don't recall exactly where or why. I think it might have been caused when upgrading the syncserver install past a certain version. @duperray https://github.com/duperray did you recently make any changes to your syncserver setup, such as config changes or updating to the latest version?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-services/syncserver/issues/122#issuecomment-392398440, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZav924Tca6drcPWOql1zt-F3RyUp5uks5t21f7gaJpZM4UO04F.

rfk commented 6 years ago

OK, thanks. I don't recall exactly what causes this error, but you should be able to "reset" the database state to get around it by doing something like:

duperray commented 6 years ago

Thanks so much Ryan,

Everything is in order now, it's perfect!

If I can help for further testing about this "database corruption" just tell me.

Regards,

Pierre

On 05/28/2018 10:10 PM, Ryan Kelly wrote:

OK, thanks. I don't recall exactly what causes this error, but you should be able to "reset" the database state to get around it by doing something like:

  • |DELETE FROM users WHERE replaced_at IS NOT NULL;|
  • |UPDATE users SET generation = 0;|

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-services/syncserver/issues/122#issuecomment-392596431, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZav7zEt7cWdCnSi07CEkMoyY4nyKBZks5t3FnDgaJpZM4UO04F.

thomcc commented 6 years ago

Someone reported this in IRC as well, is there a migration that should be happening that isn't? (Or is this just a case we know we don't handle / don't really care about)

rfk commented 6 years ago

I think this is to do with changing the underlying browserid verifier implementation, discussed a little in https://github.com/mozilla-services/syncserver/issues/91. I haven't prioritized the work of trying to reproduce and figure out if it's possible to automatically recover from this situation.

dagelf commented 5 years ago

How did you get the initial log? (Latest Android Firefox is not syncing with latest syncserver for me... and I don't want to spend another hour or two digging into the code if not necessary. Thanks)

rfk commented 5 years ago

For getting logs off android, you need to use the adb tool, specifically with its logcat command. We used to have a bit of a write-up on how to do this specifically for sync but unfortunately it appears to be a dead link these days :-(

rfk commented 5 years ago

I was reminded that the wayback machine is a thing, and has an archived copy of the "how to file a good android sync bug" page:

https://web.archive.org/web/20160315032310/https://160.twinql.com/how-to-file-a-good-android-sync-bug/