Closed sdfg2 closed 2 years ago
Hello , can you provide the HTTP request and its body( error message) from client ( from browser developer console -> Network) especially non-200 requests.
On server side, can you provide fxa-auth-server's logs?
Well, in the wonderful way of these things, it now no longer times out! It spits out an error this time though, 500, which is progress!
The request is https://api.fxa.mydomain.tld/v1/account/status
(where mydomain is my actual domain). The response is just a bog standard 500 internal server error. I checked my reverse proxy, and it's not there. The fxa-auth-server log shows :
dest-fxa-auth-server-1 | {"Timestamp":1664744953015000000,"Logger":"fxa-auth-server","Type":"request.summary","Severity":2,"Pid":30,"EnvVersion":"2.0","Fields":{"status":500,"errno":999,"path":"/v1/account/status","lang":"en-US,en;q=0.5","agent":"Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0","remoteAddressChain":"[\"10.1.2.3\",\"10.1.0.1\",\"172.19.0.12\"]","t":39,"uid":"00","keys":false,"method":"post","email":"theuser@mydomain.tld"}}
dest-fxa-auth-server-1 | {"Timestamp":1664744953015000000,"Logger":"fxa-auth-server","Type":"metricsEvents.emitFlowEvent","Severity":2,"Pid":30,"EnvVersion":"2.0","Fields":{"event":"route./account/status.500.999","missingFlowId":true}}
I've only just come back to Firefox after what feels like a thousand years, so apologies if I'm not copying the correct information across. Also there is still this error happening with every logging driver set to json-file, so I'm not sure how much else I can give you from the docker logs, but I'll try!
It's quite wired. v1/account/status
only checks if domain is valid (not applied here maybe) and whether account is in the db.
I guess the question maybe db related.
Maybe a full fxa-auth-server
log will help.
How do I go about getting a full log? I'm very new to trying to debug docker stuff
Edit: Just realised, I haven't actually got an account yet. I presumed it would check the db, then go 'oops, you don't have an account yet, sign up now'. I don't know how else to sign up.
Edit 2: Just tried to sign up for actual firefox sync, and it says 'sign in or sign up'. Mine just says 'sign in'. So maybe that's what the problem is after all? In which case, how do I sign up to my own server? XD
you can docker-compose logs fxa-auth-server > /tmp/somepath.log
and check /tmp/somepath.log
I presumed it would check the db, then go 'oops, you don't have an account yet, sign up now'. I don't know how else to sign up. You're right. In the main page , Enter the email address, then click "Continue" ,fxa will check if the account exists, and let you login (account exists) / sign up (account not exists)
Doing that, the only thing that shows up for the activity is this:
dest-fxa-auth-server-1 | Connection Error: Error: Connection lost: The server closed the connection.
dest-fxa-auth-server-1 | {"Timestamp":1664892338394000000,"Logger":"fxa-auth-server","Type":"request.summary","Severity":2,"Pid":30,"EnvVersion":"2.0","Fields":{"status":500,"errno":999,"path":"/v1/account/status","lang":"en-US,en;q=0.5","agent":"Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0","remoteAddressChain":"[\"10.1.2.3\",\"10.1.0.1\",\"172.19.0.12\"]","t":39,"uid":"00","keys":false,"method":"post","email":"me@myemail.tld"}}
dest-fxa-auth-server-1 | {"Timestamp":1664892338395000000,"Logger":"fxa-auth-server","Type":"metricsEvents.emitFlowEvent","Severity":2,"Pid":30,"EnvVersion":"2.0","Fields":{"event":"route./account/status.500.999","missingFlowId":true}}
Well, that doesn't help more.
Could you provide the generated docker-compose.yml and/or config.yml. (Remember to redact your info).
Sure!
config.yml
docker-compose.yml
For good luck, my nginx conf for fxa:
``` server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name www.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name profile.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name token.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name api.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name oauth.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name graphql.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { ### Logging ### Core listen my.ip.add.ress:443 ssl http2; listen 10.1.0.1:443 ssl http2; server_name channelserver.fxa.mydomain.tld; ### TLS include /etc/nginx/conf/00-tls-base.conf; ssl_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/fxa.mydomain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/fxa.mydomain.tld/fullchain.pem; ### ACL include conf/10-acl-mydomain.tld.conf; deny all; ### Bots include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf; ### Paths location / { proxy_pass http://10.1.2.3:1234/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ```
Sadly , i can not reproduce the problem.
(but found another unrelated problem with exim local-relay and fixed)
The old docker-compose (python one) (https://github.com/docker/compose/releases/tag/1.29.2) has no Error response from daemon: configured logging driver does not support reading
problem. you can try that.
dest-fxa-auth-server-1 | Connection Error: Error: Connection lost: The server closed the connection.
I found this line. it may indicate that there's connection error between database and fxa-auth-server. Please check your database.
Basically a normal fxa-auth-server starts with log like this:
To check db connect you may do as follow to enter fxa-auth-server' shell
docker-compose exec -u root fxa-auth-server /bin/bash
In the container's shell
apt update -y -qq && apt install -y -qq default-mysql-client-core
mysql -h mysqldb -uroot -e 'show databases;'
It should output
+--------------------+
| Database |
+--------------------+
| information_schema |
| fxa |
| fxa_oauth |
| fxa_profile |
| mysql |
| performance_schema |
| pushbox |
| sync |
| sys |
+--------------------+
If above is work, then try restart fxa-auth-server by docker-compose restart fxa-auth-server
, and check log whether connection is still lost.
Ok, mysql just shows the following:
root@a1ff8be257cf:/fxa/packages/fxa-auth-server/dist/fxa-auth-server# mysql -h mysqldb -uroot -e 'show databases;'
+--------------------+
| Database |
+--------------------+
| information_schema |
| fxa |
| mysql |
| performance_schema |
| pushbox |
| sync |
| sys |
+--------------------+
It makes me more confused. Connection is OK , but some database (fxa_profile,fxa_oauth) is missing.
Have you tried a clean restart ? (stop , remove ./mysql_data folder , start).
Well, progress! I flattened and reinstalled everything, and all the tables are correct. Then I got a 'failed to send email' error, and 'unexpected error' after that. Refreshing the page to do some network debugging I put my email in and it just asked for a password - so at least it registered an account - but then throws the unexpected error again. The errors it throws are these:
dest-fxa-auth-server-1 | {"Timestamp":1665005140745000000,"Logger":"fxa-auth-server","Type":"mailer.send.error","Severity":2,"Pid":32,"EnvVersion":"2.0","Fields":{"err":"Invalid login: 503 AUTH command used when not advertised","code":"EAUTH","to":"myemail@domain.tld","template":"verifyLoginCode"}}
dest-fxa-auth-server-1 | {"Timestamp":1665005140765000000,"Logger":"fxa-auth-server","Type":"request.summary","Severity":2,"Pid":32,"EnvVersion":"2.0","Fields":{"status":500,"errno":999,"path":"/v1/account/login","lang":"en-US,en;q=0.5","agent":"Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0","remoteAddressChain":"[\"10.1.2.3\",\"10.1.0.1\",\"172.28.0.15\"]","t":280,"uid":"00","service":"sync","reason":"signin","keys":true,"method":"post","email":"myemail@domain.tld"}}
I did read in another set of non-docker instructions that you had to manually set the email verified flag in the database, but that was because it wasn't tied to an MTA, but I see that there is an exim container here.
That's what i said the unrelated-but-fixed problem. (since i do not use exim relay, i haven't tested much on that before)
I fixed this exim issue in the latest commit. Please update this repo and retry , thanks.
Hurray! Everything works now. I was wondering though if you could be a bit more specific in the instructions with what to do for fenix based browsers? There's no reference in the _init
file to Fenix, just Fennec, and the file itself is very confusing without knowing exactly what to look for. :-(
EDIT: Also
services.sync.syncInterval = 60
services.sync.syncThreshold = 10
are not there in about:config, should I add them? The link you provide gives a 404 for further information.
For fenix. Instruction is generated and outputed by init.sh, may be you missed it , like
Config for Fenix(Firefox android)
Enable "Secret Menu" See: https://github.com/mozilla-mobile/fenix/pull/8916
"Custom Firefox Account server":"https://www.example.com",
"Custom Sync server": "https://token.example.com/token/1.0/sync/1.5",
Well these configs are optional. You can add if not exists. See https://searchfox.org/mozilla-central/source/services/sync/modules/policies.js#262
The link is https://github.com/mozilla/fxa/blob/main/packages/fxa-dev-launcher/profile.mjs
now.
I have those instructions for Fenix, I'm referring to the ones in the readme here:
you need edit /_init/auth/oauthserver-prod.json edit fenix' redirecturi and add scope
"scope": "https://identity.mozilla.com/tokens/session"
edit _init/content/contentserver-prod.json oldsync redirecturi oauth/success/a2270f727f45f648
I updated the README.By default, you don't need do anything. It's pre-configured, but could be changed by advanced users.
Ahh! Good! All done, thank you for your help.
Are you planning on moving to syncstorage_rs at any point?
Currently no. Support the situation that beginning with syncstorage-rs is not hard.
The hard part is to support the situation that converting from old syncserver to syncstorage-rs
Unless the tools/scripts to convert datebase from old syncserver to syncstorage-rs is done (table schema,node assignment and url routes), i will not start supporting.
See comments https://github.com/mozilla-services/syncstorage-rs/issues/1051#issuecomment-924885375 and https://github.com/mozilla-services/syncstorage-rs/issues/1051#issuecomment-924973833
Ah, was just wondering. Maybe two projects, one for syncstorage and the current one for syncserver? Then you would be able to let new people use syncstorage until such time as there's a migration path for others on syncserver.
I set up everything as in the wonderful documentation. I'm using my own nginx as a reverse proxy. All the containers start correctly, and my nginx proxying works (the sign up page shows up).
When I get to the sign in page, I put my email address in and hit the button and it just spins and times out. The browser console shows these errors:
I tried working around this to get the nginx logs, but even after setting every logging driver to
json-file
indocker-compose.yml
I always just getError response from daemon: configured logging driver does not support reading
when runningdocker-compose logs
. I don't run docker usually, but this is one of the few projects where docker makes sense. Unfortunately, that means I have no idea how to track down problems!Any advice?