Port description ignored for identity.sync.tokenserver.uri

Assigned to



10 months ago
5 months ago


(Reporter: voodoo_bravo, Assigned: andrei.a.lazar)



Firefox Tracking Flags

(firefox64 wontfix, firefox65 fix-optional, firefox66 affected)



(2 attachments)



10 months ago
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce:

Set identity.sync.tokenserver.uri in about:config to point to my local syncserver, eg 'http://yggdrasil:5000/token/1.0/sync/1.5' and logged into my Firefox-Account afterwards. 
When hitting the Sync Now Button in the UI, nothing happened and the last sync time remained on 'never'.

The syncserver itself works great with all my desktop clients, so I would rule out that this behaviour is caused by a improperly set up server. 

Actual results:

A logcat via ADB showed the following Error which implies, that the configured Port is removed from identity.sync.tokenserver.uri

08-10 19:06:54.127 W/FxAccounts(15568): firefox :: TokenServerClient :: The public_url setting doesn't match the application url.
08-10 19:06:54.127 W/FxAccounts(15568): This will almost certainly cause authentication failures!
08-10 19:06:54.127 W/FxAccounts(15568):     public_url setting is: http://yggdrasil:5000
08-10 19:06:54.127 W/FxAccounts(15568):     application url is:    http://yggdrasil
08-10 19:06:54.127 W/FxAccounts(15568): You can disable this check by setting the force_wsgi_environ
08-10 19:06:54.127 W/FxAccounts(15568): option in your config file, but do so at your own risk.
08-10 19:06:54.128 I/FxAccounts(15568): firefox :: LoginStateMachineDelegate :: Fetching profile avatar information.
08-10 19:06:54.128 E/FxAccounts(15568): firefox :: FxAccountSyncAdapter :: Failed to get token.

Expected results:

The application url used for syncing should honor the specified port in identity.sync.tokenserver.uri
Are you running Nightly?  If so, go to Settings > Sync, tap More ..., and select Debug Mode.  That'll tell you more about what Nightly thinks your service endpoints are.  Maybe we're losing a port along the way?
Flags: needinfo?(voodoo_bravo)
Oh!  I see `firefox ::` in your logs, so not Nightly.  In that case I don't know a great way to inspect what's happening here.

Comment 3

10 months ago
I installed Firefox nightly (63.0a1 from 2018-08-10) on my device and set up sync as before.
Attached is the redacted logoutput that happened when I tapped sync now. 

Let me know if you need any more Logs.
Flags: needinfo?(voodoo_bravo)
This error message ("The public_url setting doesn't match the application url") comes from the server, so I think that Fennec must be successfully connecting to the server on the correct port.  I wonder if it's sending a slightly weirdly-formatted request which is confusing the server, e.g. by not including the port in the "Host" header.

Comment 5

10 months ago
I can confirm that fennec is connecting on the configured port 5000. 
Attached is a tcpdump of the syncserver while fennec tried to sync itself. 

It is indeed missing the Port in the Host-Header of the request. 

Host: yggdrasil
X-Client-State: f8e45d5f61bf81567c5a1c470b823252
X-Conditions-Accepted: 1
Connection: Keep-Alive
User-Agent: Firefox-Android-FxAccounts/63
Thanks for confirming, it sounds like this is a bug in Fennec's handling of the "Host" header.  (I recall sync using a different stack for forming its HTTP requests, maybe the bug is in there).

Comment 7

9 months ago

I was able to reproduce the issue.

Tested with:
Browser / Version: Firefox Mobile Nightly 64.0a1 (2018-09-16)
Operating System: Huawei Honor 8 (Android 7)

Thank you!


9 months ago
Ever confirmed: true
During triage, we discussed making this a P3. This sounds like something that maybe falls under the purview of networking, so moving it there.
Component: Android Sync → Networking
Product: Firefox for Android → Core
Version: Firefox 62 → 62 Branch
(In reply to Marcia Knous [:marcia - needinfo? me] from comment #8)
> During triage, we discussed making this a P3. This sounds like something
> that maybe falls under the purview of networking, so moving it there.

No, this isn't the Necko stack -- it's Android Sync specific.
Component: Networking → Android Sync
Product: Core → Firefox for Android
Version: 62 Branch → Trunk
Priority: -- → P2


5 months ago
Assignee: nobody → andrei.a.lazar
You need to log in before you can comment on or make changes to this bug.