Closed Bug 1860725 Opened 7 months ago Closed 7 months ago

Cannot sign in into Firefox account

Categories

(Fenix :: Accounts and Sync, defect, P1)

Firefox 121
All
Android

Tracking

(firefox119 unaffected, firefox120+ verified, firefox121+ verified)

VERIFIED FIXED
121 Branch
Tracking Status
firefox119 --- unaffected
firefox120 + verified
firefox121 + verified

People

(Reporter: mlobontiuroman, Assigned: mcarare)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Prerequisites

Make sure you have a clean profile on the Android device.

Steps to reproduce

  1. Sign in with valid credentials on Desktop.
  2. On Desktop go to https://accounts.firefox.com/pair.
  3. On Android, go to Settings - Sync and save your data - Ready to scan.
  4. Scan the QR code displayed on Desktop.
  5. Confirm the pairing on both devices.

Expected behavior

The user is signed in without issues.

Actual behavior

Cannot sign in.
On Desktop, the page displays the "Device connected" message, but on Android the "Approval now required" custom tab is still displayed.

Device information

  • Firefox version: Beta 120.0b1, Nightly 121.0a1
  • NOT reproducible on RC 119.0 build 2
  • Android devices: Sony Xperia Z5 Premium (Android 7.1.1), Xiaomi Mi8 Lite (Android 10), Google Pixel 7 Pro ( Android 14), OnePlus 6T (Android 9), Redmi Pad (Android 12)

Any additional information?

  • Reproducible also when trying to sign in via email.
  • Reproducible also when trying to sign in via the second onboarding card.
  • On some devices, having 1 tab opened, solves the issue, the user can sign in.

Additional: a new account cannot be created on the same affected builds.
After inserting the confirmation code received on email, the user is redirected to the "Manage accounts" page.
The account is created, but the user is not signed in (I've tried creating the same account again, but it is recognized as an "old" account).

I saw a similar bug report on matrix. Link and the user share a video to demonstrate it

... the login for Sync is busted on Nightly Android
I just can't man, I just can't.
I scan the QR, it forces me to login anyway, it dumps me on my account page. I'm not signed into firefox. Rinse, repeat, same crap.
and its already logged me out of the webpage too, and I have a very long secure password. What an absolute nightmare.

Keywords: regression
Regressed by: 1812797

:royang the regressor was written by a volunteer contributor, and amejia is on pto until tomorrow...could you take a look? Is the best option here to back this out?

Flags: needinfo?(royang)
Flags: needinfo?(royang)

I found the log

10-24 23:11:21.128  5700  6855 W error_support::handling: Network error: [no-sentry] Network error: Java error: "fetch error: No direct method <init>(Ljava/lang/String;Lmozilla/components/concept/fetch/Request$Method;Lmozilla/components/concept/fetch/MutableHeaders;Lkotlin/Pair;Lkotlin/Pair;Lmozilla/components/concept/fetch/Request$Body;Lmozilla/components/concept/fetch/Request$Redirect;Lmozilla/components/concept/fetch/Request$CookiePolicy;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Lmozilla/components/concept/fetch/Request; or its super classes (declaration of 'mozilla.components.concept.fetch.Request' appears in /data/app/~~KyZXg9zG9RrMn3v42pkGYA==/org.mozilla.fenix-s-t5101ty3wxE8UYfMDjdQ==/base.apk!classes2.dex)"
10-24 23:11:21.129  5700  6855 E FirefoxAccount: Error while running: begin oauth flow
10-24 23:11:21.129  5700  6855 E FirefoxAccount: mozilla.appservices.fxaclient.FxaException$Network: network error
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.read(fxa_client.kt:8)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.read(fxa_client.kt:1)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverter$DefaultImpls.liftFromRustBuffer(fxa_client.kt:13)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(fxa_client.kt:6)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.liftFromRustBuffer(fxa_client.kt:2)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.liftFromRustBuffer(fxa_client.kt:1)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterRustBuffer$DefaultImpls.lift(fxa_client.kt:7)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.lift(fxa_client.kt:3)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FfiConverterTypeFxaError.lift(fxa_client.kt:2)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FxaException$ErrorHandler.lift(fxa_client.kt:2)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FxaException$ErrorHandler.lift(fxa_client.kt:1)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.Fxa_clientKt.checkCallStatus(fxa_client.kt:75)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.Fxa_clientKt.access$checkCallStatus(fxa_client.kt:1)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.FirefoxAccount.beginOauthFlow(fxa_client.kt:88)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.PersistedFirefoxAccount$beginOAuthFlow$1.invoke(PersistedFirefoxAccount.kt:2)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.PersistedFirefoxAccount$beginOAuthFlow$1.invoke(PersistedFirefoxAccount.kt:1)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.PersistedFirefoxAccount.withMetrics(PersistedFirefoxAccount.kt:16)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.PersistedFirefoxAccount.beginOAuthFlow(PersistedFirefoxAccount.kt:22)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.appservices.fxaclient.PersistedFirefoxAccount.beginOAuthFlow$default(PersistedFirefoxAccount.kt:12)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.components.service.fxa.FirefoxAccount$beginOAuthFlow$2$2.invokeSuspend(FirefoxAccount.kt:31)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.components.service.fxa.FirefoxAccount$beginOAuthFlow$2$2.invoke(FirefoxAccount.kt:11)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.components.service.fxa.UtilsKt.handleFxaExceptions(Utils.kt:4)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.components.service.fxa.UtilsKt.handleFxaExceptions(Utils.kt:17)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at mozilla.components.service.fxa.FirefoxAccount$beginOAuthFlow$2.invokeSuspend(FirefoxAccount.kt:45)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:112)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:4)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
10-24 23:11:21.129  5700  6855 E FirefoxAccount:        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:96)
10-24 23:11:21.129  5700  5900 I FirefoxAccountStateMachine: withRetries: attempt 2/3

Please back out.

Flags: needinfo?(dsmith)

The reason may be that the function signature of mozilla.components.concept.fetch.Request is not synced with Rust part.

FxA prod is currently having trouble - FirefoxAccount: mozilla.appservices.fxaclient.FxaException$Network: network error doesn't look like something that could be caused by this patch. Which isn't to say there isn't anything wrong with this patch, just that the above log might not be directly related.

I'm sorry that it is directly related. See https://bugzilla.mozilla.org/show_bug.cgi?id=1860725#c6

Flags: needinfo?(markh)
Status: NEW → RESOLVED
Closed: 7 months ago
Flags: qe-verify+
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

I can see how that might cause a referer header to not be passed on etc, but it's not immediately obvious to me how that different could use our Rust component to make a network request which fails. Regardless, it's been backed out how so it's a bit of a moot point. FWIW, changing viaduct is going to be a challenge as it's also used in moz-central.

Flags: needinfo?(markh)

I'm also curious about why lacking parameter private is ok ?

Ok , i understood, application-services compiles with old signature (so private is ok here) api "org.mozilla.components:concept-fetch:$android_components_version" , and run with new signature ( so it couldn't find suitable init method of Request) .

Well ..... That explains.


So if we want to change Request's signature , we must do following work in a transaction : 1) we update Request's signature in android-components then 2) we must require application-services update its dependency of android-components immediately and 3) then Fenix include new application-services immediately.

We should add document comment or linter on these types to warning how to update function signature.

Flags: needinfo?(dsmith)

and run with new signature ( so it couldn't find suitable init method of Request) .

If that was true I think we'd expect a compilation error rather than a mozilla.appservices.fxaclient.FxaException$Network: network error. The new param has a default value so that seems like it should be fine to me.

(so private is ok here)

I also don't understand how private got involved - isn't the new param referrerUrl? Are you seeing compilation errors regarding either of these params?

If that was true I think we'd expect a compilation error rather than a mozilla.appservices.fxaclient.FxaException$Network: network error. The new param has a default value so that seems like it should be fine to me.

No compilation error will occur. Application-services will compile successfully with android-components 117 , which provides signature of init method of Request: Request( ...... val private: Boolean = false,) . However when runtime , it will ask android-components 121 to provide this init method , however in android-components 121 there's only Request( ...... val private: Boolean = false, val refererUrl: String? = null) which leads to NuSuchMethodError.

It just like compiling with dependency A.jar which provide Func1(String) , but running with dependency B.jar which provide Func1(Int).

Some explain from Stackoverflow

If the class is not found, you get a ClassNotFoundException. If you changed the F class between compilation of A and execution, and dropped, for example, the F(int) constructor, then you get several different ugly exceptions.

NoSuchMethodError is handled here , it is too general to include all error as network error ?


I also don't understand how private got involved - isn't the new param referrerUrl? Are you seeing compilation errors regarding either of these params?

At first , i just can't figure out why parameter private is also not explicit passed in rust side but not causing error. It is basically not related.

Verified as fixed on the latest Fenix Nightly 121.0a1 from 10/25, and on Beta 120.0b2, and the sign in is done without issues.
Tested with:

  • Samsung Galaxy Tab S8 Ultra (Android 12),
  • Xiaomi Mi8 Lite (Android 10),
  • Google Pixel 6 (Android 14),
  • Xiaomi Redmi Note 8T (Android 11),
  • OnePlus A3000 (Android 6).
Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment on attachment 9360039 [details] [review]
[mozilla-mobile/firefox-android] Bug 1860725 - Revert "Bug 1812797 - Add referrerUrl to Request" T (backport #4209) (#4212)

Beta/Release Uplift Approval Request

  • User impact if declined:
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Test sign-in flow.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9360039 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Flags: qe-verify+

Thanks everybody which helped in detecting and addressing this issue ❤️!!

Comment on attachment 9360039 [details] [review]
[mozilla-mobile/firefox-android] Bug 1860725 -  Revert "Bug 1812797 - Add referrerUrl to Request"   T (backport #4209) (#4212)

This was already approved and merged for Mobile 120.0b2 which rolled out today 2023-10-25.
Attachment #9360039 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assignee: nobody → mcarare
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: