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

Relation does not exist in Deno Deploy sometimes #81

Open
w7it opened this issue May 20, 2024 · 3 comments
Open

Relation does not exist in Deno Deploy sometimes #81

w7it opened this issue May 20, 2024 · 3 comments

Comments

@w7it
Copy link

w7it commented May 20, 2024

Steps to reproduce

Sometimes after fresh deployment to Deno Deploy my API is stucked with error relation "..." does not exist

I do nothing and after some time without any changes in code and configs it starts working again perfectly...

How it possible?.. I think the problem could be in the Deno Deploy and how they are sharing resources between lambdas... But I'm still investigating

Maybe somebody has same problem?

Expected result

It should works fine

Actual result

It works bad sometimes

Environment

Deno Deploy
@neondatabase/serverless v0.9.3 from npm

Logs, links

error: error: relation "users" does not exist
    at sn.parseErrorMessage (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1182:6)
    at sn.handlePacket (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1143:13)
    at sn.parse (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1127:36)
    at E.<anonymous> (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1190:16)
    at E.emit (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:397:12)
    at WebSocket.<anonymous> (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:988:80)
    at innerInvokeEventListeners (ext:deno_web/02_event.js:754:7)
    at invokeEventListeners (ext:deno_web/02_event.js:801:5)
    at dispatch (ext:deno_web/02_event.js:658:9)
    at WebSocket.[[[eventLoop]]] (ext:deno_websocket/01_websocket.js:456:11)
Caused by error: relation "users" does not exist
    at sn.parseErrorMessage (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1182:6)
    at sn.handlePacket (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1143:13)
    at sn.parse (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1127:36)
    at E.<anonymous> (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:1190:16)
    at E.emit (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:397:12)
    at WebSocket.<anonymous> (file:///node_modules/.deno/@[email protected]/node_modules/@neondatabase/serverless/index.mjs:988:80)
    at innerInvokeEventListeners (ext:deno_web/0
@jawj
Copy link
Collaborator

jawj commented May 20, 2024

Hmm, that's a surprising error to get only intermittently.

How are you making/reusing connections? On platforms such as Cloudflare Workers, it's important to connect, query and disconnect within your response function, since connections are not held open outside of one.

If you're not using interactive transactions and don't need node-postgres compatibility, you could also try switching to the driver's http transport (import { neon } from '@neondatabase/serverless) — check the README or docs.

@w7it
Copy link
Author

w7it commented May 20, 2024

Thanks for advice @jawj! I'm using Pool from @neondatabase/serverless because I need node-postgres compatibility. But maybe I'll try to rewrite my database driver for kysely beacuse my app don't use transactions at all...

@jawj
Copy link
Collaborator

jawj commented Jun 26, 2024

What's the status of this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants