public-demo icon indicating copy to clipboard operation
public-demo copied to clipboard

Seed fails on postgres

Open t1nky opened this issue 11 months ago • 2 comments

I assume this is happenning due to createdAt and updatedAt fields being empty.

error: invalid input syntax for type timestamp with time zone: ""
    at /Users/alex/Projects/payload-cms/payload-demo/node_modules/pg/lib/client.js:526:17
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/alex/Projects/payload-cms/payload-demo/node_modules/src/node-postgres/session.ts:64:19
    at async upsertRow (/Users/alex/Projects/payload-cms/payload-demo/node_modules/@payloadcms/db-postgres/src/upsertRow/index.ts:63:24)
    at async Object.create (/Users/alex/Projects/payload-cms/payload-demo/node_modules/@payloadcms/db-postgres/src/create.ts:16:18)
    at async create (/Users/alex/Projects/payload-cms/payload-demo/node_modules/payload/src/collections/operations/create.ts:241:13) {
  length: 158,
  severity: 'ERROR',
  code: '22007',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: "unnamed portal parameter $4 = ''",
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'datetime.c',
  line: '3800',
  routine: 'DateTimeParseError'
}

t1nky avatar Mar 12 '24 14:03 t1nky

Same here, fresh install

[nodemon] 3.0.1 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: ts [nodemon] starting ts-node src/server.ts [12:12:25] INFO (payload): Starting Payload... [12:12:26] INFO (payload): Payload Admin URL: http://localhost:3000/admin [12:12:26] INFO (payload): Seeding database... [12:12:26] INFO (payload): — Clearing media... [12:12:26] INFO (payload): — Clearing collections and globals... [12:12:27] INFO (payload): — Seeding demo author and user... [12:12:29] INFO (payload): — Seeding media... error: invalid input syntax for type timestamp with time zone: "" at /Users/user/payloadcms/firstrun/firstrun/node_modules/pg/lib/client.js:526:17 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/user/payloadcms/firstrun/firstrun/node_modules/src/node-postgres/session.ts:64:19 at async upsertRow (/Users/user/payloadcms/firstrun/firstrun/node_modules/@payloadcms/db-postgres/src/upsertRow/index.ts:63:24) at async Object.create (//Users/user/payloadcms/firstrun/firstrun/node_modules/@payloadcms/db-postgres/src/create.ts:17:18) at async create (/Users/user/payloadcms/firstrun/firstrun/node_modules/payload/src/collections/operations/create.ts:245:13) { length: 158, severity: 'ERROR', code: '22007', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: "unnamed portal parameter $4 = ''", schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'datetime.c', line: '4059', routine: 'DateTimeParseError' } [12:12:30] ERROR (payload): Error seeding database. [12:12:34] INFO (payload): Starting Next.js... [12:12:34] INFO (payload): Next.js App URL: http://localhost:3000 webpack built 496334d2149ef41be006 in 20551ms webpack compiled successfully

marfalkov avatar Jul 21 '24 10:07 marfalkov

Same error, fresh install:

[nodemon] 3.0.1 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: ts [nodemon] starting ts-node src/server.ts (node:91927) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) [09:18:01] INFO (payload): Starting Payload... [09:18:01] INFO (payload): Payload Admin URL: http://localhost:3000/admin [09:18:01] INFO (payload): Seeding database... [09:18:01] INFO (payload): — Clearing media... [09:18:01] INFO (payload): — Clearing collections and globals... [09:18:02] INFO (payload): — Seeding demo author and user... error: invalid input syntax for type timestamp with time zone: "" at /Users/larry/Dev/payload/node_modules/pg/lib/client.js:526:17 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/larry/Dev/payload/node_modules/src/node-postgres/session.ts:64:19 at async upsertRow (/Users/larry/Dev/payload/node_modules/@payloadcms/db-postgres/src/upsertRow/index.ts:63:24) at async Object.create (/Users/larry/Dev/payload/node_modules/@payloadcms/db-postgres/src/create.ts:17:18) at async create (/Users/larry/Dev/payload/node_modules/payload/src/collections/operations/create.ts:245:13) { length: 158, severity: 'ERROR', code: '22007', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: "unnamed portal parameter $4 = ''", schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'datetime.c', line: '4051', routine: 'DateTimeParseError' } [09:18:03] INFO (payload): — Seeding media... [09:18:03] ERROR (payload): Error seeding database. [09:18:08] INFO (payload): Starting Next.js... [09:18:08] INFO (payload): Next.js App URL: http://localhost:3000 webpack built 353521ea99c525032531 in 14444ms webpack compiled successfully

websmyths avatar Aug 11 '24 23:08 websmyths