vholik / medusa-custom-attributes

Plugin that extends MedusaJs with custom attributes API
88 stars 20 forks source link

All products + variants disappeared after enabling plugin #21

Closed iaremarkus closed 6 months ago

iaremarkus commented 7 months ago

Heya team Thanks for your work on this.

In a bit of a pickle...

I have Medusa running on a Railway setup. I added a couple products, and a couple variations on each and all was swell. I realized custom fields would be useful, and I found this plugin.

I followed the steps on the guide:

$ railway run npx medusa migrations run
query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "public"."migrations" "migrations" ORDER BY "id" DESC
No migrations are pending
Connection to Redis in module 'event-bus-redis' established
Connection to Redis in module 'cache-redis' established

Not sure if that's good or bad, but either way when I logged back into my site, all my products & variations are gone šŸ˜¢ I don't know if its related as I never checked the network tab before the issue, but I see this on my products tab:

pic-004285

Weirdly, my collection still shows that there are 2 products in it, but the products themselves have gone AWOL.

pic-004284

Any tips?

PS: This instance is live so I can pop logins if it'll help..

iaremarkus commented 7 months ago

Update: I managed to find in my history, the URL's to the 2 products I had created. I can open them, make changes, save, set to draft/published etc.. all fine.

But products table remains empty, and the same error appears when accessing from the storefront via the URL:

/store/products

{
  "code": "unknown_error",
  "type": "unknown_error",
  "message": "An unknown error occurred."
}
iaremarkus commented 7 months ago

I tried creating a new product now. It creates just fine - no errors. But nothing appears in my products table :(

iaremarkus commented 7 months ago

I removed the .env and the plugin definition in medusa-config.js and presto... site is working normally again.

This is a practically stock Medusa install and this plugin rendered something borked. Would be happy to help someone debug this if anyone has the inclination?

Pity... was excited to use this.. :/

vholik commented 7 months ago

Did you modified admin panel? I think it might be related to "relations" search param when hitting /admin/products route. Can you tell also what's problem in the console

srihari20031 commented 2 months ago

Bro the were you following adil's blog to create a marketplace if so the store_id was not updating properly when you use this plugin so i tried changing the products schema in the package by adding a store_id and relation between store and products and it worked as expected , the products appeared based on the store_id and there were no error.