You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In storefront when added a second item to the cart via the SDk i get a error 500 and the servers logs {
message: 'select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and "pr"."value" in ($9)) or ("pr"."attribute" = $10 and ("pr"."operator" = $11 and $12 >= pr.value::numeric) or ("pr"."operator" = $13 and $14 > pr.value::numeric) or ("pr"."operator" = $15 and $16 < pr.value::numeric) or ("pr"."operator" = $17 and $18 <= pr.value::numeric) or ("pr"."operator" = $19 and $20 = pr.value::numeric)) or ("pr"."attribute" = $21 and ("pr"."operator" = $22 and $23 >= pr.value::numeric) or ("pr"."operator" = $24 and $25 > pr.value::numeric) or ("pr"."operator" = $26 and $27 < pr.value::numeric) or ("pr"."operator" = $28 and $29 <= pr.value::numeric) or ("pr"."operator" = $30 and $31 = pr.value::numeric)) or "price"."rules_count" = $32)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $33) and "plr"."value" @> $34 or ("plr"."attribute" = $35) and "plr"."value" @> $36 or ("plr"."attribute" = $37) and "plr"."value" @> $38 or ("plr"."attribute" = $39) and "plr"."value" @> $40 or ("plr"."attribute" = $41) and "plr"."value" @> $42 or ("plr"."attribute" = $43) and "plr"."value" @> $44 or "pl"."rules_count" = $45) and ((("pr"."attribute" = $46 and "pr"."value" in ($47)) or ("pr"."attribute" = $48 and "pr"."value" in ($49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51)) or ("pr"."attribute" = $52 and "pr"."value" in ($53)) or ("pr"."attribute" = $54 and ("pr"."operator" = $55 and $56 >= pr.value::numeric) or ("pr"."operator" = $57 and $58 > pr.value::numeric) or ("pr"."operator" = $59 and $60 < pr.value::numeric) or ("pr"."operator" = $61 and $62 <= pr.value::numeric) or ("pr"."operator" = $63 and $64 = pr.value::numeric)) or ("pr"."attribute" = $65 and ("pr"."operator" = $66 and $67 >= pr.value::numeric) or ("pr"."operator" = $68 and $69 > pr.value::numeric) or ("pr"."operator" = $70 and $71 < pr.value::numeric) or ("pr"."operator" = $72 and $73 <= pr.value::numeric) or ("pr"."operator" = $74 and $75 = pr.value::numeric)) and "price"."rules_count" > $76) or "price"."rules_count" = $77))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($78, $79) and "price"."currency_code" = $80 and ("price"."min_quantity" <= $81 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc - invalid input syntax for type numeric: "reg_01JBK60AXTRWF81C3G2Q92WWJ0"',
name: 'error',
stack: 'error: select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and "pr"."value" in ($9)) or ("pr"."attribute" = $10 and ("pr"."operator" = $11 and $12 >= pr.value::numeric) or ("pr"."operator" = $13 and $14 > pr.value::numeric) or ("pr"."operator" = $15 and $16 < pr.value::numeric) or ("pr"."operator" = $17 and $18 <= pr.value::numeric) or ("pr"."operator" = $19 and $20 = pr.value::numeric)) or ("pr"."attribute" = $21 and ("pr"."operator" = $22 and $23 >= pr.value::numeric) or ("pr"."operator" = $24 and $25 > pr.value::numeric) or ("pr"."operator" = $26 and $27 < pr.value::numeric) or ("pr"."operator" = $28 and $29 <= pr.value::numeric) or ("pr"."operator" = $30 and $31 = pr.value::numeric)) or "price"."rules_count" = $32)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $33) and "plr"."value" @> $34 or ("plr"."attribute" = $35) and "plr"."value" @> $36 or ("plr"."attribute" = $37) and "plr"."value" @> $38 or ("plr"."attribute" = $39) and "plr"."value" @> $40 or ("plr"."attribute" = $41) and "plr"."value" @> $42 or ("plr"."attribute" = $43) and "plr"."value" @> $44 or "pl"."rules_count" = $45) and ((("pr"."attribute" = $46 and "pr"."value" in ($47)) or ("pr"."attribute" = $48 and "pr"."value" in ($49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51)) or ("pr"."attribute" = $52 and "pr"."value" in ($53)) or ("pr"."attribute" = $54 and ("pr"."operator" = $55 and $56 >= pr.value::numeric) or ("pr"."operator" = $57 and $58 > pr.value::numeric) or ("pr"."operator" = $59 and $60 < pr.value::numeric) or ("pr"."operator" = $61 and $62 <= pr.value::numeric) or ("pr"."operator" = $63 and $64 = pr.value::numeric)) or ("pr"."attribute" = $65 and ("pr"."operator" = $66 and $67 >= pr.value::numeric) or ("pr"."operator" = $68 and $69 > pr.value::numeric) or ("pr"."operator" = $70 and $71 < pr.value::numeric) or ("pr"."operator" = $72 and $73 <= pr.value::numeric) or ("pr"."operator" = $74 and $75 = pr.value::numeric)) and "price"."rules_count" > $76) or "price"."rules_count" = $77))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($78, $79) and "price"."currency_code" = $80 and ("price"."min_quantity" <= $81 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc - invalid input syntax for type numeric: "reg_01JBK60AXTRWF81C3G2Q92WWJ0"\n' +
' at Parser.parseErrorMessage (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:368:69)\n' +
' at Parser.handlePacket (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:187:21)\n' +
' at Parser.parse (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:102:30)\n' +
' at Socket. (/app/.medusa/server/node_modules/pg-protocol/src/index.ts:7:48)\n' +
' at Socket.emit (node:events:520:28)\n' +
' at Socket.emit (node:domain:488:12)\n' +
' at addChunk (node:internal/streams/readable:559:12)\n' +
' at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n' +
' at Socket.Readable.push (node:internal/streams/readable:390:5)\n' +
' at TCP.onStreamRead (node:internal/stream_base_commons:191:23)\n' +
'⮑ sat /app/.medusa/server/node_modules/@medusajs/core-flows/dist/cart/workflows/refresh-cart-items.js: [refresh-cart-items -> fetch-variants (invoke)]\n' +
'⮑ sat /app/.medusa/server/node_modules/@medusajs/core-flows/dist/cart/workflows/add-to-cart.js: [add-to-cart -> refresh-cart-items-as-step (invoke)]',
length: 134,
severity: 'ERROR',
code: '22P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'numeric.c',
line: '6880',
routine: 'set_var_from_str'
}
the region "reg_01JBK60AXTRWF81C3G2Q92WWJ0" was deleted previously
There was also a custom price list, also deleted.
Expected behavior
To add a second item to the cart
Actual behavior
Returns 500 the api and no item its added to the card
Package.json file
Node.js version
v20
Database and its version
supabase/postgres:15.6.1.113
Operating system name and version
Ubuntu 2204
Browser name
No response
What happended?
In storefront when added a second item to the cart via the SDk i get a error 500 and the servers logs {
message: 'select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and "pr"."value" in ($9)) or ("pr"."attribute" = $10 and ("pr"."operator" = $11 and $12 >= pr.value::numeric) or ("pr"."operator" = $13 and $14 > pr.value::numeric) or ("pr"."operator" = $15 and $16 < pr.value::numeric) or ("pr"."operator" = $17 and $18 <= pr.value::numeric) or ("pr"."operator" = $19 and $20 = pr.value::numeric)) or ("pr"."attribute" = $21 and ("pr"."operator" = $22 and $23 >= pr.value::numeric) or ("pr"."operator" = $24 and $25 > pr.value::numeric) or ("pr"."operator" = $26 and $27 < pr.value::numeric) or ("pr"."operator" = $28 and $29 <= pr.value::numeric) or ("pr"."operator" = $30 and $31 = pr.value::numeric)) or "price"."rules_count" = $32)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $33) and "plr"."value" @> $34 or ("plr"."attribute" = $35) and "plr"."value" @> $36 or ("plr"."attribute" = $37) and "plr"."value" @> $38 or ("plr"."attribute" = $39) and "plr"."value" @> $40 or ("plr"."attribute" = $41) and "plr"."value" @> $42 or ("plr"."attribute" = $43) and "plr"."value" @> $44 or "pl"."rules_count" = $45) and ((("pr"."attribute" = $46 and "pr"."value" in ($47)) or ("pr"."attribute" = $48 and "pr"."value" in ($49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51)) or ("pr"."attribute" = $52 and "pr"."value" in ($53)) or ("pr"."attribute" = $54 and ("pr"."operator" = $55 and $56 >= pr.value::numeric) or ("pr"."operator" = $57 and $58 > pr.value::numeric) or ("pr"."operator" = $59 and $60 < pr.value::numeric) or ("pr"."operator" = $61 and $62 <= pr.value::numeric) or ("pr"."operator" = $63 and $64 = pr.value::numeric)) or ("pr"."attribute" = $65 and ("pr"."operator" = $66 and $67 >= pr.value::numeric) or ("pr"."operator" = $68 and $69 > pr.value::numeric) or ("pr"."operator" = $70 and $71 < pr.value::numeric) or ("pr"."operator" = $72 and $73 <= pr.value::numeric) or ("pr"."operator" = $74 and $75 = pr.value::numeric)) and "price"."rules_count" > $76) or "price"."rules_count" = $77))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($78, $79) and "price"."currency_code" = $80 and ("price"."min_quantity" <= $81 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc - invalid input syntax for type numeric: "reg_01JBK60AXTRWF81C3G2Q92WWJ0"',
name: 'error',
stack: 'error: select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and "pr"."value" in ($9)) or ("pr"."attribute" = $10 and ("pr"."operator" = $11 and $12 >= pr.value::numeric) or ("pr"."operator" = $13 and $14 > pr.value::numeric) or ("pr"."operator" = $15 and $16 < pr.value::numeric) or ("pr"."operator" = $17 and $18 <= pr.value::numeric) or ("pr"."operator" = $19 and $20 = pr.value::numeric)) or ("pr"."attribute" = $21 and ("pr"."operator" = $22 and $23 >= pr.value::numeric) or ("pr"."operator" = $24 and $25 > pr.value::numeric) or ("pr"."operator" = $26 and $27 < pr.value::numeric) or ("pr"."operator" = $28 and $29 <= pr.value::numeric) or ("pr"."operator" = $30 and $31 = pr.value::numeric)) or "price"."rules_count" = $32)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $33) and "plr"."value" @> $34 or ("plr"."attribute" = $35) and "plr"."value" @> $36 or ("plr"."attribute" = $37) and "plr"."value" @> $38 or ("plr"."attribute" = $39) and "plr"."value" @> $40 or ("plr"."attribute" = $41) and "plr"."value" @> $42 or ("plr"."attribute" = $43) and "plr"."value" @> $44 or "pl"."rules_count" = $45) and ((("pr"."attribute" = $46 and "pr"."value" in ($47)) or ("pr"."attribute" = $48 and "pr"."value" in ($49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51)) or ("pr"."attribute" = $52 and "pr"."value" in ($53)) or ("pr"."attribute" = $54 and ("pr"."operator" = $55 and $56 >= pr.value::numeric) or ("pr"."operator" = $57 and $58 > pr.value::numeric) or ("pr"."operator" = $59 and $60 < pr.value::numeric) or ("pr"."operator" = $61 and $62 <= pr.value::numeric) or ("pr"."operator" = $63 and $64 = pr.value::numeric)) or ("pr"."attribute" = $65 and ("pr"."operator" = $66 and $67 >= pr.value::numeric) or ("pr"."operator" = $68 and $69 > pr.value::numeric) or ("pr"."operator" = $70 and $71 < pr.value::numeric) or ("pr"."operator" = $72 and $73 <= pr.value::numeric) or ("pr"."operator" = $74 and $75 = pr.value::numeric)) and "price"."rules_count" > $76) or "price"."rules_count" = $77))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($78, $79) and "price"."currency_code" = $80 and ("price"."min_quantity" <= $81 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc - invalid input syntax for type numeric: "reg_01JBK60AXTRWF81C3G2Q92WWJ0"\n' +
' at Parser.parseErrorMessage (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:368:69)\n' +
' at Parser.handlePacket (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:187:21)\n' +
' at Parser.parse (/app/.medusa/server/node_modules/pg-protocol/src/parser.ts:102:30)\n' +
' at Socket. (/app/.medusa/server/node_modules/pg-protocol/src/index.ts:7:48)\n' +
' at Socket.emit (node:events:520:28)\n' +
' at Socket.emit (node:domain:488:12)\n' +
' at addChunk (node:internal/streams/readable:559:12)\n' +
' at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n' +
' at Socket.Readable.push (node:internal/streams/readable:390:5)\n' +
' at TCP.onStreamRead (node:internal/stream_base_commons:191:23)\n' +
'⮑ sat /app/.medusa/server/node_modules/@medusajs/core-flows/dist/cart/workflows/refresh-cart-items.js: [refresh-cart-items -> fetch-variants (invoke)]\n' +
'⮑ sat /app/.medusa/server/node_modules/@medusajs/core-flows/dist/cart/workflows/add-to-cart.js: [add-to-cart -> refresh-cart-items-as-step (invoke)]',
length: 134,
severity: 'ERROR',
code: '22P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'numeric.c',
line: '6880',
routine: 'set_var_from_str'
}
the region "reg_01JBK60AXTRWF81C3G2Q92WWJ0" was deleted previously
There was also a custom price list, also deleted.
Expected behavior
To add a second item to the cart
Actual behavior
Returns 500 the api and no item its added to the card
Link to reproduction repo
https://github.com/medusajs/medusa-starter-default
The text was updated successfully, but these errors were encountered: