djyde / cusdis

lightweight, privacy-friendly alternative to Disqus.
https://cusdis.com
GNU General Public License v3.0
2.6k stars 224 forks source link

Postgres 15. permission denied for schema public during deployment #263

Closed Vinfall closed 1 year ago

Vinfall commented 1 year ago

It seems postgresql 15 changed the default permission of schema public (is it how it's called?) and broke cusdis setup.

No idea how to fix this as I just get started to use psql, but I can list some relevant webpages: StackOverflow, PostgreSQL Documentation.

Vercel build log:

[//]: <> (Don't modify above) ``` Running build in San Francisco, USA (West) – sfo1 Cloning github.com/Vinfall/cusdis (Branch: master, Commit: cb40481) Skipping build cache, deployment was triggered without cache. Cloning completed: 1.319s Running "vercel build" Vercel CLI 31.3.1 Installing dependencies... yarn install v1.22.17 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... warning " > next-auth@3.29.10" has incorrect peer dependency "react@^16.13.1 || ^17". warning " > next-auth@3.29.10" has incorrect peer dependency "react-dom@^16.13.1 || ^17". warning "next-auth > @next-auth/prisma-legacy-adapter@0.1.2" has incorrect peer dependency "@prisma/client@^2.16.1". warning " > react-hook-form@7.2.1" has incorrect peer dependency "react@^16.8.0 || ^17". warning " > react-query@3.6.0" has incorrect peer dependency "react@^16.8.0 || ^17.0.0". warning " > rollup-plugin-svelte@7.1.0" has unmet peer dependency "rollup@>=2.0.0". warning " > typegraphql-prisma@0.9.4" has unmet peer dependency "@prisma/cli@~2.14.0". warning " > typegraphql-prisma@0.9.4" has incorrect peer dependency "@prisma/client@~2.14.0". warning " > typegraphql-prisma@0.9.4" has unmet peer dependency "@types/graphql-fields@^1.3.3". warning " > typegraphql-prisma@0.9.4" has unmet peer dependency "graphql-fields@^2.0.3". warning " > typegraphql-prisma@0.9.4" has unmet peer dependency "graphql-type-json@^0.3.2". warning " > typegraphql-prisma@0.9.4" has unmet peer dependency "type-graphql@^1.1.1". [4/4] Building fresh packages... success Saved lockfile. Done in 42.71s. Detected Next.js version: 13.4.16 Running "yarn run build" yarn run v1.22.17 $ DB_TYPE=pgsql npm run db:generate && DB_TYPE=pgsql npm run db:deploy && next build && npm run build:widget > db:generate > prisma generate --schema ./prisma/$DB_TYPE/schema.prisma Prisma schema loaded from prisma/pgsql/schema.prisma ✔ Generated Prisma Client (5.1.1 | library) to ./node_modules/@prisma/client in 197ms You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client ``` import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient() ``` > db:deploy > prisma migrate deploy --schema ./prisma/$DB_TYPE/schema.prisma Prisma schema loaded from prisma/pgsql/schema.prisma Datasource "db": PostgreSQL database "cusdis", schema "public" at "mydb-domain.com:5432" Error: P1010: User `myuser` was denied access on the database `cusdis.public` error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Command "yarn run build" exited with 1 ``` [//]: <> (Don't modify below)
Vinfall commented 1 year ago

Never mind, it's caused by a combo of misconfiguration of psql, unrelated to cusdis itself.