jackyzy823 / fxa-selfhosting

Selfhosting your own Firefox Accounts (FxA)!
Mozilla Public License 2.0
96 stars 13 forks source link

fxa-auth-server error " _b.histogram is not a function" when hit "sync now" on android firefox #21

Closed hamkido closed 8 months ago

hamkido commented 8 months ago

Thank you for your excellent work. I have set up services by following the readme, and it can sync my Firefox desktop data.

If you need more information, please let me know, and I will provide it as soon as possible. Thank you once again.

jackyzy823 commented 8 months ago

Ok , thats a fxa bug:

https://github.com/mozilla/fxa/blob/main/packages/fxa-auth-server/bin/key_server.js#L52 "histogram" function is not mocked.


May i ask the sync function in Firefox for android works or not.

If it works, you could just ignore it.

// I guess it will work, because when error here, no result would be returned from redis, then all tokens are fetched directly from database.

jackyzy823 commented 8 months ago

I opened a issue https://github.com/mozilla/fxa/issues/16491

hamkido commented 8 months ago

May i ask the sync function in Firefox for android works or not.

If it works, you could just ignore it.

// I guess it will work, because when error here, no result would be returned from redis, then all tokens are fetched directly from database.

In my previous testing, Firefox for android sync wasn't working, I'll test again to confirm.

hamkido commented 8 months ago

I deleted the database and started a new fxa.

When I re-register and log into Firefox for android "Settings -> Account Settings -> Sync" now continues to show "Last sync: Never"

I also tested whether the custom sync server could be reached by the mobile network. I can connect to the custom sync server ("https://token.fxa.example.com/token/1.0/sync/1.5") over the network. And "https://token.fxa.example.com" shows "It works".

So I don't know how to troubleshoot this issue. If you need any information please let me know.

branch: master android firefox application verison: fenix 110.0.1

jackyzy823 commented 8 months ago

I'm sorry that i cannot reproduce that.

In my test , although there're logs of "_b.histogram is not a function " , Fenix is still able to sync.

I can see the opening tabs of Fenix from Firefox Desktop , also vice versa.

Here's some hint:

  1. Try upgrade Firefox android to the latest
  2. Double check the url you input in "Sync Debug"
  3. Check if your device appear in management site ( https://www.fxa.example.com ) or "Firefox View" or "Send tabs to devices"
  4. Try get log from your android devices via adb logcat ( those logs contains 1. fxa 2. sync_manager 3. sync15)
hamkido commented 8 months ago

After I reinstall lastest Fennec 123.0.0, android sync works. Interestingly, I've tried using this version before without success. https://github.com/jackyzy823/fxa-selfhosting/issues/21#issue-2156750043 I'm not sure what went wrong locally at the time, so it's hard to troubleshoot. It works now. Thank you for your help