[BUG] Authentication fails with "Unknown error."
Describe the bug I am using the self-hosted standard notes server for quite a long time. I connect to it with the mobile, desktop or web app. For some days I can't log in with my credentials to the server anymore. The web app only shows an "Unknown error.". When filling the Authentication Required dialog in the desktop app, it shows an "Invalid authentication. Please try again." error.
The credentials are 100% correct and I also checked all the hints mentioned in this help post.
I have also got a client running where I am still logged in. I tried to create an export (because I need to type in my password) und that works. Thus, the credentials are correct and sometimes working.
To Reproduce Steps to reproduce the behavior:
- Try to login with the correct credentials
- Application shows error message (depends on the client)
Expected behavior Successful login.
Logs
When I try to login in the web app, the log of the server shows the following:
{"level":"INFO","time":"2021-07-14T15:29:39.822+00:00","message":"{\"method\":\"GET\",\"path\":\"/v1/login-params\",\"format\":\"*/*\",\"controller\":\"ApplicationController\",\"action\":\"route_not_found\",\"status\":404,\"duration\":0.31,\"view\":0.13,\"dd\":{\"trace_id\":\"0\",\"span_id\":\"0\",\"env\":\"\",\"service\":\"\",\"version\":\"\"},\"ddsource\":[\"ruby\"],\"time\":7873241.211612376,\"params\":{\"email\":\"[email protected]\",\"api\":\"20200115\",\"controller\":\"application\",\"action\":\"route_not_found\",\"unmatched_route\":\"v1/login-params\",\"application\":{}},\"level\":\"WARN\"}","ddsource":["ruby"]}
Service Versions:
The latest version of the standardnotes/syncing-server:stable docker image.
Additional context Maybe there are connection points with this issue!?
Hi @mhellmeier, I'm not a developer of this project but it looks like you're using the legacy ruby based syncing-server, not the new node based one. I know that there were updates to the clients recently which may break compatibility with the old sync server.
Migrating to the new sync server was pretty easy, and there is a guide here: https://docs.standardnotes.org/self-hosting/legacy-migration/
I don't know if my comment is related. If not, I might open a new issue with it. I tried a migration but it did not work well: https://github.com/standardnotes/standalone/issues/23. Now I started over with a fresh install of the server without migrating the old database. But that leads to authentication issues on my mobile. I'm not sure if the mobile app after the update still communicates with my self hosted server.
I came across this Unknow Error issue as well with my own self-hosted sync and app server with self-signed SSL certificates. I don't have logs to provide but I can provide the following:
- Able to log in using browsers on Windows, Android, and iOS (iPad Pro), so I know that my servers are set up right. (Only able to log in using Chrome on iPad Pro after I installed the certs, before that it gave the Unknow Error too.)
- Due to it's self-signed certificates, I needed to manually import/install the certs on my devices (Android, iOS, Windows, etc).
- After I've installed all the certificates on my iPad Pro, the "Unknown Error" went away on the iOS apps.
- However, it's still not working on Android even after I've installed the certs. Able to log in using Chrome but not the app.
I suspect that it still has something to do with how the app or Android handles the self-signed certs given how I made the iOS app and browser logins to work.
- I'm not using any legacy server, my servers were deployed just a couple of days ago following their docker methods.
Thanks a lot for the hint, @eric-pierce ! I just tried the migration guide and it solved my problem. Here is a little note if anybody also wants to migrate:
The mentioned mysqldump command doesn't work as expected. First, there is a space at the wrong position. It also leads to the following error:
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
This can be fixed with the --no-tablespaces flag. This results in the following, correct command:
$ docker exec your_db_container_id sh -c 'exec mysqldump your_database_name -u your_username -p"your_password" --no-tablespaces' > ./dbdump.sql
I had a similar error ("Unknown error.") when trying to connect with the latest server and latest app, but I tried again a couple hours later and it worked. No idea why, nothing should have changed and the mobile and web app worked fine before.