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

Error Message Error: write CONNECT_TIMEOUT with BUN #749

Closed
approached opened this issue Dec 2, 2023 · 5 comments
Closed

Error Message Error: write CONNECT_TIMEOUT with BUN #749

approached opened this issue Dec 2, 2023 · 5 comments

Comments

@approached
Copy link

approached commented Dec 2, 2023

Hi @ all

I'm a bit frustrated. I use bun + elysiajs + drizzle ORM + docker and have a cronjob every 5 minutes.
I get an error every now and then without a recognisable pattern:

Error Error {
  stack: "Error: write CONNECT_TIMEOUT postgres13:5432\n    at connection 
(/app/node_modules/postgres/src/errors.js:26:9)\n    at connectTimedOut 
(/app/node_modules/postgres/src/connection.js:256:19)\n    at done 
(/app/node_modules/postgres/src/connection.js:1016:12)",
  query: undefined,
  parameters: undefined,
  args: [ "ACTIVE", false, "2023-12-02T04:25:00", "2023-12-02T04:29:59" ],
  types: null,
  message: "write CONNECT_TIMEOUT postgres13:5432",
  code: "CONNECT_TIMEOUT",
  errno: "CONNECT_TIMEOUT",
  address: "postgres13",
  port: 5432,
  toString: [Function: toString],
  name: "Error"

My query looks like:

const items: AppointmentParticipant[] | unknown =
			await db.query.appointments.findMany({
				where: and(
					eq(appointments.status, "ACTIVE"),
					eq(appointments.isDecline, false),
					between(appointments.notificationAt, filterFrom, filterTo),
				),
				with: {
					appointmentParticipants: true,
				},
			});

If the error has occurred then no further query can be created. The PostgresSQL database itself does not give an error message. The user uses a connection limit: -1.

Does anyone have an idea how I can debug it better? Or an idea what the problem could be?

@wackfx
Copy link
Contributor

wackfx commented Dec 11, 2023

This issue is already patched on #738 and will be released soon.

@jonahsnider
Copy link

When is this going to be released? Currently having this issue in one of my apps and would really appreciate a more concrete schedule on when users can expect a fix.

@TimMensch
Copy link

@wackfx Patch doesn't seem to help. I'm on latest postgres (3.4.5) which should have the patch.

At least I'm still seeing it with bun 1.1.29. Just now bumped to bun 1.1.33. Will see if it recurs; it doesn't happen immediately so I can't tell if it's going to fail.

@porsager
Copy link
Owner

Buns policy is to not create issues with other projects if the issue only occurs with bun and not node, so I'm closing this one unless you have a repro with node.

@amjed-ali-k
Copy link

This seems fixed in bun 1.1.39 👍🏼

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

6 participants