To get the stagedUploadPath(docs), you have to first run the stagedUploadsCreate Mutation, which will return it. The stagedUploadPath is a temporary URL which acts as a place to hold the file that stores your variables for the Bulk Operation Run Mutation.
But now we have another issue arise called “message” => “Unexpected file structure - expected JSONL”
We have gone through your provided doc link and we have processed all steps.
But in last step when we are calling the bulkOperationRunMutation it is ginving us the below error and we cannot figure out where it goes wrong and the jsonl file we have created is exacly same as in the documentation.
Could you share the input variables you’re including in the bulkOperationRunMutation? Typically we see this error when the input variables that are supplied don’t match the GraphQL Admin API Schema (docs).
Also, if you have a x-request_id that would be great too - (this ID is returned in the client side response headers when you call the mutation). Thanks!
So, following our documentation, I’m able to successfully run the Bulk Operations Run Mutation and the example products are imported to my store. One thing I noticed in the logs, is that the filename in your stagedUploadPath “stege_file” doesn’t have a .jsonl extension on the end. Likely could be the cause of issue here. I don’t see the .jsonl in the docs, so will note that for action.
Here’s what I did -
Created a jsonl file with the same products from the docs, and then I called stagedUploadsCreate with the following inputs :
That’s strange, curiously I’m not able to replicate this at all when following the tutorial and using that jsonl product example from the docs.
I’d noted you were using the Guzzle client in the logs, and I’m not - that is a difference here. Potentially this could be something client specific that’s causing this. Does the jsonl file upload correctly when you upload the multi part form? Perhaps just posting the multipart forum via the terminal could be an option and I’d triple check that the jsonl file is saved as valid jsonl format (that’s got me in the past).
We have proceeded the bulk operation via PHP curl and tried to bulk create the product but the shopify also gives us the same error please see below response :
Apologies for the delayed reply. To be clear, this is a client side issue. The error you are receiving is a client side error - this isn’t an error that can be investigated from Shopify’s side. In our logs - the client is passing invalid jsonl. Invalid jsonl passed by the client would be exactly that - Invalid jsonl.
We have followed the tutorial step by step here, and we cannot replicate this unfortunately. The format of the jsonl file must match the GraphQL schema exactly. What you are passing when creating your Bulk Operation(documentation) is not valid jsonl.
What do you mean by client side as we have tried same as from documentation.
So
first we have tried all steps as per the documentation.
second we have generated same jsonl fine as per the documentation and it was not working.
third we passed same jsonl as you have provided us that is also throwing the same invalid jsonl error.
and last you have told us that it may be due to a guzzle HTTP so we have tried via core PHP and curl though it is giving us the same error.
So how can we identify that which jsonl is valid as we have tried all jsonl which shopify provided.
Hello @Luke_K ,
Good Morning,
Hope you are doing well !!
We have read your last email and follow this link : https://help.shopify.com/en/questions/partners#/contact and select the new option Report an issue [BETA] to get the solution of our issue regarding “Unexpected file structure - expected JSONL”.
We send email two times in this option but still we didn’t get any solution in our issue, we are stuck here and waiting for the help.