shelf.nu
shelf.nu copied to clipboard
[Bug]: Something went wrong while fetching user organizations. Please try again or contact support.
What happened?
Steps to reproduce:
- Navigate to '/login'
- Enter credentials and login
- See error: Something went wrong while fetching user organizations. Please try again or contact support.
What is the expected behaviour?
I expect the database connection and login to succeed.
Version
Self-hosted
What browsers are you seeing the problem on?
Chrome
Relevant log output
> NODE_ENV=production node ./build/server/index.js
🚀 Server started on port 8080
Scheduler and workers registration completed
2025/11/07 03:47PM 50 | pid=75 hostname=f764048272d6 err={"cause":{"stack":"Error: Connection terminated unexpectedly\n at /src/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Db.executeSql (/src/node_modules/pg-boss/src/db.js:28:14)\n at async Contractor.isInstalled (/src/node_modules/pg-boss/src/contractor.js:32:20)\n at async Contractor.start (/src/node_modules/pg-boss/src/contractor.js:37:23)\n at async PgBoss.start (/src/node_modules/pg-boss/src/index.js:101:5)\n at async init (file:///src/build/server/index.js:444:5)"},"label":"Scheduler","shouldBeCaptured":true,"status":500,"traceId":"aw42imakambzupcmu02e3exz","name":"ShelfError","message":"Scheduler crash","stack":"ShelfError: Scheduler crash\n at file:///src/build/server/index.js:25353:5\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"} msg=Scheduler crash
<-- GET /healthcheck
2025/11/07 03:47PM 50 | pid=75 hostname=f764048272d6 err={"cause":{"code":"P1017","meta":{"modelName":"User"},"clientVersion":"6.18.0","name":"PrismaClientKnownRequestError","stack":"PrismaClientKnownRequestError: \nInvalid `prisma.user.findFirst()` invocation:\n\n\nServer has closed the connection.\n at ei.handleRequestError (/src/node_modules/@prisma/client/runtime/library.js:121:7268)\n at ei.handleAndLogRequestError (/src/node_modules/@prisma/client/runtime/library.js:121:6593)\n at ei.request (/src/node_modules/@prisma/client/runtime/library.js:121:6300)\n at async a (/src/node_modules/@prisma/client/runtime/library.js:130:9551)\n at async loader$2J (file:///src/build/server/index.js:26609:5)\n at async Object.callRouteLoader (/src/node_modules/@remix-run/server-runtime/dist/data.js:59:16)\n at async /src/node_modules/@remix-run/router/dist/router.cjs.js:4750:19\n at async callLoaderOrAction (/src/node_modules/@remix-run/router/dist/router.cjs.js:4816:16)\n at async Promise.all (index 0)\n at async defaultDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4675:17)"},"label":"Healthcheck","shouldBeCaptured":true,"status":500,"traceId":"wg9o3q6r0kcutq7esi5p1i8g","name":"ShelfError","message":"Healthcheck failed","stack":"ShelfError: Healthcheck failed\n at loader$2J (file:///src/build/server/index.js:26616:9)\n at async Object.callRouteLoader (/src/node_modules/@remix-run/server-runtime/dist/data.js:59:16)\n at async /src/node_modules/@remix-run/router/dist/router.cjs.js:4750:19\n at async callLoaderOrAction (/src/node_modules/@remix-run/router/dist/router.cjs.js:4816:16)\n at async Promise.all (index 0)\n at async defaultDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4675:17)\n at async callDataStrategyImpl (/src/node_modules/@remix-run/router/dist/router.cjs.js:4707:17)\n at async callDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4117:19)\n at async loadRouteData (/src/node_modules/@remix-run/router/dist/router.cjs.js:4092:19)\n at async queryImpl (/src/node_modules/@remix-run/router/dist/router.cjs.js:3937:20)"} msg=Healthcheck failed
--> GET /healthcheck 200 143ms
Scheduler crash
ShelfError: Scheduler crash
at file:///src/build/server/index.js:25353:5
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
caused by
Error: Connection terminated unexpectedly
at /src/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Db.executeSql (/src/node_modules/pg-boss/src/db.js:28:14)
at async Contractor.isInstalled (/src/node_modules/pg-boss/src/contractor.js:32:20)
at async Contractor.start (/src/node_modules/pg-boss/src/contractor.js:37:23)
at async PgBoss.start (/src/node_modules/pg-boss/src/index.js:101:5)
at async init (file:///src/build/server/index.js:444:5)
Healthcheck failed
Prisma error P1017 (v6.18.0) for model User:
ShelfError: Healthcheck failed
at loader$2J (file:///src/build/server/index.js:26616:9)
at async Object.callRouteLoader (/src/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
at async /src/node_modules/@remix-run/router/dist/router.cjs.js:4750:19
at async callLoaderOrAction (/src/node_modules/@remix-run/router/dist/router.cjs.js:4816:16)
at async Promise.all (index 0)
at async defaultDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4675:17)
at async callDataStrategyImpl (/src/node_modules/@remix-run/router/dist/router.cjs.js:4707:17)
at async callDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4117:19)
at async loadRouteData (/src/node_modules/@remix-run/router/dist/router.cjs.js:4092:19)
at async queryImpl (/src/node_modules/@remix-run/router/dist/router.cjs.js:3937:20)
caused by
PrismaClientKnownRequestError:
Invalid `prisma.user.findFirst()` invocation:
Server has closed the connection.
at ei.handleRequestError (/src/node_modules/@prisma/client/runtime/library.js:121:7268)
at ei.handleAndLogRequestError (/src/node_modules/@prisma/client/runtime/library.js:121:6593)
at ei.request (/src/node_modules/@prisma/client/runtime/library.js:121:6300)
at async a (/src/node_modules/@prisma/client/runtime/library.js:130:9551)
at async loader$2J (file:///src/build/server/index.js:26609:5)
at async Object.callRouteLoader (/src/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
at async /src/node_modules/@remix-run/router/dist/router.cjs.js:4750:19
at async callLoaderOrAction (/src/node_modules/@remix-run/router/dist/router.cjs.js:4816:16)
at async Promise.all (index 0)
at async defaultDataStrategy (/src/node_modules/@remix-run/router/dist/router.cjs.js:4675:17)
Supabase Pooler Log
This log message appears once for every healthcheck.
{
"event_message": "ClientHandler: socket closed with reason {:noproc, {:partisan_gen_statem, :call, [#PID<50057.22261.4886>, {:db_call, #PID<0.5484.7649>, <<81, 0, 0, 0, 10, 66, 69, 71, 73, 78, 0>>}, 15000]}}, DbHandler {#PID<50057.22261.4886>, {:error, {:exit, {:noproc, {:partisan_gen_statem, :call, [#PID<50057.22261.4886>, :get_state_and_mode, 5000]}}}}}",
"id": "7961db76-4e2f-4378-a158-cf92df5c865a",
"metadata": [
{
"ansi_color": null,
"app_name": null,
"callers": [],
"context": [
{
"application": "supavisor",
"crash_reason": [],
"domain": [
"elixir"
],
"file": "lib/supavisor/client_handler.ex",
"function": "terminate/3",
"gl": "<0.2724.0>",
"line": 642,
"mfa": [
"Elixir.Supavisor.ClientHandler",
"terminate",
"3"
],
"module": "Elixir.Supavisor.ClientHandler",
"pid": "<0.5484.7649>",
"registered_name": null,
"time": 1762527232993039,
"vm": [
{
"node": "supavisor@ip-<redacted>.eu-central-1.compute.internal"
}
]
}
],
"db_name": "postgres",
"depth": null,
"error_logger": [],
"formatter_error_params": [],
"host": null,
"instance_id": "i-<redacted>",
"internal_log_event": null,
"level": "warn",
"local": null,
"location": null,
"mode": "transaction",
"nodehost": null,
"origin": null,
"peer_ip": null,
"project": "<redacted>",
"proxy": null,
"region": "eu-central-1",
"report_cb": null,
"request_id": null,
"stacktrace": [],
"state": null,
"type": "single",
"user": "postgres"
}
],
"timestamp": 1762527232993000
}
Additional Information
This is not the first time this happened. In total I have recorded six major outages that occurred at unpredictable times. Every time the issue just disappeared without me doing anything so I was not able to figure out the root cause.
- 2025-06-08 05:55:33 for 18 days and 10 minutes
- 2025-07-06 11:50:46 for 5 days and 1 minutes
- 2025-08-14 19:49:29 for 7 days and 22 minutes
- 2025-08-26 11:42:02 for 2 days and 6 minutes
- 2025-09-12 07:12:15 for 3 days and 10 minutes
- 2025-10-25 11:06:55 for 5 days and 20 minutes
- 2025-11-07 08:39:24 until now