Open Bug 1946510 Opened 9 months ago Updated 8 months ago

mozilla account "disconnected" after firefox is closed and relaunched

Categories

(Firefox :: about:logins, defect)

Firefox 135
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jirachi4ever, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0

Steps to reproduce:

Similar to what's listed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1933038

Unlike that post, I do not have a primary password set up.

1 - closed/quit firefox
2 - start firefox

Do note I get the same behavior on both Firefox 134/135/128.7ESR on MacOS; 134 on Windows as well. I tried relaunching the browser using troubleshooting mode. Tried completely logging off and logging in again by removing the session on my mozilla account "Connected Services".

Actual results:

Warning sign on menu icon, "disconnected account" message shows up;
Requires login;
2FA only works after trying twice ("error, please close this tab and start again" the first time after 2FA code)

Expected results:

Firefox sync/mozilla account should stay connected and logged in

The Bugbug bot thinks this bug should belong to the 'Cloud Services::Server: Firefox Accounts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Server: Firefox Accounts
Product: Firefox → Cloud Services
Component: Server: Firefox Accounts → Firefox Accounts
OS: Unspecified → All
Product: Cloud Services → Firefox
Hardware: Unspecified → All

Hello! Thank you for submitting this issue I have tried to reproduce the issue on my end but unfortunately I wasn't able to with firefox 137.0a1(2025-02-11) on Ubuntu 22.04 and MacOS 15.2
Could you please answer the following questions in order to further investigate this issue?

  1. Does this issue happen with a new profile? Here is a link on how to create one: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles
  2. Does this issue happen in the latest nightly? Here is a link from where you can download it: https://www.mozilla.org/en-US/firefox/channel/desktop/
  3. Do you have any addons installed? If yes could you please list them?
Flags: needinfo?(jirachi4ever)

Hello and thank you for following up!

1/2. Interestingly it doesn't do that in a new profile or in the nightly (which is a new profile). It also is no longer doing that in the ESR , which is good. I did update to Sequoia 15.3.1 yesterday (from 15.3.0) though. I wonder if that changed anything.

  1. I do. But I also tested in safe (troubleshoot) mode, which should've disabled these.
  • AdBlock
  • Adblock Plus
  • Don't Accept image/webp
  • Facebook Container
  • Persona Plus
  • Side View
  • Simple Tab Groups
  • SponsorBlock for Youtube
  • Tampermonkey
  • uBlock Origin
  • Zotero Connector
Flags: needinfo?(jirachi4ever)

Something is likely to be broken in the profile, quite probably the "logins" component - eg, https://bugzilla.mozilla.org/show_bug.cgi?id=1295122, although the exact symptoms might be different. It might be worth checking the browser console for any error messages related to logins etc.

This is the error:

Sync encountered an error - see about:sync-log for the log file. policies.sys.mjs:972:15
    resetFileLog resource://services-sync/policies.sys.mjs:972

And going into about:sync-log gives me this. That one line about unlockAndVerifyAuthState has an unverified user seems suspicious.

1739472651813	FirefoxAccounts	TRACE	initializing new storage manager
1739472651814	FirefoxAccounts	TRACE	starting fetch of json user data
1739472651825	FirefoxAccounts	TRACE	finished fetch of json user data - took: 11
1739472651825	FirefoxAccounts	DEBUG	reading secure storage with existing: []
1739472651825	FirefoxAccounts	TRACE	starting fetch of user data from the login manager
1739472651825	FirefoxAccounts	INFO	Can't find any credentials in the login manager
1739472651825	FirefoxAccounts	TRACE	initializing of new storage manager done
1739472651827	FirefoxAccounts	DEBUG	FxAccountsProfileClient: Initialized
1739472651830	FirefoxAccounts	DEBUG	FxAccountsProfileClient: Requested profile
1739472651830	FirefoxAccounts	DEBUG	getOAuthToken enter
1739472651830	FirefoxAccounts	TRACE	getCachedToken returning cached token
1739472651830	FirefoxAccounts	DEBUG	getOAuthToken returning a cached token
1739472651830	Services.Common.RESTRequest	DEBUG	GET request to https://profile.accounts.firefox.com/v1/profile
1739472651879	Services.Common.RESTRequest	DEBUG	GET request to https://api.accounts.firefox.com/v1/account/attached_clients
1739472651893	Sync.Status	INFO	Resetting Status.
1739472651893	Sync.Status	DEBUG	Status.service: undefined => success.status_ok
1739472651893	Sync.SyncScheduler	TRACE	Setting SyncScheduler policy values to defaults.
1739472651893	Sync.SyncScheduler	DEBUG	Clearing sync triggers and the global score.
1739472651893	Sync.Service	INFO	Loading Weave 1.137.0
1739472651893	Sync.Engine.Clients	DEBUG	Engine constructed
1739472651893	Sync.Engine.Clients	DEBUG	Resetting clients last sync time
1739472651895	Sync.Engine.Addons	DEBUG	Engine constructed
1739472651896	Sync.Engine.Addons	DEBUG	SyncEngine initialized: addons
1739472651897	Sync.Engine.Passwords	DEBUG	Engine constructed
1739472651900	Sync.Engine.Passwords	DEBUG	SyncEngine initialized: passwords
1739472651901	Sync.Engine.Prefs	DEBUG	Engine constructed
1739472651901	Sync.Engine.Prefs	DEBUG	SyncEngine initialized: prefs
1739472651902	Sync.Engine.Bookmarks	DEBUG	Engine constructed
1739472651902	Sync.Engine.Bookmarks	DEBUG	SyncEngine initialized: bookmarks
1739472651903	Sync.Engine.Forms	DEBUG	Engine constructed
1739472651904	Sync.Engine.Forms	DEBUG	SyncEngine initialized: forms
1739472651905	Sync.Engine.History	DEBUG	Engine constructed
1739472651906	Sync.Engine.History	DEBUG	SyncEngine initialized: history
1739472651907	Sync.Engine.Tabs	DEBUG	Engine constructed
1739472651909	Sync.Engine.Tabs	DEBUG	SyncEngine initialized: tabs
1739472651911	Sync.Engine.Tabs	INFO	Got a bridged engine!
1739472651911	Sync.Engine.Addresses	DEBUG	Engine constructed
1739472651914	Sync.Engine.Addresses	DEBUG	SyncEngine initialized: addresses
1739472651914	Sync.Engine.CreditCards	DEBUG	Engine constructed
1739472651915	Sync.Engine.CreditCards	DEBUG	SyncEngine initialized: creditcards
1739472651916	Sync.Engine.Extension-Storage	DEBUG	Engine constructed
1739472651919	Sync.Engine.Extension-Storage	DEBUG	SyncEngine initialized: extension-storage
1739472651919	Sync.Engine.Extension-Storage	INFO	Got a bridged engine!
1739472651919	Sync.Service	INFO	Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
1739472651919	Sync.Engine.History.Tracker	INFO	Adding Places observer.
1739472651922	FirefoxAccounts	TRACE	Command queue observer created
1739472651922	FirefoxAccounts	TRACE	Getting command keys: https://identity.mozilla.com/cmd/open-uri
1739472651922	FirefoxAccounts	TRACE	Getting command keys: https://identity.mozilla.com/cmd/close-uri/v1
1739472651924	Sync.Service	DEBUG	User-Agent: Firefox/135.0 (Intel Mac OS X 10.15) FxSync/1.137.0.20250130195129.desktop
1739472651925	Sync.Service	INFO	Starting sync at 2025-02-13 13:50:51 in browser session 9xBTxesO0zg8
1739472651925	Sync.Service	DEBUG	In sync: should login.
1739472651925	Sync.Service	INFO	User logged in successfully - verifying login.
1739472651925	Sync.SyncAuthManager	DEBUG	unlockAndVerifyAuthState has an unverified user
1739472651925	Sync.Status	DEBUG	Status.login: success.login => error.login.reason.account
1739472651925	Sync.Status	DEBUG	Status.service: success.status_ok => error.login.failed
1739472651925	Sync.Service	DEBUG	Fetching unlocked auth state returned error.login.reason.account
1739472651925	Sync.ErrorHandler	ERROR	Sync encountered a login error
1739472651925	Sync.SyncScheduler	DEBUG	Clearing sync triggers and the global score.
1739472651925	Sync.Service	DEBUG	Exception calling WrappedLock: Error: Login failed: error.login.reason.account(resource://services-sync/service.sys.mjs:1041:15) JS Stack trace: onNotify@service.sys.mjs:1041:15
1739472651925	Sync.Service	DEBUG	Not syncing: login returned false.
1739472651942	FirefoxAccounts	DEBUG	FxAccountsWebChannel registered: account_updates with origin https://accounts.firefox.com
1739472652019	Services.Common.RESTRequest	DEBUG	GET https://profile.accounts.firefox.com/v1/profile 304
1739472652039	Services.Common.RESTRequest	DEBUG	GET https://api.accounts.firefox.com/v1/account/attached_clients 200
1739472652039	Hawk	DEBUG	(Response) /account/attached_clients: code: 200 - Status text: 
1739472652039	Hawk	DEBUG	Clock offset vs https://api.accounts.firefox.com/v1: -39

That is suspicious. Sadly though, the sync logs are unlikely to capture the underlying reason for this - does the "Browser Console" show anything interesting during this time?

The severity field is not set for this bug.
:markh, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(markh)

needinfo reporter for comment 6.

Flags: needinfo?(markh) → needinfo?(jirachi4ever)
``` ``` Errors expanded: ``` NS_ERROR_FAILURE: Couldn't decrypt string crypto-SDR.sys.mjs:197 decrypt resource://gre/modules/crypto-SDR.sys.mjs:197 _decryptLogins resource://gre/modules/storage-json.sys.mjs:1032 searchLogins resource://gre/modules/storage-json.sys.mjs:554 searchLoginsAsync resource://gre/modules/storage-json.sys.mjs:504 searchLoginsAsync resource://gre/modules/LoginManager.sys.mjs:473 get resource://gre/modules/FxAccountsStorage.sys.mjs:591 InterpretGeneratorResume self-hosted:1413 AsyncFunctionNext self-hosted:800 Sync encountered an error - see about:sync-log for the log file. policies.sys.mjs:972:15 resetFileLog resource://services-sync/policies.sys.mjs:972 ```

Seems like that accidentally sent itself.

The file is the full log, and there were two ERRORS, whose expanded contents are included in the main message.

Sorry for the late reply!

Flags: needinfo?(jirachi4ever)

Would also like to add that the NS_ERROR_FAILURE: Couldn't decrypt string error (everything the same when expanded) also appears when I try to login.

It sure does look something like bug 1295122, bug 1124553, bug 441889 etc. Does the "login manager" work for you - eg, are you able to add a new saved password, restart the browser, then see all the details of the previously saved password? If not, removing the files key4.db, logins-backup.json and logins.json from your profile directory (while Firefox is not running) is likely to fix it, although you will lose all saved passwords (but it seems unlikely they are working for you anyway), and you will need to reconnect to sync again, but it should then remain connected.

My "saved passwords" is blank and removing those files didn't help. These errors showed up in the browser console when I tried to login the second time (to reconnect).

HTTPS-Only Mode: Not upgrading insecure request “http://r10.o.lencr.org/” because it is exempt.
2
NS_ERROR_ABORT: User canceled primary password entry crypto-SDR.sys.mjs:85
    encrypt resource://gre/modules/crypto-SDR.sys.mjs:85
    setSyncID resource://gre/modules/storage-json.sys.mjs:155
    InterpretGeneratorResume self-hosted:1413
    AsyncFunctionNext self-hosted:800
Sync encountered an error - see about:sync-log for the log file. policies.sys.mjs:972:15
    resetFileLog resource://services-sync/policies.sys.mjs:972
HTTPS-Only Mode: Not upgrading insecure request “http://wpad/wpad.dat” because it is exempt.

HTTPS-Only Mode: Not upgrading insecure request “http://r11.o.lencr.org/” because it is exempt.

HTTPS-Only Mode: Not upgrading insecure request “http://o.pki.goog/wr2” because it is exempt.

NS_ERROR_FAILURE: 
    _getAllCookies resource:///modules/SiteDataManager.sys.mjs:281
    updateSites resource:///modules/SiteDataManager.sys.mjs:64
    initSiteDataControls chrome://browser/content/preferences/privacy.js:1303
    init chrome://browser/content/preferences/privacy.js:1220
    init chrome://browser/content/preferences/preferences.js:176
    initializeCategories chrome://browser/content/preferences/findInPage.js:115
    init chrome://browser/content/preferences/findInPage.js:64
SiteDataManager.sys.mjs:285:17
    _getAllCookies resource:///modules/SiteDataManager.sys.mjs:285
    updateSites resource:///modules/SiteDataManager.sys.mjs:64
    initSiteDataControls chrome://browser/content/preferences/privacy.js:1303
    init chrome://browser/content/preferences/privacy.js:1220
    init chrome://browser/content/preferences/preferences.js:176
    initializeCategories chrome://browser/content/preferences/findInPage.js:115
    init chrome://browser/content/preferences/findInPage.js:64
NS_ERROR_ABORT: User canceled primary password entry crypto-SDR.sys.mjs:85
    encrypt resource://gre/modules/crypto-SDR.sys.mjs:85
    setSyncID resource://gre/modules/storage-json.sys.mjs:155
    InterpretGeneratorResume self-hosted:1413
    AsyncFunctionNext self-hosted:800
Sync encountered an error - see about:sync-log for the log file. policies.sys.mjs:972:15
    resetFileLog resource://services-sync/policies.sys.mjs:972

I take it you don't have a primary password set? It's strange that removing those files didn't fix this, because the logins subsystem is clearly broken. Are you sure Firefox wasn't running? Are there any other "key*" files in your profile dir?

I don't have a primary password. Firefox wasn't running when I removed the files. There was a key3.db and I just tried removing that too, but nothing changed. key4.db was remade after launch but logins.json and logins-backup.json were not.

That's very odd - I just re-tested and everything was recreated for me - logins.json wasn't created until I reconnected sync or manually added a saved password, but it all worked fine.

So I tried to add a new password on the about:logins to see if my logins.json would be created but it would say I need a primary password. I don't have one (it's unchecked in preferences), but I tried anyway, and when I clicked on the button to provide my primary password, nothing happens.

So I thought maybe I just need to set a primary password, then remove it. But I'm unable to do so. I get a Password change failed. Unable to change Primary Password. error when I try to set my password. So maybe like it's tied to the fact that my profile thinks I have a primary password but I don't actually have one?

Here's what's in the browser console when I try to add a primary password:

NS_ERROR_FAILURE: 
    _getAllCookies resource:///modules/SiteDataManager.sys.mjs:281
    updateSites resource:///modules/SiteDataManager.sys.mjs:64
    initSiteDataControls chrome://browser/content/preferences/privacy.js:1303
    init chrome://browser/content/preferences/privacy.js:1220
    init chrome://browser/content/preferences/preferences.js:176
    initializeCategories chrome://browser/content/preferences/findInPage.js:115
    init chrome://browser/content/preferences/findInPage.js:64
SiteDataManager.sys.mjs:285:17
NS_ERROR_ABORT: User canceled primary password entry crypto-SDR.sys.mjs:137
NS_ERROR_ABORT: User canceled primary password entry crypto-SDR.sys.mjs:85
    encrypt resource://gre/modules/crypto-SDR.sys.mjs:85
    setSyncID resource://gre/modules/storage-json.sys.mjs:155
    InterpretGeneratorResume self-hosted:1413
    AsyncFunctionNext self-hosted:800
HTTPS-Only Mode: Not upgrading insecure request “http://o.pki.goog/wr2” because it is exempt.

Sync encountered an error - see about:sync-log for the log file. policies.sys.mjs:972:15
    resetFileLog resource://services-sync/policies.sys.mjs:972
NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAutoCompleteInput.popupElement] LoginManagerPrompter.sys.mjs:80
    observe resource://gre/modules/LoginManagerPrompter.sys.mjs:80
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. blank
NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAutoCompleteInput.popupElement] LoginManagerPrompter.sys.mjs:80
    observe resource://gre/modules/LoginManagerPrompter.sys.mjs:80

I think we've worked out the problem is certainly the logins system being broken, but we can't work out how to fix it. I'm shifting the component accordingly in the hope it will get the attention of people who understand that system better then me.

Component: Firefox Accounts → about:logins

Oddly, after updating to firefox 136, this no longer happens. Very confused but happy it's all been resolved.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: