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

UnprocessableEntityError while publishing an Asset! #69

Open
neenuj opened this issue Feb 12, 2021 · 1 comment
Open

UnprocessableEntityError while publishing an Asset! #69

neenuj opened this issue Feb 12, 2021 · 1 comment

Comments

@neenuj
Copy link

neenuj commented Feb 12, 2021

Hello,

When I tried to publish an asset with file attributes I got a "UnprocessableEntityError" error. Below is the code which I used to publish the asset. The complete error message can be found below as well. Please let me know how this issue can be addressed.

CODE

file_attributes = {
'fields': {
'file': {
'en-US': {
'fileName': 'products.jpg',
'contentType': 'image/jpg',
'url': 'https://cdn.shopify.com/s/files/1/2195/2237/products/P1010793_1000x.jpg?v=1594381279'}}}}

asset = client.assets(spaceid, envid).create('products007', file_attributes)
asset.publish()

ERROR

UnprocessableEntityError: HTTP status code: 422
Message: Validation error
Details:
* Name: hasHostname - Path: '['fields', 'file', 'en-US', 'url']' - Value: 'https://cdn.shopify.com/s/files/1/2195/2237/products/P1010793_1000x.jpg?v=1594381279'
Request ID: c72de457c1a85922aa292fce2d23ae67

@marcos-amaral-freshbooks

I got the same error... I avoid using one sleep(1) between process() and publish()

asset.process()
sleep(1)
asset.reload().publish()

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

No branches or pull requests

2 participants