dub
dub copied to clipboard
403 DatabaseError Forbidden when Self-Hosting
i am currently trying to self-host Dub based off of this repo. i am running into the following errors:
DatabaseError: Forbidden
at (../../node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:145:0)
at (../../node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:81:0)
at (lib/planetscale.ts:52:4)
at (lib/middleware/link.ts:69:21)
at (../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/esm/server/web/adapter.js:156:0) {
status: 403,
name: 'DatabaseError',
body: { code: 'internal', message: 'Forbidden' }
}
[GET] [middleware: "middleware"] / reason=EDGE_FUNCTION_INVOCATION_FAILED, status=500, user_error=true
i have set up my mysql and planetscale proxy based off of this docker compose file and added them as environment variables in vercel as follows:
DATABASE_URL="mysql://root:@NODEIP:3307/planetscale"
PLANETSCALE_DATABASE_URL="http://root:unused@NODEIP:3900"
the only thing the build logs display as errors are what is below, although i doubt that it is directly related to the error. any help is appreciated, thank you!!
web:build: API error occurred Dynamic server usage: Route /api/analytics/demo couldn't be rendered statically because it accessed `request.headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
web:build: Generating static pages (16/64)
web:build: API error occurred Dynamic server usage: Route /api/me couldn't be rendered statically because it accessed `request.headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
web:build: API error occurred Dynamic server usage: Route /api/support/upload couldn't be rendered statically because it accessed `request.headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
web:build: Generating static pages (48/64)
i'd also like to note that the database connects fine when ran with a local dev instance, it simply just fails when deploying in vercel.
this is the error that is displayed on the actual deployed page:
hii @ash-development, have you found a way to fix it?
@h4MeMengoding nope 🤷🏼♀️ i just gave up because this was after two days straight of troubleshooting. wasn't THAT worth it to me lol. its very odd that the database works with a dev installation (still via remote SQL database) but not thru prod with hosting on vercel
it seems that support for self-hosting is pretty nonexistent unfortunately
me too!, 2 weeks ago I tried to find the problem for 1 week in a row, and no results, it seems that dub prioritizes its users only using their web version, maybe
@ash-development what are you using for the MySQL proxy? Where is your MySQL DB hosted on? That could be the source of the error here
I'm also seeing this same issue. Any luck on getting this to work?
@ash-development what are you using for the MySQL proxy? Where is your MySQL DB hosted on? That could be the source of the error here
using both of these via docker compose, had to change the ports as the originals are also running on my server lol https://github.com/ash-development/my-dub/blob/main/apps/web/docker-compose.yml