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

postgres vercel column "prefix" does not exist #5788

Open
Eric-Arz opened this issue Apr 11, 2024 · 4 comments
Open

postgres vercel column "prefix" does not exist #5788

Eric-Arz opened this issue Apr 11, 2024 · 4 comments
Assignees
Labels
dependency-issue The issue is in a dependency of payload - not payload itself [missing-reproduction] If an issue does not include a reproduction [possible-bug] Possible bug which hasn't been reproduced yet

Comments

@Eric-Arz
Copy link

Link to reproduction

No response

Describe the Bug

Hi,

we are having trouble when uploading files in production on Vercel because we always get this error:

error: column "prefix" does not exist
at /var/task/node_modules/pg/lib/client.js:526:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /var/task/node_modules/drizzle-orm/node-postgres/index.cjs:41:28
at async find (/var/task/node_modules/@payloadcms/db-postgres/dist/find/findMany.js:167:21)
at async Object.findOne (/var/task/node_modules/@payloadcms/db-postgres/dist/findOne.js:20:22)
at async docWithFilenameExists (/var/task/.next/server/chunks/3005.js:28:239681)
at async getSafeFileName (/var/task/.next/server/chunks/3005.js:28:248633)
at async generateFileData (/var/task/.next/server/chunks/3005.js:28:242926)
at async create (/var/task/.next/server/chunks/3005.js:28:47026)
at async handler (/var/task/.next/server/chunks/2537.js:1:1921) {
length: 106,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '21',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '3713',
routine: 'errorMissingColumn'
}

our media collection does indeed not have a prefix, so we don't understand why payload keeps trying to use it. Fully resetting our migration history and making a single clean new one didn't resolve the issue either. We can't use the latest version of db-postgres because of #5589

Regards,

Eric

To Reproduce

setup a payload project with next-payload and db-postgres on vercel and try uploading a file

Payload Version

2.12.1

Adapters and Plugins

@payloadcms/db-postgres: 0.3.1

@Eric-Arz Eric-Arz added the [possible-bug] Possible bug which hasn't been reproduced yet label Apr 11, 2024
@maneike
Copy link
Contributor

maneike commented Apr 12, 2024

I've been experiencing a similiar issue. My guess is that it's a problem with Drizzle and custom schema names. Are you also using schemaName in the Payload config?

@DanRibbens DanRibbens self-assigned this Apr 12, 2024
@DanRibbens DanRibbens added the dependency-issue The issue is in a dependency of payload - not payload itself label Apr 15, 2024
@DanRibbens
Copy link
Contributor

DanRibbens commented Apr 15, 2024

@Eric-Arz, I am also curious about maneike's question. Are you using a cusotm schema name?

I'm curious if adding a drizzle.config.ts with schema and schemaFilter would fix this or your issue @maneikie?

https://orm.drizzle.team/kit-docs/config-reference#schemafilter

Let me know. I'm labeling this as a dependency issue for now, but we'll keep it open until we know more.

Last note, we're only going to fix this if it is an issue with payload v3, which is currently in beta. We're not addressing anything else related to next-payload.

@DanRibbens DanRibbens added the [missing-reproduction] If an issue does not include a reproduction label Apr 15, 2024
@maneike
Copy link
Contributor

maneike commented Apr 15, 2024

@DanRibbens Thanks for digging in!

Even with such drizzle.config.ts, the issue persists:

import type { Config } from "drizzle-kit";

export default {
  schemaFilter: ["payload"],
  schema: ["payload"],
} satisfies Config;

@Eric-Arz
Copy link
Author

@maneike no we are not using schemaName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency-issue The issue is in a dependency of payload - not payload itself [missing-reproduction] If an issue does not include a reproduction [possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants