Closed Bug 1380412 Opened 7 years ago Closed 7 years ago

error finishing FxA sign-in: "The authentication token could not be found"

Categories

(Cloud Services :: Server: Firefox Accounts, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: luke, Assigned: vladikoff)

References

Details

In the last few days (reproduced across all my Firefox instances on Android, Linux, OSX, Nightly and Beta) I've been logged out of my FxA account (luke@mozilla.com) and prompted to reconnect.  When I try, the spinner stays spinning forever (in about:accounts) with a red "Working.." that appears.  (It rejects immediately with the wrong password, so I'm pretty sure I have the right password, also confirmed below.)

When I "Forget this email" and try to sign in from scratch in a new profile, I get the following message in Nightly:

1499882510872	FirefoxAccounts	ERROR	error POSTing /account/device: {"code":401,"errno":110,"error":"Unauthorized","message":"The authentication token could not be found","info":"https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format"}
1499882510872	FirefoxAccounts	ERROR	error POSTing /account/device: {"code":401,"errno":110,"error":"Unauthorized","message":"The authentication token could not be found","info":"https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format"}
1499882510977	FirefoxAccounts	ERROR	device registration failed: {"code":401,"errno":110,"error":"Unauthorized","message":"The authentication token could not be found","info":"https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format"}
1499882510977	FirefoxAccounts	ERROR	device registration failed: {"code":401,"errno":110,"error":"Unauthorized","message":"The authentication token could not be found","info":"https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format"}
1499882511013	FirefoxAccounts	ERROR	FxA rejecting with error AUTH_ERROR, details: getAssertion called without a session token
1499882511013	FirefoxAccounts	ERROR	FxA rejecting with error AUTH_ERROR, details: getAssertion called without a session token
1499882511014	FirefoxAccounts	ERROR	Could not retrieve profile data: Error: AUTH_ERROR (resource://gre/modules/FxAccounts.jsm:1484:18) JS Stack trace: _error@FxAccounts.jsm:1484:18 < _getAssertion/<@FxAccounts.jsm:640:15 < waitForSyncCallback@async.js:97:5 < makeSpinningCallback/callback.wait@async.js:166:27 < promiseSpinningly@async.js:232:12 < observe@bookmarks.js:1000:11 < observe@observers.js:132:7 < notify@observers.js:89:5 < observe@service.js:429:13 < observe@observers.js:132:7 < initializeWithCurrentIdentity/</<@browserid_identity.js:219:11 < promise callback*initializeWithCurrentIdentity/<@browserid_identity.js:200:7 < promise callback*initializeWithCurrentIdentity@browserid_identity.js:185:12 < observe@browserid_identity.js:275:7 < notifyObservers@FxAccounts.jsm:1160:5 < setSignedInUser/</<@FxAccounts.jsm:578:9 < promise callback*setSignedInUser/<@FxAccounts.jsm:569:14 < promise callback*setSignedInUser@FxAccounts.jsm:554:12 < login/<@FxAccountsWebChannel.jsm:322:14 < promise callback*login@FxAccountsWebChannel.jsm:321:12 < _receiveMessage@FxAccountsWebChannel.jsm:155:9 < listener@FxAccountsWebChannel.jsm:246:11 < deliver@WebChannel.jsm:324:9 < _listener@WebChannel.jsm:97:13
1499882511014	FirefoxAccounts	ERROR	Could not retrieve profile data: Error: AUTH_ERROR (resource://gre/modules/FxAccounts.jsm:1484:18) JS Stack trace: _error@FxAccounts.jsm:1484:18 < _getAssertion/<@FxAccounts.jsm:640:15 < waitForSyncCallback@async.js:97:5 < makeSpinningCallback/callback.wait@async.js:166:27 < promiseSpinningly@async.js:232:12 < observe@bookmarks.js:1000:11 < observe@observers.js:132:7 < notify@observers.js:89:5 < observe@service.js:429:13 < observe@observers.js:132:7 < initializeWithCurrentIdentity/</<@browserid_identity.js:219:11 < promise callback*initializeWithCurrentIdentity/<@browserid_identity.js:200:7 < promise callback*initializeWithCurrentIdentity@browserid_identity.js:185:12 < observe@browserid_identity.js:275:7 < notifyObservers@FxAccounts.jsm:1160:5 < setSignedInUser/</<@FxAccounts.jsm:578:9 < promise callback*setSignedInUser/<@FxAccounts.jsm:569:14 < promise callback*setSignedInUser@FxAccounts.jsm:554:12 < login/<@FxAccountsWebChannel.jsm:322:14 < promise callback*login@FxAccountsWebChannel.jsm:321:12 < _receiveMessage@FxAccountsWebChannel.jsm:155:9 < listener@FxAccountsWebChannel.jsm:246:11 < deliver@WebChannel.jsm:324:9 < _listener@WebChannel.jsm:97:13
1499882511069	Sync.ErrorHandler	ERROR	Sync encountered a login error

Interestingly, after this error, it shows me signed in to luke@mozilla.com, so the sign-in has succeeded to a degree.  If I restart the browser it still shows me signed in.  If I click the sync button in the hamburger menu, I see the following error:

1499883988953	FirefoxAccounts	ERROR	FxA rejecting with error AUTH_ERROR, details: getAssertion called without a session token
1499883988954	FirefoxAccounts	ERROR	Could not retrieve profile data: Error: AUTH_ERROR (resource://gre/modules/FxAccounts.jsm:1484:18) JS Stack trace: _error@FxAccounts.jsm:1484:18 < _getAssertion/<@FxAccounts.jsm:640:15 < promise callback*_getAssertion@FxAccounts.jsm:627:12 < async*_createRequest@FxAccountsProfileClient.jsm:87:21 < async*fetchProfile@FxAccountsProfileClient.jsm:213:12 < _fetchAndCacheProfileInternal/<@FxAccountsProfile.jsm:99:16 < promise callback*_fetchAndCacheProfileInternal@FxAccountsProfile.jsm:96:12 < _fetchAndCacheProfile@FxAccountsProfile.jsm:117:35 < getProfile/<@FxAccountsProfile.jsm:140:16 < promise callback*getProfile@FxAccountsProfile.jsm:126:12 < getSignedInUserProfile@FxAccounts.jsm:1515:12 < _getProfile@UIState.jsm:181:20 < async*_refreshFxAState@UIState.jsm:137:25 < async*refreshState@UIState.jsm:111:11 < async*init@UIState.jsm:79:5 < isReady@UIState.jsm:67:7 < isReady@UIState.jsm:241:12 < _maybeUpdateUIState@browser-sync.js:71:9 < init@browser-sync.js:106:5 < _delayedStartup/<@browser.js:1642:7 < requestIdleCallback handler*_delayedStartup@browser.js:1641:5 < EventListener.handleEvent*onLoad@browser.js:1365:5 < onload@browser.xul:1:1
1499883993113	FirefoxAccounts	ERROR	FxA rejecting with error AUTH_ERROR, details: getAssertion called without a session token
1499883993113	FirefoxAccounts	ERROR	FxA rejecting with error AUTH_ERROR, details: getAssertion called without a session token
1499883993114	FirefoxAccounts	ERROR	Could not retrieve profile data: Error: AUTH_ERROR (resource://gre/modules/FxAccounts.jsm:1484:18) JS Stack trace: _error@FxAccounts.jsm:1484:18 < _getAssertion/<@FxAccounts.jsm:640:15 < promise callback*_getAssertion@FxAccounts.jsm:627:12 < async*_createRequest@FxAccountsProfileClient.jsm:87:21 < async*fetchProfile@FxAccountsProfileClient.jsm:213:12 < _fetchAndCacheProfileInternal/<@FxAccountsProfile.jsm:99:16 < promise callback*_fetchAndCacheProfileInternal@FxAccountsProfile.jsm:96:12 < _fetchAndCacheProfile@FxAccountsProfile.jsm:117:35 < getProfile/<@FxAccountsProfile.jsm:140:16 < promise callback*getProfile@FxAccountsProfile.jsm:126:12 < getSignedInUserProfile@FxAccounts.jsm:1515:12 < _getProfile@UIState.jsm:181:20 < async*_refreshFxAState@UIState.jsm:137:25 < async*refreshState@UIState.jsm:111:11 < async*observe@UIState.jsm:101:9 < notify@observers.js:89:5 < onStartup/<@service.js:341:7
1499883993114	FirefoxAccounts	ERROR	Could not retrieve profile data: Error: AUTH_ERROR (resource://gre/modules/FxAccounts.jsm:1484:18) JS Stack trace: _error@FxAccounts.jsm:1484:18 < _getAssertion/<@FxAccounts.jsm:640:15 < promise callback*_getAssertion@FxAccounts.jsm:627:12 < async*_createRequest@FxAccountsProfileClient.jsm:87:21 < async*fetchProfile@FxAccountsProfileClient.jsm:213:12 < _fetchAndCacheProfileInternal/<@FxAccountsProfile.jsm:99:16 < promise callback*_fetchAndCacheProfileInternal@FxAccountsProfile.jsm:96:12 < _fetchAndCacheProfile@FxAccountsProfile.jsm:117:35 < getProfile/<@FxAccountsProfile.jsm:140:16 < promise callback*getProfile@FxAccountsProfile.jsm:126:12 < getSignedInUserProfile@FxAccounts.jsm:1515:12 < _getProfile@UIState.jsm:181:20 < async*_refreshFxAState@UIState.jsm:137:25 < async*refreshState@UIState.jsm:111:11 < async*observe@UIState.jsm:101:9 < notify@observers.js:89:5 < onStartup/<@service.js:341:7
1499883993121	Sync.ErrorHandler	ERROR	Sync encountered a login error
1499883998118	Sync.ErrorHandler	ERROR	Sync encountered a login error
Assignee: nobody → vlad
We identified the problem, it is due to the Secondary Emails feature. We are working on a fix.
Thanks!
Grisha, Vlad, and I hopped on a Vidyo call to debug this issue.

We found that signing in with another browser to the same account didn't fix things, which meant it was a server-side issue with the account. When I looked up Grisha's primary email in the emails table, it didn't exist. This led us to believe that this problem was caused by a db migration that didn't migrate everything that it should. And indeed, when you look at the migration https://github.com/mozilla/fxa-auth-db-mysql/blob/4fd4edd5337c68b1399d1dd5498efc59c1da5c43/lib/db/schema/patch-050-051.sql you see that it selects email addresses based on the uid, not on the email address. This means that if you added a secondary email before we migrated everyone's email address, and if we were running train-90, you wouldn't be able to sign in with your primary email address.

This affected 13 people in total (most of whom I've CCed on this bug). 2 of the affected persons were non-mozilla people.

I've run the correct migration so everyone's accounts should be fixed now, but you might need to reconnect your Firefox.
Julie reports that reconnecting the browser worked \o/
Yay, fixed for me too!  Closing since I opened it, but feel free to reopen if there is more to do here.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.