Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: beta.8 might've introduced some weird authentication timeout crash bug #287

Open
2 tasks done
AlbertMarashi opened this issue Jun 24, 2024 · 9 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@AlbertMarashi
Copy link

AlbertMarashi commented Jun 24, 2024

Describe the bug

I think c063200 may have introduced some kind of timeout bug or authentication bug

Unhandled Rejection: VersionRetrievalFailure: Failed to retrieve remote version. If the server is behind a proxy, make sure it's configured correctly.
at file:///var/task/node_modules/surrealdb.js/esm/library/versionCheck.js:34:19
at runNextTicks (node:internal/process/task_queues:60:5)
at process.processTimers (node:internal/timers:511:9)
at async retrieveRemoteVersion (file:///var/task/node_modules/surrealdb.js/esm/library/versionCheck.js:28:25)
at async Surreal.connect (file:///var/task/node_modules/surrealdb.js/esm/surreal.js:78:29)
at async get_surreal_db_client (file:///var/task/.svelte-kit/output/server/chunks/hooks.server.js:159:3)
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.

This ends up crashing the app because it's not handling the error.

Steps to reproduce

I tested with local db version 5.3 and 1.4.2 in production, both were having these issues. Which makes me think it's SDK issue (I was previously running 0.11 and migrating to v1.0

However, downgrading to beta-7 appear to not have this issue

Expected behaviour

App should not crash, not exactly sure what is happening here

SurrealDB version

1.5.3 on production 1.4.2

SurrealDB.js version

1.0.0-beta.9

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@AlbertMarashi AlbertMarashi added the bug Something isn't working label Jun 24, 2024
@AlbertMarashi
Copy link
Author

I'm not sure exactly what's happening here, but I think it's some time out issue that happens after a certain amount of minutes, not sure exactly how long

@AlbertMarashi AlbertMarashi changed the title Bug: Beta-9 might've introduced some weird authentication crash bug Bug: beta.9 or beta.8 might've introduced some weird authentication timeout crash bug Jun 24, 2024
@AlbertMarashi AlbertMarashi changed the title Bug: beta.9 or beta.8 might've introduced some weird authentication timeout crash bug Bug: beta.8 might've introduced some weird authentication timeout crash bug Jun 24, 2024
@AlbertMarashi
Copy link
Author

Both beta.9 and beta.8 have this issue. beta.7 does not and likely has something to do with c063200

@AlbertMarashi
Copy link
Author

This appears to be an issue with the SDK doing pings on HTTP(s) protocol, when pings should only be used with the ws(s) protocol.

Temporary workaround: use websockets protocol to connect to server instead of HTTP(s)

@5hanth
Copy link

5hanth commented Jun 30, 2024

this happens with websockets as well.

@AlbertMarashi
Copy link
Author

this happens with websockets as well.

Did you try beta.7 to fix your issue?

@ioannist
Copy link

This issue was present in beta.12 too. The authenticated session expires and you have to setup a DB connection afresh. This means one of two things

  • An authentication timeout was introduced in surrealdb and the client must take care of renewing it
  • There was already a refresh-session functionality on the client but it is now broken
HttpConnectionError: There was a problem with authentication
    at HttpEngine.rpc (file:///var/task/node_modules/surrealdb.js/dist/index.mjs:1:33564)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Surreal.query_raw (file:///var/task/node_modules/surrealdb.js/dist/index.mjs:1:41722)
    at async Surreal.query (file:///var/task/node_modules/surrealdb.js/dist/index.mjs:1:41427)

@reinhard-sanz
Copy link

Have got the same problem as @ioannist :/
It's really annoying because it used to work once and now if the session expires your surrealdb client is basically bricked... 😅

@AlbertMarashi
Copy link
Author

@reinhard-sanz have you tried updating your surreal to a later version like beta.20 and using websocket instead of http?

-https://foo.com:8000
+wss://foo.com:8000
or
-http://foo.com:8000
+ws://foo.com:8000

@reinhard-sanz
Copy link

@AlbertMarashi ok after switching to websocket it seems to work now :) Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants