Anyone actually running firefox-sync successfully?

For the love of god i just dont get it to work. I followed the nix manual instructions. But I keep getting 401 login errors:

Sync.Resource	DEBUG	GET fail 401 https://firefox-sync.fschn.org/1.5/4/info/collections
Sync.Resource	WARN	GET request to https://firefox-sync.fschn.org/1.5/4/info/collections failed with status 401
Sync.Service	WARN	401: login failed.

more of the firefox about:sync-log are blow. im really out of ideas now. any leads and help is highly appreciated.

my basic setup is:

{ pkgs, config, ... }:
{
  services.mysql.package = pkgs.mariadb;
  services.firefox-syncserver = {
    enable = true;
    secrets = config.sops.secrets."firefox-syncserver/SYNC_MASTER_SECRET".path;
    singleNode = {
      enable = true;
      hostname = "firefox-sync.fschn.org";
      enableNginx = true;
    };
  };
  sops.secrets."firefox-syncserver/SYNC_MASTER_SECRET" = { 
    mode = "0777";
  };
  services.nginx = {
    virtualHosts."firefox-sync.fschn.org" = {
      useACMEHost = "fschn.org";
      forceSSL = lib.mkForce true;
    };
  };
}

the secret is set with:

SYNC_MASTER_SECRET=$(cat /dev/random | base32 | head -c64)

testing if the server is up:

$ curl https://firefox-sync.fschn.org/__heartbeat__ 
{"database":"Ok","quota":{"enabled":false,"size":0},"version":"0.17.12","status":"Ok"}

Firefox Browser configuration process:

  1. Sign out of mozilla account in firefox sync settings
  2. Close Firefox Browser
  3. cd to firefox profile dir & mv weaver weaver-bak #firefox-sync used to be called weaver
  4. Open Firefox Browser
  5. Navigate to about:config in your Firefox address bar and set identity.sync.tokenserver.uri to https://firefox-sync.fschn.org/1.0/sync/1.5
  6. Sign in moxilla account

My setup of machine running firefox-sync:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.74, NixOS, 24.11 (Vicuna), 24.11.20250225.5d7db46`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/lb6ypkpf38qsd0p4gc5nqvb97s2brh5h-source`

Setup of machine running firefox browser to sync:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.12.16, NixOS, 24.11 (Vicuna), 24.11.20250225.5d7db46`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/lb6ypkpf38qsd0p4gc5nqvb97s2brh5h-source`
$ firefox --version                                 
Mozilla Firefox 135.0.1

Whole Firefox about:sync-log:

1741436354189	Sync.LogManager	DEBUG	Flushing file log
1741436354195	Sync.LogManager	DEBUG	Log cleanup threshold time: 1740572354195
1741436354195	Sync.LogManager	DEBUG	Done deleting files.
1741436357291	FirefoxAccounts	INFO	fetching updated device list
1741436357303	Services.Common.RESTRequest	DEBUG	GET request to https://api.accounts.firefox.com/v1/account/devices?filterIdleDevicesTimestamp=1739621957291
1741436357534	Services.Common.RESTRequest	DEBUG	GET https://api.accounts.firefox.com/v1/account/devices?filterIdleDevicesTimestamp=1739621957291 200
1741436357534	Hawk	DEBUG	(Response) /account/devices?filterIdleDevicesTimestamp=1739621957291: code: 200 - Status text: 
1741436357534	Hawk	DEBUG	Clock offset vs https://api.accounts.firefox.com/v1: -534
1741436357534	FirefoxAccounts	INFO	Got new device list: 1c484495fc2fc42abfb6ce7241781078, 87bb311d18f51c4e695ff5d42ca68efe, 9b4ffac506b296deae62bf7b090f3eca
1741436357534	FirefoxAccounts	TRACE	Getting command keys: https://identity.mozilla.com/cmd/open-uri
1741436357534	FirefoxAccounts	TRACE	Getting command keys: https://identity.mozilla.com/cmd/close-uri/v1
1741436357534	FirefoxAccounts	TRACE	Our push subscription looks OK
1741436357534	FirefoxAccounts	INFO	updating the cache
1741436365848	FirefoxAccounts	INFO	Polling device commands.
1741436365848	Sync.Service	DEBUG	User-Agent: Firefox/135.0.1 (Linux x86_64) FxSync/1.137.0.20250216192613.desktop
1741436365848	Sync.Service	INFO	Starting sync at 2025-03-08 13:19:25 in browser session Xe2RkkEZL1q7
1741436365848	Sync.Service	DEBUG	In sync: should login.
1741436365848	Sync.Service	INFO	User logged in successfully - verifying login.
1741436365848	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1741436365848	Sync.SyncAuthManager	DEBUG	unlockAndVerifyAuthState already has (or can fetch) sync keys
1741436365848	Sync.Status	DEBUG	Status.login: error.login.reason.network => success.status_ok
1741436365848	Sync.Status	DEBUG	Status.service: error.login.failed => error.login.failed
1741436365848	Sync.Service	DEBUG	Fetching unlocked auth state returned success.status_ok
1741436365849	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1741436365850	Services.Common.RESTRequest	DEBUG	GET request to https://api.accounts.firefox.com/v1/account/device/commands?index=0
1741436365862	Sync.Resource	DEBUG	GET fail 401 https://firefox-sync.fschn.org/1.5/4/info/collections
1741436365862	Sync.Resource	WARN	GET request to https://firefox-sync.fschn.org/1.5/4/info/collections failed with status 401
1741436365862	Sync.Service	WARN	401: login failed.
1741436365862	Sync.SyncAuthManager	DEBUG	_findCluster has a pre-existing clusterURL, so fetching a new token token
1741436365863	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1741436365863	Sync.SyncAuthManager	INFO	Getting sync key
1741436365863	FirefoxAccounts	DEBUG	getOAuthToken enter
1741436365863	FirefoxAccounts	TRACE	getCachedToken returning cached token
1741436365863	FirefoxAccounts	DEBUG	getOAuthToken returning a cached token
1741436365863	Sync.SyncAuthManager	INFO	Getting a sync token from: https://firefox-sync.fschn.org/1.0/sync/1.5
1741436365863	Sync.SyncAuthManager	DEBUG	Getting a token using OAuth
1741436365863	Services.Common.TokenServerClient	DEBUG	Beginning OAuth token exchange: https://firefox-sync.fschn.org/1.0/sync/1.5
1741436365863	Services.Common.RESTRequest	DEBUG	GET request to https://firefox-sync.fschn.org/1.0/sync/1.5
1741436365888	Services.Common.RESTRequest	DEBUG	GET https://firefox-sync.fschn.org/1.0/sync/1.5 200
1741436365888	Services.Common.TokenServerClient	DEBUG	Got token response: 200
1741436365888	Services.Common.TokenServerClient	DEBUG	Successful token response
1741436365888	Sync.Status	DEBUG	Status.login: success.status_ok => success.login
1741436365888	Sync.Status	DEBUG	Status.service: error.login.failed => success.status_ok
1741436365888	Sync.SyncAuthManager	DEBUG	_findCluster returning http://firefox-sync.fschn.org/1.5/4/
1741436365888	Sync.SyncAuthManager	DEBUG	Cluster value = http://firefox-sync.fschn.org/1.5/4/
1741436365888	Sync.Status	DEBUG	Status.login: success.login => error.login.reason.network
1741436365888	Sync.Status	DEBUG	Status.service: success.status_ok => error.login.failed
1741436365888	Sync.ErrorHandler	ERROR	Sync encountered a login error
1741436365889	Sync.SyncScheduler	DEBUG	Clearing sync triggers and the global score.
1741436365889	Sync.SyncScheduler	DEBUG	Next sync in 3600000 ms. (why=schedule)
1741436365889	Sync.Service	DEBUG	Exception calling WrappedLock: Error: Login failed: error.login.reason.network(resource://services-sync/service.sys.mjs:1041:15) JS Stack trace: onNotify@service.sys.mjs:1041:15
1741436365889	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1741436365889	Sync.Service	DEBUG	Not syncing: login returned false.
1741436365889	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent

Also tried to make it work, getting the same 401 on collections. Trying to figure it out still

1 Like