Skip to content

Printful plugin cannot sync products because of missing id in variant money amount #4

@stackpanda

Description

@stackpanda

The printful plugin cannot sync or create products because of a missing "id" in variant money type.

Medusa version: 1.15.0
Printful plugin version: 1.5.6
Node.js version: 18.17.1
Database: Postgresql
Operating system: Ubuntu 22.04 Server

To reproduce the error, follow the printful plugin setup guide and add a product to printful, then restart medusa and try to sync that product into medusa.

[medusa-plugin-printful]: There appeared an error trying to create 'Sinister Classic Oversized Tee' in Medusa: QueryFailedError: null value in column "id" of relation "product_variant_money_amount" violates not-null constraint at PostgresQueryRunner.query (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async InsertQueryBuilder.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33) at async SubjectExecutor.executeInsertOperations (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/SubjectExecutor.js:260:42) at async SubjectExecutor.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/SubjectExecutor.js:92:9) at async EntityPersistExecutor.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21) { query: 'INSERT INTO "public"."product_variant_money_amount"("variant_id", "money_amount_id") VALUES ($1, DEFAULT), ($2, DEFAULT), ($3, DEFAULT), ($4, DEFAULT), ($5, DEFAULT), ($6, DEFAULT), ($7, DEFAULT), ($8, DEFAULT), ($9, DEFAULT), ($10, DEFAULT), ($11, DEFAULT), ($12, DEFAULT)', parameters: [ 'variant_01HANA3VG67Y0YGBYTN35CC53K', 'variant_01HANA3VG6QXR8NK3Q3QQYA0EJ', 'variant_01HANA3VG6P7SYW5JB5T3MV4JC', 'variant_01HANA3VG71FDF9S7YB8QX00Q0', 'variant_01HANA3VG78KGPZRGA2T7403DQ', 'variant_01HANA3VG7DSD90QTQ5F84Q6NP', 'variant_01HANA3VG77FH4D8CXY8X2CNWF', 'variant_01HANA3VG8A67MXNG4Q5Z92AB8', 'variant_01HANA3VG84P09JN93XSZNN8CZ', 'variant_01HANA3VG87XXK0RV5SDNXRJKJ', 'variant_01HANA3VG8D1GKZNCR0NRHGJZB', 'variant_01HANA3VG9PV0YKK0F5ADBYXSM' ], driverError: error: null value in column "id" of relation "product_variant_money_amount" violates not-null constraint at /home/**********-backend/htdocs/backend.**********.com/node_modules/pg/lib/client.js:526:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async PostgresQueryRunner.query (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:178:25) at async InsertQueryBuilder.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33) at async SubjectExecutor.executeInsertOperations (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/SubjectExecutor.js:260:42) at async SubjectExecutor.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/SubjectExecutor.js:92:9) at async EntityPersistExecutor.execute (/home/**********-backend/htdocs/backend.**********.com/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21) { length: 342, severity: 'ERROR', code: '23502', detail: 'Failing row contains (null, null, variant_01HANA3VG67Y0YGBYTN35CC53K, null, 2023-09-18 23:30:53.552346+00, 2023-09-18 23:30:53.552346+00).', hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: 'public', table: 'product_variant_money_amount', column: 'id', dataType: undefined, constraint: undefined, file: 'execMain.c', line: '1883', routine: 'ExecConstraints' }, length: 342, severity: 'ERROR', code: '23502', detail: 'Failing row contains (null, null, variant_01HANA3VG67Y0YGBYTN35CC53K, null, 2023-09-18 23:30:53.552346+00, 2023-09-18 23:30:53.552346+00).', hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: 'public', table: 'product_variant_money_amount', column: 'id', dataType: undefined, constraint: undefined, file: 'execMain.c', line: '1883', routine: 'ExecConstraints' } Job failed with ID 1: undefined

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions