medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.82k stars 2.58k forks source link

Unable to edit warehouses (Location & Shipping) #8435

Closed HarleySalas closed 3 months ago

HarleySalas commented 3 months ago

Bug report

Describe the bug

Unable to edit warehouses (Location & Shipping)

System information

Medusa: preview-20240804090447 Node.js version: 22.2.0 Database: postgres 16.3 Operating system: Linux Mint 21.3 Cinnamon Browser (if relevant): Chrome Version 126.0.6478.114 (Official Build) (64-bit)

I can confirm that all migrations have been ran.

Steps to reproduce the behavior

  1. Go to /app/settings/locations
  2. Click ... on any Warehouse, followed by Edit

Expected behavior

Should allow editing.

Video

https://github.com/user-attachments/assets/7a8741d1-d2cc-4d8a-9b05-52bd9a0576d9

Error from console:

[0] ::1 - - [04/Aug/2024:12:28:51 +0000] "GET /admin/notifications?limit=1&offset=0&fields=created_at HTTP/1.1" 304 - "http://localhost:9000/app/settings/locations" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
[0] error:   select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0] TableNotFoundException: select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0]     at PostgreSqlExceptionConverter.convertException (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+postgresql@5.9.7_@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7/node_modules/@mikro-orm/postgresql/PostgreSqlExceptionConverter.js:38:24)
[0]     at PostgreSqlDriver.convertException (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:201:54)
[0]     at /home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:205:24
[0]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0]     at async SqlEntityManager.find (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/EntityManager.js:117:25)
[0]     at async LinkRepository.find (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+utils@1.12.0-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/utils/src/dal/mikro-orm/mikro-orm-repository.ts:338:14)
[0]     at async LinkService.list (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+link-modules@0.2.12-preview-20240804090447_@mikro-orm+migrations@5.9.7_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/link-modules/dist/services/link.js:23:16)
[0]     at async LinkService.list (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+link-modules@0.2.12-preview-20240804090447_@mikro-orm+migrations@5.9.7_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/link-modules/dist/services/link-module-service.js:73:22)
[0]     at async RemoteQuery.remoteFetchData (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/remote-query.ts:230:20)
[0]     at async RemoteJoiner.fetchData (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:370:22)
[0]     at async RemoteJoiner.expandRelationshipProperty (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:627:30)
[0]     at async RemoteJoiner.expandProperty (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:582:7)
[0]     at async RemoteJoiner.handleExpands (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:555:9)
[0]     at async RemoteJoiner.query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:1049:5)
[0]     at async RemoteQuery.query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/remote-query.ts:261:12)
[0]     at async query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/medusa-app.ts:421:12)
[0]     at async refetchStockLocation (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+medusa@1.20.6-preview-20240804090447_@babel+runtime@7.25.0_@mikro-orm+migrations@5._jlotzsphuvpaelkfkmcfnanpsu/node_modules/@medusajs/medusa/src/api/admin/stock-locations/helpers.ts:21:26)
[0]     at async GET (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+medusa@1.20.6-preview-20240804090447_@babel+runtime@7.25.0_@mikro-orm+migrations@5._jlotzsphuvpaelkfkmcfnanpsu/node_modules/@medusajs/medusa/src/api/admin/stock-locations/[id]/route.ts:46:25)
[0]     at async /home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+utils@1.12.0-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/utils/src/common/wrap-handler.ts:17:14
[0] 
[0] previous error: select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0]     at Parser.parseErrorMessage (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:369:69)
[0]     at Parser.handlePacket (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:188:21)
[0]     at Parser.parse (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:103:30)
[0]     at Socket.<anonymous> (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/index.ts:7:48)
[0]     at Socket.emit (node:events:520:28)
[0]     at Socket.emit (node:domain:488:12)
[0]     at addChunk (node:internal/streams/readable:559:12)
[0]     at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
[0]     at Socket.Readable.push (node:internal/streams/readable:390:5)
[0]     at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
[0]     at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
[0]   length: 135,
[0]   severity: 'ERROR',
[0]   code: '42P01',
[0]   detail: undefined,
[0]   hint: undefined,
[0]   position: '70',
[0]   internalPosition: undefined,
[0]   internalQuery: undefined,
[0]   where: undefined,
[0]   schema: undefined,
[0]   table: undefined,
[0]   column: undefined,
[0]   dataType: undefined,
[0]   constraint: undefined,
[0]   file: 'parse_relation.c',
[0]   line: '1428',
[0]   routine: 'parserOpenTable'
[0] }
[0] ::1 - - [04/Aug/2024:12:28:51 +0000] "GET /admin/stock-locations/sloc_01J4EG5E5PRZA60CSZ9ED5E9B6?fields=name%2C%2Asales_channels%2C%2Aaddress%2Cfulfillment_sets.type%2Cfulfillment_sets.name%2C%2Afulfillment_sets.service_zones.geo_zones%2C%2Afulfillment_sets.service_zones%2C%2Afulfillment_sets.service_zones.shipping_options%2C%2Afulfillment_sets.service_zones.shipping_options.rules%2C%2Afulfillment_sets.service_zones.shipping_options.shipping_profile%2C%2Afulfillment_providers HTTP/1.1" 500 86 "http://localhost:9000/app/settings/locations" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
[0] error:   select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0] TableNotFoundException: select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0]     at PostgreSqlExceptionConverter.convertException (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+postgresql@5.9.7_@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7/node_modules/@mikro-orm/postgresql/PostgreSqlExceptionConverter.js:38:24)
[0]     at PostgreSqlDriver.convertException (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:201:54)
[0]     at /home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:205:24
[0]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0]     at async SqlEntityManager.find (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@mikro-orm+core@5.9.7_@mikro-orm+migrations@5.9.7_@mikro-orm+postgresql@5.9.7/node_modules/@mikro-orm/core/EntityManager.js:117:25)
[0]     at async LinkRepository.find (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+utils@1.12.0-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/utils/src/dal/mikro-orm/mikro-orm-repository.ts:338:14)
[0]     at async LinkService.list (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+link-modules@0.2.12-preview-20240804090447_@mikro-orm+migrations@5.9.7_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/link-modules/dist/services/link.js:23:16)
[0]     at async LinkService.list (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+link-modules@0.2.12-preview-20240804090447_@mikro-orm+migrations@5.9.7_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/link-modules/dist/services/link-module-service.js:73:22)
[0]     at async RemoteQuery.remoteFetchData (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/remote-query.ts:230:20)
[0]     at async RemoteJoiner.fetchData (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:370:22)
[0]     at async RemoteJoiner.expandRelationshipProperty (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:627:30)
[0]     at async RemoteJoiner.expandProperty (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:582:7)
[0]     at async RemoteJoiner.handleExpands (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:555:9)
[0]     at async RemoteJoiner.query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+orchestration@0.5.8-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/orchestration/src/joiner/remote-joiner.ts:1049:5)
[0]     at async RemoteQuery.query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/remote-query.ts:261:12)
[0]     at async query (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+modules-sdk@1.13.0-preview-20240804090447_@types+node@17.0.45/node_modules/@medusajs/modules-sdk/src/medusa-app.ts:421:12)
[0]     at async refetchStockLocation (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+medusa@1.20.6-preview-20240804090447_@babel+runtime@7.25.0_@mikro-orm+migrations@5._jlotzsphuvpaelkfkmcfnanpsu/node_modules/@medusajs/medusa/src/api/admin/stock-locations/helpers.ts:21:26)
[0]     at async GET (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+medusa@1.20.6-preview-20240804090447_@babel+runtime@7.25.0_@mikro-orm+migrations@5._jlotzsphuvpaelkfkmcfnanpsu/node_modules/@medusajs/medusa/src/api/admin/stock-locations/[id]/route.ts:46:25)
[0]     at async /home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/@medusajs+utils@1.12.0-preview-20240804090447_@types+node@17.0.45_pg@8.12.0/node_modules/@medusajs/utils/src/common/wrap-handler.ts:17:14
[0] 
[0] previous error: select "l0"."stock_location_id", "l0"."fulfillment_provider_id" from "public"."location_fulfillment_provider" as "l0" where "l0"."deleted_at" is null and "l0"."stock_location_id" in ('sloc_01J4EG5E5PRZA60CSZ9ED5E9B6') - relation "public.location_fulfillment_provider" does not exist
[0]     at Parser.parseErrorMessage (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:369:69)
[0]     at Parser.handlePacket (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:188:21)
[0]     at Parser.parse (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/parser.ts:103:30)
[0]     at Socket.<anonymous> (/home/harley/dev/projects/the-kas/medusa/node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/src/index.ts:7:48)
[0]     at Socket.emit (node:events:520:28)
[0]     at Socket.emit (node:domain:488:12)
[0]     at addChunk (node:internal/streams/readable:559:12)
[0]     at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
[0]     at Socket.Readable.push (node:internal/streams/readable:390:5)
[0]     at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
[0]     at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
[0]   length: 135,
[0]   severity: 'ERROR',
[0]   code: '42P01',
[0]   detail: undefined,
[0]   hint: undefined,
[0]   position: '70',
[0]   internalPosition: undefined,
[0]   internalQuery: undefined,
[0]   where: undefined,
[0]   schema: undefined,
[0]   table: undefined,
[0]   column: undefined,
[0]   dataType: undefined,
[0]   constraint: undefined,
[0]   file: 'parse_relation.c',
[0]   line: '1428',
[0]   routine: 'parserOpenTable'
[0] }
olivermrbl commented 3 months ago

@HarleySalas, can I get you to ensure your module links are up to date:

npx medusa links sync

We've recently added a core link between fulfillment providers and stock locations, and it looks like this one is missing on your side.

HarleySalas commented 3 months ago

@HarleySalas, can I get you to ensure your module links are up to date:

npx medusa links sync

We've recently added a core link between fulfillment providers and stock locations, and it looks like this one is missing on your side.

Thank you! I apologize for not paying attention enough. I wasn't aware of this concept. It all seems to be working great now.

SalahAdDin commented 1 month ago

@HarleySalas, can I get you to ensure your module links are up to date:

npx medusa links sync

We've recently added a core link between fulfillment providers and stock locations, and it looks like this one is missing on your side.

where is it in the documentation?

@HarleySalas thanks for reporting it.