Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

422 on Products #2

Closed
calebcurtis8 opened this issue Mar 11, 2021 · 9 comments · Fixed by #3
Closed

422 on Products #2

calebcurtis8 opened this issue Mar 11, 2021 · 9 comments · Fixed by #3

Comments

@calebcurtis8
Copy link

After running yarn start --products each product fails to import to an empty destination store and there is a http 422 error which I can see after adding a console log. I double checked the permissions on both stores and yarn start returns "Store configuration looks correct."

I'm guessing there's an issue with line 174 of migrator.js and the structure of the product object
const newProduct = await this.destination.product.create(product)

@alexleclair
Copy link
Contributor

Have you tried it more than once? We've seen a few images fail over time, breaking the product import. Running it a second time might do the trick, and wouldn't import already-imported products

@calebcurtis8
Copy link
Author

calebcurtis8 commented Mar 11, 2021

Yes, I've only tried it on one source store though, and it's failing on every product.
Image 2021-03-11 at 12 54 56 PM

@calebcurtis8
Copy link
Author

Perhaps it is related to the number of metafields on these products or the content within them, from another store with less metafields I am not having that problem.

@alexleclair
Copy link
Contributor

(Sorry, I somehow did not get a notification when you answered!)
Interesting; The amount of metafields shouldn't matter. Do these products have anything in common (ex: are they gift cards?).
Creating gift cards through the API is currently not supported, so that could explain it...

@calebcurtis8
Copy link
Author

calebcurtis8 commented Mar 20, 2021 via email

@alexleclair
Copy link
Contributor

Oh! You are totally right! It could absolutely be a compare_at_price issue.
If you're feeling adventurous, you could open up shopify-api-node in node_modules and add a console.log to the value of "body" in this file; it should show what the actual error is, and help solve this :)

@calebcurtis8
Copy link
Author

calebcurtis8 commented Mar 20, 2021 via email

@calebcurtis8
Copy link
Author

calebcurtis8 commented Mar 20, 2021

I was able to fix it for me, but I'm not sure it's a full solution, so I added at line 172 of migrator.js

/*reset fulfillment services to shopify*/
      delete product.variants[i].fulfillment_service
      product.variants[i].inventory_management = 'shopify'

@alexleclair
Copy link
Contributor

Very very very good find! That's definitely a good interim solution :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants