Closed Bug 1482462 Opened 6 years ago Closed 3 years ago

Port description ignored for identity.sync.tokenserver.uri

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P2)

defect

Tracking

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

RESOLVED INCOMPLETE
Tracking Status
firefox64 --- wontfix
firefox65 --- fix-optional
firefox66 --- affected

People

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

Details

Attachments

(2 files)

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.
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.
Attached file tcpdump while syncing
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).
Hi,

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!
Status: UNCONFIRMED → NEW
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
Assignee: nobody → andrei.a.lazar
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: