mozilla-services / syncserver

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

Sync on Amazon Fire HD 10 #101

Closed domi2001 closed 7 years ago

domi2001 commented 7 years ago

I've been struggling to get the sync functionality running on my Amazon Fire HD 10 (2017) in combination with my own sync server. While it works with other Android devices and under Windows, Linux and macOS, the status on the firewall always remains "Last Sync: Never". "identity.sync.tokenserver.uri" and "services.sync.clusterURL" were set accordingly and then the Firefox account was added. Unfortunately, with Firefox and the last Nightly-Build this this leads to the same result. A valid SSL certificate is present and I have set the option "force_wsgi_environ = true" to exclude this as an error.

This is the ADB-Log:

I/FxAccounts(22436): firefox :: FxAccountSyncAdapter :: Syncing FxAccount account named like XXXX@XXXXXXXX.XX for authority org.mozilla.firefox.db.browser with instance org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter@25368880.
I/FxAccounts(22436): firefox :: FxAccountSyncAdapter :: Account last synced at: -1
I/FxAccounts(22436): firefox :: FirefoxAccounts :: Sync options -- scheduling now: false
I/FxAccounts(22436): firefox :: LoginStateMachineDelegate :: handleTransition: LogMessage('sign succeeded') to Married
I/FxAccounts(22436): firefox :: LoginStateMachineDelegate :: handleFinal: in Married
I/FxAccounts(22436): firefox :: AndroidFxAccount :: Moving account named like XXXX@XXXXXXXX.XX to state Married
I/FxAccounts(22436): firefox :: FxAccountNotificationManager :: State Married needs no action; cancelling any existing notification.
I/FxAccounts(22436): firefox :: LoginStateMachineDelegate :: handleMarried: in Married
I/FxAccounts(22436): firefox :: LoginStateMachineDelegate :: Fetching profile avatar information.
E/FxAccounts(22436): firefox :: FxAccountSyncAdapter :: Failed to get token.
E/FxAccounts(22436): org.mozilla.gecko.tokenserver.TokenServerException$TokenServerMalformedResponseException: org.mozilla.gecko.sync.UnexpectedJSONException$BadRequiredFieldJSONException: Expected key not present in result: hashed_fxa_uid
E/FxAccounts(22436):    at org.mozilla.gecko.tokenserver.TokenServerClient.processResponse(TokenServerClient.java:226)
E/FxAccounts(22436):    at org.mozilla.gecko.tokenserver.TokenServerClient$TokenFetchResourceDelegate.handleHttpResponse(TokenServerClient.java:281)
E/FxAccounts(22436):    at org.mozilla.gecko.sync.net.BaseResource.execute(BaseResource.java:342)
E/FxAccounts(22436):    at org.mozilla.gecko.sync.net.BaseResource.go(BaseResource.java:373)
E/FxAccounts(22436):    at org.mozilla.gecko.sync.net.BaseResource.get(BaseResource.java:379)
E/FxAccounts(22436):    at org.mozilla.gecko.tokenserver.TokenServerClient.getTokenFromBrowserIDAssertion(TokenServerClient.java:329)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter.syncWithAssertion(FxAccountSyncAdapter.java:463)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter$3.handleMarried(FxAccountSyncAdapter.java:667)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.authenticator.FxADefaultLoginStateMachineDelegate.handleFinal(FxADefaultLoginStateMachineDelegate.java:81)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.login.FxAccountLoginStateMachine$ExecuteDelegate.handleTransition(FxAccountLoginStateMachine.java:64)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.login.Cohabiting$1.handleSuccess(Cohabiting.java:46)
E/FxAccounts(22436):    at org.mozilla.gecko.fxa.login.Cohabiting$1.handleSuccess(Cohabiting.java:28)
E/FxAccounts(22436):    at org.mozilla.gecko.background.fxa.FxAccountClient20$5.handleSuccess(FxAccountClient20.java:579)
E/FxAccounts(22436):    at org.mozilla.gecko.background.fxa.FxAccountClient20$ResourceDelegate$2.run(FxAccountClient20.java:279)
E/FxAccounts(22436):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/FxAccounts(22436):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/FxAccounts(22436):    at java.lang.Thread.run(Thread.java:818)
E/FxAccounts(22436): Caused by: org.mozilla.gecko.sync.UnexpectedJSONException$BadRequiredFieldJSONException: Expected key not present in result: hashed_fxa_uid
E/FxAccounts(22436):    at org.mozilla.gecko.sync.ExtendedJSONObject.throwIfFieldsMissingOrMisTyped(ExtendedJSONObject.java:397)
E/FxAccounts(22436):    at org.mozilla.gecko.tokenserver.TokenServerClient.processResponse(TokenServerClient.java:223)
E/FxAccounts(22436):    ... 16 more

I don't really know where it hangs and I hope that someone knows advice.

Many thanks in advance!

rfk commented 7 years ago

Thanks for posting a detailed log!

Expected key not present in result: hashed_fxa_uid

I recall seeing this error message in the past, and I think it may be fixed in newer versions of Firefox for Android. What version of Firefox are you running here? Are you running the very latest version of the syncserver code?

domi2001 commented 7 years ago

The information concerning the latest version of the syncserver code was the right hint. It seems that my Docker-Container had trouble with applying the changes, so I set up a new one with the latest syncserver code and now it works fine!

rfk commented 6 years ago

great to hear! thanks for reporting back :grin: