[Bug]: Docker Shelf.nu self hosted not working
Contact Details
What happened?
I've installed the docker version of Shelf on a local computer running Ubuntu and docker, everything went smoothly and I have the container running, I also have set up Supabase, Maptier, and SMTP service and I've another docker running Postgres and Shelf docker is also connected to the Postgres...
After launching the web interface, try to create the initial user, navigating to Register, I fill up the form and when I press Submit I receive an error above Email input with the message:
Failed to find user
...
I already deleted my docker image and ran it again and I still have the same issue, on the browser console I get an error 500, when trying to submit the new register
I don't actually quite understand what's failing on my installation and why it's not working
What is the expected behaviour?
The I was able to proper register and start using the app
Version
Self-hosted
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
shelf | {"level":50,"time":1715810076376,"pid":74,"hostname":"shelf","err":{"cause":{"name":"PrismaClientInitializationError","clientVersion":"5.13.0","stack":"PrismaClientInitializationError: \nInvalid `prisma.user.findUnique()` invocation:\n\n\nThe provided database string is invalid. The provided arguments are not supported in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.\n at In.handleRequestError (/src/node_modules/@prisma/client/runtime/library.js:122:7154)\n at In.handleAndLogRequestError (/src/node_modules/@prisma/client/runtime/library.js:122:6188)\n at In.request (/src/node_modules/@prisma/client/runtime/library.js:122:5896)\n at async l (/src/node_modules/@prisma/client/runtime/library.js:127:11167)\n at async findUserByEmail (file:///src/build/server/remix.js:8382:12)\n at async action$14 (file:///src/build/server/remix.js:9395:30)\n at async Object.callRouteActionRR (/src/node_modules/@remix-run/server-runtime/dist/data.js:35:16)\n at async callLoaderOrAction (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:4166:16)\n at async submit (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3520:16)\n at async queryImpl (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3478:22)"},"label":"User","additionalData":{"email":"[email protected]"},"shouldBeCaptured":true,"status":500,"traceId":"xl3jef26h6ql4svqo6e4ehky","name":"ShelfError","message":"Failed to find user","stack":"ShelfError: Failed to find user\n at makeShelfError (file:///src/build/server/remix.js:115:12)\n at action$14 (file:///src/build/server/remix.js:9416:20)\n at async Object.callRouteActionRR (/src/node_modules/@remix-run/server-runtime/dist/data.js:35:16)\n at async callLoaderOrAction (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:4166:16)\n at async submit (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3520:16)\n at async queryImpl (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3478:22)\n at async Object.queryRoute (/src/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3447:18)\n at async handleDataRequestRR (/src/node_modules/@remix-run/server-runtime/dist/server.js:122:20)\n at async requestHandler (/src/node_modules/@remix-run/server-runtime/dist/server.js:94:18)\n at async file:///src/node_modules/remix-hono/build/handler.js:7:16"},"msg":"Failed to find user"}
shelf | --> POST /join?_data=routes%2F_auth%2B%2Fjoin [31m500[0m 7ms
shelf | <-- GET /join?_data=routes%2F_auth%2B%2F_auth
shelf | --> GET /join?_data=routes%2F_auth%2B%2F_auth [32m200[0m 3ms
shelf | <-- GET /join?_data=routes%2F_auth%2B%2Fjoin
shelf | --> GET /join?_data=routes%2F_auth%2B%2Fjoin [32m200[0m 3ms
hi @eduardoribeiro. The Error you got very clearly says what the error is:
The provided database string is invalid.
This means either your DATABASE_URL or DIRECT_URL are not correctly setup. Or both.
Well you are right and to be fair that message was truncated in the console, so I guess I missed it, I'll try to see if I can correct it, need to understand what Database URL is the error referring to, since it should be working and I can see on the local Postgres DB the tables created and the initial log states that the DB was provisioned
I think its most probably due to the string formatting. I remember some other users had the same issue but it was a question on discord and I cant find it anymore. Are you starting docker like its stated in the docs or are you using a .env file?
I was able to make it work with some changes on the Postgres URI in the docker, but now I'm stuck in between the login page and the first page with this error:
@DonKoko do you have any idea why this is happening? It seems like the react is not recognizing the assets
hey @eduardoribeiro. I need some more info?
- Are you running dev or production build?
- How exactly are you starting your server?
- Do you have some errors in the terminal?
I'm running a Docker image and it's production, at least it says so on the terminal. No errors on the terminal, and my server is started by docker, by it starts with npm start
shelf | + npm run db:deploy
shelf |
shelf | > db:deploy
shelf | > prisma migrate deploy
shelf |
shelf | Prisma schema loaded from app/database/schema.prisma
shelf | Datasource "db": PostgreSQL database "casaos", schema "public" at "192.168.4.117:5432"
shelf |
shelf | 101 migrations found in prisma/migrations
shelf |
shelf |
shelf | No pending migrations to apply.
shelf | npm notice
shelf | npm notice New minor version of npm available! 10.5.2 -> 10.8.0
shelf | npm notice Changelog:
shelf | npm notice Run `npm install -g [email protected]` to update!
shelf | npm notice
shelf | + npm run start
shelf |
shelf | > start
shelf | > NODE_ENV=production node ./build/server/index.js
shelf |
shelf | 🚀 Server started on port 8080
shelf | <-- GET /join
shelf | --> GET /join [32m200[0m 2s
shelf | Scheduler and workers registration completed
shelf | <-- GET /favicon.ico
shelf | --> GET /favicon.ico [36m302[0m 7ms
shelf | <-- GET /login?redirectTo=/favicon.ico
shelf | --> GET /login?redirectTo=/favicon.ico [32m200[0m 21ms
shelf | <-- POST /send-otp?_data=routes%2F_auth%2B%2Fsend-otp
This terminal output is after I restart my container
I see you don't have an SSL which is required if you are running a production build. We had another person with the same issue the other day. Can you try setting up your SSL and letting us know if the issue persists?
Sure I can try to create a local SSL and add it to the server so I can run it with SSL
Closing due to inactivity