question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connections from repl.it repls randomly failing with various errors

See original GitHub issue

Bug description

Prisma connections from a lot of my repl.it repls randomly fail with various errors due to unknown reasons.

Here are the errors I’ve seen (Descending order of frequency):

[ERROR] : 
Invalid `prisma.workspace.findUnique()` invocation:
  Can't reach database server at `ec2-50-19-32-202.compute-1.amazonaws.com`:`5432`
Please make sure your database server is running at `ec2-50-19-32-202.compute-1.amazonaws.com`:`5432`.
Invalid `prisma.workspace.findUnique()` invocation:
  Error creating a database connection. (Operation timed out (mobc timeout))
    at new AuthorizationError (/home/runner/InfoBot-old-2/node_modules/@slack/oauth/dist/errors.js:71:28)
    at InstallProvider.<anonymous> (/home/runner/InfoBot-old-2/node_modules/@slack/oauth/dist/index.js:158:31)
    at step (/home/runner/InfoBot-old-2/node_modules/@slack/oauth/dist/index.js:44:23)
    at Object.throw (/home/runner/InfoBot-old-2/node_modules/@slack/oauth/dist/index.js:25:53)
    at rejected (/home/runner/InfoBot-old-2/node_modules/@slack/oauth/dist/index.js:17:65)
Invalid `prisma.channel.upsert()` invocation:
  Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#connection-pool). Current limit: 5, amount of connections currently in use: 0.
    at Object.asCodedError (/home/runner/HackClubKarma/node_modules/@slack/bolt/dist/errors.js:23:12)
    at App.handleError (/home/runner/HackClubKarma/node_modules/@slack/bolt/dist/App.js:442:43)
    at App.processEvent (/home/runner/HackClubKarma/node_modules/@slack/bolt/dist/App.js:435:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Note

I’ve already spoken to folks at repl.it and @nikolasburk – here’s some context:

Screenshot of message from @nikolasburk with text: "All right, thanks for sharing! I've just checked back with our engineers and I think the best way to tackle this is to create an issue so that someone from the engineering team can look into this properly. It seems like nobody really has experience with repl.it yet but we definitely want to make sure that it's properly supported! Ideally we even get to a point where we can say Prisma reliably works on repl.it and can add it to our e2e tests. Does that sound ok to you?"

How to reproduce

Not always reproducible. Occurs randomly and can only fixed by creating a fresh copy of (forking) the repl

Affected repls:

Expected behavior

  • Prisma can connect to the database (since it works locally and via psql)

Prisma information

datasource db {
    url      = env("DATABASE_URL")
    provider = "postgresql"
}

generator client {
    provider = "prisma-client-js"
}

model Workspace {
    id           String @id
    installation String
}

Environment & setup

  • OS: Linux
  • Database: PostgreSQL
  • Node.js version: v12.16.1
  • Prisma version: 2.14.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
khrjcommented, Feb 10, 2021

If you have the time, it would be very helpful if you could try to explicitly call the disconnect in your code. This way we can ensure there are no dangling connections and see if the problem persists. A pattern for doing that is detailed here: https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#calling-disconnect-explicitly

Hi, I’ll surely try that but I’m not sure how long it will take to know if the problem is solved, since the issue randomly reproduces

0reactions
garrensmithcommented, Apr 1, 2022

Hey @KhushrajRathod, I think this could be fixed. Would you be able to try with out with prisma@dev

Read more comments on GitHub >

github_iconTop Results From Across the Web

repl.it fails to connect - Replit
repl.it keeps on failing while trying to test any Python 3 code. It throws "Failed to connect. Reconnecting." error message alyways.
Read more >
Error with all repls - Replit
I had 3 discord bots running on repl, Suddenly all of them stopped working, When I try to restart them this error happens...
Read more >
why it keeps fail to connect? - Replit
'Failed to connect, retrying' popped up so many times. How can i solve it?
Read more >
Check for Syntax Errors - Replit
Hello, I've been very interested in incorporating repl.it into our classrooms at my ... doesn't appear to be any syntax error highlighting in...
Read more >
When i try and run this script, it gives me an error. it is below ...
Repl.it: Updating package configuration --> python3 -m poetry add discord Using ... parse error at "'- (==0.1'" exit status 1 Repl.it: Package operation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found