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

Seed fails on postgres #46

Open
t1nky opened this issue Mar 12, 2024 · 2 comments
Open

Seed fails on postgres #46

t1nky opened this issue Mar 12, 2024 · 2 comments

Comments

@t1nky
Copy link

t1nky commented Mar 12, 2024

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'
}
@marfalkov
Copy link

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

@websmyths
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants