standardnotes / forum

Support from other community members. For 1-on-1 help, please contact help@standardnotes.com.
https://forum.standardnotes.org
193 stars 9 forks source link

macOS session refresh loop when self hosting #3635

Open alan-hkpanorama opened 1 week ago

alan-hkpanorama commented 1 week ago

Describe the bug Stuck in a login loop on macOS desktop app, unable to sync with self hosted server. Error messages:

To Reproduce Steps to reproduce the behavior: Login with username and password on macOS desktop app, after selecting custom sync server.

Expected behavior Sync notes without non-stop prompts to refresh session.

Screenshots

Screenshot 2024-06-21 at 1 48 30 PM

Desktop:

Additional context I've done a fresh install of the self host sync server using Docker, with connections through Cloudflare. Fresh install of Standard Notes on macOS as well. iOS app works no problem and syncs well. Issue is similar to #3513 and the error seems to be server side, with the relevant logs here:

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: ["EMAIL_HIDDEN"]

[...]

-- PARAMETERS: ["f67e5c16cbc7886b7ff15c21390d5b49"]
query: SELECT session.uuid AS session_uuid, session.user_uuid AS session_user_uuid, session.private_identifier AS session_private_identifier, session.hashed_access_token AS session_hashed_access_token, session.hashed_refresh_token AS session_hashed_refresh_token, session.access_expiration AS session_access_expiration, session.refresh_expiration AS session_refresh_expiration, session.api_version AS session_api_version, session.user_agent AS session_user_agent, session.created_at AS session_created_at, session.updated_at AS session_updated_at, session.readonly_access AS session_readonly_access, session.version AS session_version, session.application AS session_application, session.snjs AS session_snjs FROM sessions session WHERE session.private_identifier = ? -- PARAMETERS: ["f67e5c16cbc7886b7ff15c21390d5b49"]
{"application":"Desktop-3.194.0","level":"error","message":"No cookies provided for cookie-based session token.","method":"POST","secChUa":""Not=A?Brand";v="99", "Chromium";v="118"","service":"auth:server","sessionUuid":"d38a1c66-c770-44a6-bf28-c1962e266bc6","snjs":"2.209.3","url":"/v1/items","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) StandardNotes/3.194.0 Chrome/118.0.5993.54 Electron/27.0.0 Safari/537.36","userId":"986db3db-b74c-4c72-b232-3ff4ad78ce7f"}
query: SELECT revoked_session.uuid AS revoked_session_uuid, revoked_session.private_identifier AS revoked_session_private_identifier, revoked_session.user_uuid AS revoked_session_user_uuid, revoked_session.received AS revoked_session_received, revoked_session.created_at AS revoked_session_created_at, revoked_session.received_at AS revoked_session_received_at, revoked_session.user_agent AS revoked_session_user_agent, revoked_session.api_version AS revoked_session_api_version FROM revoked_sessions revoked_session WHERE revoked_session.private_identifier = ? -- PARAMETERS: ["f67e5c16cbc7886b7ff15c21390d5b49"]

ilfarpro commented 1 week ago

I also have same issue. Exactly the same steps to reproduce

alan-hkpanorama commented 6 days ago

I just tested on Windows in a VM as well - same error messages appearing.

taryujiai commented 2 days ago

I get this on Arch Linux using the AppImage as well.

self-hosted AppImage: 3.194.0

New Install: After logging in this infinite loop. Tested copying over ~/.config/Standard Notes from another machine that is working. Asks to reset key on initial launch. After it works fine on "new" install but now get this loop on "old" install.

alan-hkpanorama commented 18 hours ago

Turns out the workaround for now is to use the following version of standard notes server:

image: standardnotes/server:5c02435ee478b893747d3f9e41062aae12d7ff10

Worked for me, all is well again!

effieeee commented 5 hours ago

Hi, there was an issue discussed on our Discord group regarding the authorization tokens for the docker image, so we apologize for the trouble. Indeed a temporary workaround is to make use of the older image mentioned by @alan-hkpanorama, though I've also raised the authorization token issue with our back end developer, and we'll do our best to keep you posted 🙏