georgiakirkpatrick / veronaut-products-api

Fashion sustainability research, but make it shopping.
0 stars 0 forks source link

Test error - POST /api/products/product-form #4

Open georgiakirkpatrick opened 3 years ago

georgiakirkpatrick commented 3 years ago

Products Endpoints POST /api/products/product-form ::ffff:127.0.0.1 - - [28/Jul/2021:05:03:38 +0000] "POST /api/products/product-form HTTP/1.1" 201 348 (node:45075) UnhandledPromiseRejectionWarning: Error: Transaction query already complete, run with DEBUG=knex:tx for more info at completedError (/Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:354:9) at /Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:320:24 at new Promise () at Client_PG.trxClient.query (/Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:316:12) at Transaction.query (/Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:122:8) at Transaction.commit (/Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:90:17) at Function.transactor.commit (/Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:277:40) at /Users/Georgia/projects/veronaut-products-api/node_modules/knex/lib/transaction.js:191:35 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:45075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:45075) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ✓ Creates a product, responding with 201 and the new product (75ms) 2021-07-27 22:03:38.502 PDT [45080] ERROR: duplicate key value violates unique constraint "fibers_and_materials_pkey" 2021-07-27 22:03:38.502 PDT [45080] DETAIL: Key (id)=(1) already exists. 2021-07-27 22:03:38.502 PDT [45080] STATEMENT: insert into "fibers_and_materials" ("brand_id", "fiber_or_material_type_id", "producer_country", "producer_id", "production_notes") values ($1, $2, $3, $4, $5) returning catch 2 error: insert into "fibers_and_materials" ("brand_id", "fiber_or_material_type_id", "producer_country", "producer_id", "production_notes") values ($1, $2, $3, $4, $5) returning - duplicate key value violates unique constraint "fibers_and_materials_pkey" at Parser.parseErrorMessage (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:278:15) at Parser.handlePacket (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:39:38) at Socket. (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/index.js:8:42) at Socket.emit (events.js:315:20) at addChunk (_stream_readable.js:295:12) at readableAddChunk (_stream_readable.js:271:9) at Socket.Readable.push (_stream_readable.js:212:10) at TCP.onStreamRead (internal/stream_base_commons.js:186:23) { length: 225, severity: 'ERROR', code: '23505', detail: 'Key (id)=(1) already exists.', hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: 'public', table: 'fibers_and_materials', column: undefined, dataType: undefined, constraint: 'fibers_and_materials_pkey', file: 'nbtinsert.c', line: '656', routine: '_bt_check_unique' } 2021-07-27 22:03:39.506 PDT [45081] ERROR: deadlock detected 2021-07-27 22:03:39.506 PDT [45081] DETAIL: Process 45081 waits for RowShareLock on relation 3547248 of database 16495; blocked by process 45084. Process 45084 waits for AccessExclusiveLock on relation 3547030 of database 16495; blocked by process 45081. Process 45081: insert into "fabrics_to_certifications" ("certification_id", "fabric_id") values ($1, $2) returning * Process 45084: TRUNCATE table

        brands,
        categories,
        certifications, 
        dry_instructions, 
        fabric_types, 
        fabrics, 
        fabrics_to_products, 
        factories, 
        fibers_and_materials, 
        fiber_and_material_types, 
        fibers_to_products, 
        notion_types, 
        notions,
        notions_to_certifications,
        notions_to_products, 
        notions_to_fibers_and_materials, 
        product_cmts_to_certifications, 
        product_cmts_to_factories, 
        products, 
        product_colors, 
        sizes, 
        sizes_to_products, 
        wash_instructions 
        RESTART IDENTITY CASCADE

2021-07-27 22:03:39.506 PDT [45081] HINT: See server log for query details. 2021-07-27 22:03:39.506 PDT [45081] STATEMENT: insert into "fabrics_to_certifications" ("certification_id", "fabric_id") values ($1, $2) returning (node:45075) UnhandledPromiseRejectionWarning: error: insert into "fabrics_to_certifications" ("certification_id", "fabric_id") values ($1, $2) returning - deadlock detected at Parser.parseErrorMessage (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:278:15) at Parser.handlePacket (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/parser.js:39:38) at Socket. (/Users/Georgia/projects/veronaut-products-api/node_modules/pg-protocol/dist/index.js:8:42) at Socket.emit (events.js:315:20) at addChunk (_stream_readable.js:295:12) at readableAddChunk (_stream_readable.js:271:9) at Socket.Readable.push (_stream_readable.js:212:10) at TCP.onStreamRead (internal/stream_base_commons.js:186:23) (node:45075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)

1 passing (1s)