0

I am getting this below error when using one click vercel payload deployment. https://vercel.com/templates/next.js/payload-website-starter All the connection strings are added properly(automatically). Not sure where to check on this error.

DrizzleQueryError: Failed query: SELECT to_regclass('"payload_migrations"') AS exists;
params: 
    at NodePgPreparedQuery.queryWithCache (/vercel/path0/node_modules/src/pg-core/session.ts:74:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async migrationTableExists (/vercel/path0/node_modules/@payloadcms/drizzle/src/utilities/migrationTableExists.ts:27:18)
    at async Object.migrate (/vercel/path0/node_modules/@payloadcms/drizzle/src/migrate.ts:37:29)
    at async migrate (/vercel/path0/node_modules/payload/src/bin/migrate.ts:87:7)
    at async runBinScript (/vercel/path0/node_modules/payload/dist/bin/index.js:112:9)
    at async bin (/vercel/path0/node_modules/payload/dist/bin/index.js:45:29)
    at async start (file:///vercel/path0/node_modules/payload/bin.js:30:7) {
  query: `SELECT to_regclass('"payload_migrations"') AS exists;`,
  params: [],
  cause: ErrorEvent {
    [Symbol(kTarget)]: WebSocket {
      _events: [Object: null prototype] {
22:05:39.674         error: [Function: onError] {
22:05:39.674           [Symbol(kIsForOnEventAttribute)]: false,
22:05:39.674           [Symbol(kListener)]: [Function (anonymous)]
22:05:39.674         },
22:05:39.674         message: [Function: onMessage] {
22:05:39.674           [Symbol(kIsForOnEventAttribute)]: false,
22:05:39.675           [Symbol(kListener)]: [Function (anonymous)]
22:05:39.675         },
22:05:39.675         close: [Function: onClose] {
22:05:39.675           [Symbol(kIsForOnEventAttribute)]: false,
22:05:39.675           [Symbol(kListener)]: [Function (anonymous)]
22:05:39.675         },
22:05:39.675         open: [Function: onOpen] {
22:05:39.675           [Symbol(kIsForOnEventAttribute)]: false,
22:05:39.676           [Symbol(kListener)]: [Function: handleWebSocketOpen]
22:05:39.676         }
22:05:39.677       },
22:05:39.677       _eventsCount: 4,
22:05:39.677       _maxListeners: undefined,
22:05:39.678       _binaryType: 'arraybuffer',
22:05:39.678       _closeCode: 1006,
22:05:39.679       _closeFrameReceived: false,
22:05:39.679       _closeFrameSent: false,
22:05:39.679       _closeMessage: Buffer(0) [Uint8Array] [],
22:05:39.679       _closeTimer: null,
22:05:39.680       _errorEmitted: true,
22:05:39.680       _extensions: {},
22:05:39.680       _paused: false,
22:05:39.680       _protocol: '',
22:05:39.680       _readyState: 3,
22:05:39.680       _receiver: null,
22:05:39.680       _sender: null,
22:05:39.680       _socket: null,
22:05:39.680       _bufferedAmount: 0,
22:05:39.680       _isServer: false,
22:05:39.680       _redirects: 0,
22:05:39.680       _autoPong: true,
22:05:39.680       _url: 'wss://localhost/v2',
22:05:39.680       _req: null,
22:05:39.680       [Symbol(shapeMode)]: false,
22:05:39.681       [Symbol(kCapture)]: false
22:05:39.681     },
22:05:39.681     [Symbol(kType)]: 'error',
22:05:39.681     [Symbol(kError)]: Error: connect ECONNREFUSED 127.0.0.1:443
22:05:39.681         at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1637:16) {
22:05:39.681       errno: -111,
22:05:39.681       code: 'ECONNREFUSED',
22:05:39.681       syscall: 'connect',
22:05:39.681       address: '127.0.0.1',
22:05:39.681       port: 443
22:05:39.681     },
22:05:39.681     [Symbol(kMessage)]: 'connect ECONNREFUSED 127.0.0.1:443'
22:05:39.681   }
22:05:39.681 }

I tried Redeploying after updating the env variables again. This setup supposed work directly without any manual code changes.

1
  • Seems like DATABASE_URL variable is incorrect–it's trying to connect to localhost (127.0.0.1), but Vercel uses Neon database provider, and the URL should be different for it. Probably not the answer you're looking for, but in order to deploy a Payload project, you only need preconfigure 2 things in Storage tab: 1) database, 2) blob store (for media). It's very straightforward, so I'd just do that instead of trying to figure out the one-click method. Commented Oct 20 at 16:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.