self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

[BUG] Cannot register on fresh installation

Open reanim8ed opened this issue 3 years ago • 16 comments

After fresh server setup I tried to register new user in the app.standardnotes.org platform with my custom server address in the advanced options form. Immedietly after POST request, I get expired login screen but loging in with same credentials doesnt work. In server logs I can see failed attempts logged. But if I check the users table in mysql container - it's still empty.

I tried to use these new credentials on default sync server - and I'm logged in. It seems that registration form doesnt care about custom server address account is not registered on the custom server but in api.standardnotes.com server instead.

Case in point: I can provide any link in custom server address, like: https://anything.google.com and system still return error: This email is already registered if I try to use the same email which was used to register in your standart server.

reanim8ed avatar Jun 09 '22 19:06 reanim8ed

A similar error for me, using a fresh install on a fresh server A server error occurred while trying to register. Please try again. Trying again shows An existing registration request is already in progress.

If I reload the page and attempt to sign in, I'm prompted to enter a two-factor authentication code, which I can't because I haven't signed in to set up 2fa.

stevensiebe avatar Jun 10 '22 18:06 stevensiebe

Same here!

Nicicalu avatar Jun 21 '22 14:06 Nicicalu

Same, any eta on a fix?

dasTor avatar Jun 23 '22 08:06 dasTor

Ensure you're up to date on both the client and backend. There's been a few changes in this area so if you're running older versions with newer clients you'll have this issue.

https://docs.standardnotes.com/self-hosting/updating

moughxyz avatar Jun 23 '22 13:06 moughxyz

i have updated my backend yesterday, client was freshly downloaded yesterday too. i can see in the error_console of the client (mac os) that even though custom sync server is set, the registration request is sent to standardnotes.com

dasTor avatar Jun 23 '22 14:06 dasTor

Ah, indeed. Looks like a recent regression caused by a refactor of our registration handler. Will be fixed by https://github.com/standardnotes/snjs/pull/771.

moughxyz avatar Jun 23 '22 17:06 moughxyz

Ah, indeed. Looks like a recent regression caused by a refactor of our registration handler. Will be fixed by standardnotes/snjs#771.

🙂 thanks!

Nicicalu avatar Jun 23 '22 18:06 Nicicalu

Thanks! It started working, after I ran:

./server.sh update

Nicicalu avatar Jun 27 '22 11:06 Nicicalu

Note that registrations made during the time the regression was live (I believe it was only the web app, for only a couple days) were made to our server, and those accounts will still exist in our server until deleted. Wit the fix now deployed, you'll have to re-register on your server.

moughxyz avatar Jun 28 '22 12:06 moughxyz

@moughxyz I'm having the same problem: I self-hosted the docker standalone server and upon the first login after registering I get asked a 2FA code which prevents me from logging in.

carlox97 avatar Jul 14 '22 23:07 carlox97

@moughxyz I'm having the same problem: I self-hosted the docker standalone server and upon the first login after registering I get asked a 2FA code which prevents me from logging in.

Did you run ./server.sh update on your server?

Nicicalu avatar Jul 15 '22 11:07 Nicicalu

@moughxyz I'm having the same problem: I self-hosted the docker standalone server and upon the first login after registering I get asked a 2FA code which prevents me from logging in.

Did you run ./server.sh update on your server?

Yes, I did. I'm trying to host a local istance (no https) before going public.

This is what I did/steps to reproduce, I didn't edit anything besides commands shown.

git clone --single-branch --branch main https://github.com/standardnotes/standalone.git
cd standalone
./server.sh setup

sed -i "s/auth_jwt_secret/$(openssl rand -hex 32)/g" .env
sed -i "s/secret/$(openssl rand -hex 32)/g" docker/auth.env
sed -i "s/legacy_jwt_secret/$(openssl rand -hex 32)/g" docker/auth.env
sed -i "s/secret_key/$(openssl rand -hex 32)/g" docker/auth.env
sed -i "s/server_key/$(openssl rand -hex 32)/g" docker/auth.env

./server.sh update

Status looks good, everything running, healtcheck OK.

I tried to register from iOS, Android, Windows using "http://10.0.0.100:3000", I got a generic error at times, upon clicking register, regardless of this error I cannot register with another account because "another registration in progress" (or something in those lines). Upon trying to log in from the app (any platform) I get prompted to input the 2FA code, which I don't have, obviously, and at the same time the logs show:

auth-standalone                      | query: SELECT `user`.`uuid` AS `user_uuid`, `user`.`version` AS `user_version`, `user`.`email` AS `user_email`, `user`.`pw_nonce` AS `user_pw_nonce`, `user`.`encrypted_server_key` AS `user_encrypted_server_key`, `user`.`server_encryption_version` AS `user_server_encryption_version`, `user`.`kp_created` AS `user_kp_created`, `user`.`kp_origination` AS `user_kp_origination`, `user`.`pw_cost` AS `user_pw_cost`, `user`.`pw_key_size` AS `user_pw_key_size`, `user`.`pw_salt` AS `user_pw_salt`, `user`.`pw_alg` AS `user_pw_alg`, `user`.`pw_func` AS `user_pw_func`, `user`.`encrypted_password` AS `user_encrypted_password`, `user`.`created_at` AS `user_created_at`, `user`.`updated_at` AS `user_updated_at`, `user`.`locked_until` AS `user_locked_until`, `user`.`num_failed_attempts` AS `user_num_failed_attempts` FROM `users` `user` WHERE `user`.`email` = ? -- PARAMETERS: ["************@protonmail.com"]
cache-standalone                     | 1:M 15 Jul 2022 20:18:19.492 * Background saving terminated with success
syncing-server-js-worker-standalone  | {"message":"Alive and kicking!","level":"info"}
auth-worker-standalone               | {"message":"Alive and kicking!","level":"info"}

carlox97 avatar Jul 15 '22 20:07 carlox97

I am still getting the enter 2-fa prompt when trying to create a new account on a brand new install.

Both backend and app are up to date.

pageb018 avatar Jul 19 '22 13:07 pageb018

I am still getting the enter 2-fa prompt when trying to create a new account on a brand new install.

Both backend and app are up to date.

Try to ./server.sh cleanup then delete all files and clone from repo again, following the basic setup instructions on their docs and run ./server.sh update. Then be sure there are no typos in email and pass when you register and try to create a password with a-z A-Z 1-9 and “!#”. I managed to login without the 2fa error in this way. Still no idea what I was doing wrong.

carlox97 avatar Jul 19 '22 14:07 carlox97

I am still getting the enter 2-fa prompt when trying to create a new account on a brand new install. Both backend and app are up to date.

Try to ./server.sh cleanup then delete all files and clone from repo again, following the basic setup instructions on their docs and run ./server.sh update. Then be sure there are no typos in email and pass when you register and try to create a password with a-z A-Z 1-9 and “!#”. I managed to login without the 2fa error in this way. Still no idea what I was doing wrong.

Thank you for this, however it did not work for me. I am getting a different error though. I tried the above and even tried a fresh install on a new machine from scratch.

I now receive an invalid user/pass error and see the following in the logs:

auth-standalone | query: SELECT user.uuidASuser_uuid, user.versionASuser_version, user.emailASuser_email, user.pw_nonceASuser_pw_nonce, user.encrypted_server_keyASuser_encrypted_server_key, user.server_encryption_versionASuser_server_encryption_version, user.kp_createdASuser_kp_created, user.kp_originationASuser_kp_origination, user.pw_costASuser_pw_cost, user.pw_key_sizeASuser_pw_key_size, user.pw_saltASuser_pw_salt, user.pw_algASuser_pw_alg, user.pw_funcASuser_pw_func, user.encrypted_passwordASuser_encrypted_password, user.created_atASuser_created_at, user.updated_atASuser_updated_at, user.locked_untilASuser_locked_until, user.num_failed_attemptsASuser_num_failed_attemptsFROMusers userWHEREuser.email = ? -- PARAMETERS: ["[email protected]"]

pageb018 avatar Jul 19 '22 14:07 pageb018

nvm, I am an idiot.

I needed to register the account first.

pageb018 avatar Jul 19 '22 14:07 pageb018