Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fenix doesn't Sync with the syncstorage: Missing server timestamp header in request #1242

Closed
jewelooper opened this issue Mar 7, 2022 · 2 comments · Fixed by #1243
Closed

Comments

@jewelooper
Copy link

jewelooper commented Mar 7, 2022

I successfully managed to sync my bookmarks with Firefox for Desktop and my self-hosted syncstorage (with build in tokenserver).
But syncing with Fenix does not work.
The sync stops with error sync failed: Missing server timestamp header in request
Issue mozilla/application-services#3379 describes similar symptoms.
This comment seems to be interesting:

So this sync failed: Missing server timestamp header in request is very strange, and seems to indicate that you're getting a 200 OK from tokenserver that somehow doesn't include the X-Timestamp header. This should in theory be impossible (which is one of the reasons we error on it) because there's a "tween" in the tokenserver server code that sets this header on every response. So, I'm not entirely sure what's happening here.
Originally posted by @rfk in mozilla/application-services#3379 (comment)

Maybe new tokenserver also doesn't include the X-Timestamp header?

Fenix settings:
custom account-server: empty/default
custom sync-server: https://mydomain.com/1.0/sync/1.5

ADB logcat:

03-06 08:27:23.250  5519  5561 I FirefoxAccount: Executing: get access token
03-06 08:27:23.280  5519  5561 I FirefoxAccount: Successfully executed: get access token
03-06 08:27:23.280  5519  5561 I FirefoxAccount: Executing: getTokenServerEndpointURL
03-06 08:27:23.281  5519  5561 I FirefoxAccount: Successfully executed: getTokenServerEndpointURL
03-06 08:27:23.286  5519  5561 I FxaDeviceConstellation: Refreshing device list...
03-06 08:27:23.286  5519  5561 I FxaDeviceConstellation: Executing: fetching all devices
03-06 08:27:23.374  5519  5560 I sync_manager::manager: No backoff in effect (or we decided to ignore it), starting sync
03-06 08:27:23.374  5519  5560 I sync15::sync_multiple: Syncing 6 engines
03-06 08:27:23.374  5519  5560 I sync15::sync_multiple: Loading/initializing persisted state
03-06 08:27:23.374  5519  5560 I sync15::sync_multiple: Preparing client info
03-06 08:27:23.374  5519  5560 I sync15::sync_multiple: Entering sync state machine
03-06 08:27:23.374  5519  5560 I sync15::sync_multiple: Advancing state machine to ready (full)
03-06 08:27:23.409  5519  5560 W sync15::sync_multiple: sync failed: Missing server timestamp header in request, final status=OtherError
03-06 08:27:23.409  5519  5560 W sync15::sync_multiple: Backtrace: None
03-06 08:27:23.409  5519  5560 I sync_manager::manager: Sync finished with status OtherError
03-06 08:27:23.411  5519  5560 E SyncWorker: 'Other' error :(
03-06 08:27:23.414  5519  5610 I WM-WorkerWrapper: Worker result FAILURE for Work [ id=6175d63b-5b6f-45d2-b55e-c18a77a3db25, tags={ Immediate, mozilla.components.service.fxa.sync.WorkManagerSyncWorker, Common } ]
03-06 08:27:24.505  5519  5561 I FxaDeviceConstellation: Successfully executed: fetching all devices
03-06 08:27:24.505  5519  5561 I FxaDeviceConstellation: Refreshed device list; saw 3 device(s).`

conf.toml

port=5000
database_url = "mysql://ffsync:passwd@localhost:3306/syncstorage_rs"
master_secret = "fd612d21680740d12bc4891994b55151662d204c"
human_logs = 1
disable_syncstorage = false
tokenserver.enabled = true
tokenserver.test_mode_enabled = false
tokenserver.node_type = "mysql"
tokenserver.database_url = "mysql://ffsync:passwd@localhost:3306/syncstorage_rs"
tokenserver.fxa_metrics_hash_secret = "fd612d21680740d12bc4891994b55151662d204c"
tokenserver.fxa_email_domain = "api.accounts.firefox.com"
tokenserver.fxa_oauth_server_url = "https://oauth.accounts.firefox.com"
cors_allowed_origin = "null"
cors_max_age = 86400
@jewelooper jewelooper changed the title Fenix doesn't Sync with the stage server: Missing server timestamp header in request Fenix doesn't Sync with the syncstorage: Missing server timestamp header in request Mar 7, 2022
@ethowitz
Copy link
Contributor

ethowitz commented Mar 8, 2022

I believe you're right -- the new Tokenserver doesn't include the X-Timestamp header. Thank you for catching this!

@jewelooper
Copy link
Author

As a workaround I'm setting X-Timestamp by apache proxy server.
It seems to work with the following v-host setting.

Header set X-Timestamp %t
Header edit X-Timestamp t= ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants