I have some LOAD job in Google Cloud Platform, with an error like:
"Error while reading data, error message: JSON parsing error in row starting at position 0: No such field..."
So... since I got many failed jobs, I'd like to get that JSON that was unable get parsed, so I could fix it and upload again the job.
Is it possible to get that "source" json with all the data that was uploaded to the job?
Cause I'm only able to get the job info, but not the original json with errors.
Thanks
I'd tried to get the job original failing json, but I only got the job json description/result. I need to get the source, so I could fix the json and re-upload the job.
Context:
The user enters data on the website, and then that is inserted into BiqQuery using a load job.
Since the job failed, the user's inputed data is lost. So I need to recover (if possible) the json with the user's data so I could fix it and then upload the json again, avoiding the user to manually re-enter all the data.
It's critical to start by examining the error message within the BigQuery job details. The error message you mentioned, "JSON parsing error in row starting at position 0: No such field...", provides key insights:
Depending on your LOAD job setup and the origin of the JSON, different strategies apply:
Scenario A: JSON from Cloud Storage
Scenario B: JSON Data Inlined or from Other Sources
Troubleshooting and Prevention
Caveats
Additional Consideration
Hi,
Thank you for your detailed response.
This is what I'm trying to figure out:
Web Input: If users enter data on your website, and it's converted into JSON for BigQuery, check if this user-generated JSON is temporarily stored anywhere (e.g., logs, a temporary database) before the LOAD job is triggered. This could be a valuable source for retrieval."
I guess those json must be somewhere... but I'm not able to find those.
That's mainly what I was asking, where/how to get to those files.
Thanks !
Unfortunately, BigQuery doesn't automatically store the complete source JSON of failed LOAD jobs. The error message "JSON parsing error in row starting at position 0: No such field..." suggests an immediate mismatch between your JSON's structure and your target BigQuery table's schema. We need to try recovering that JSON if possible.
Potential Recovery Strategies
Cloud Storage:
Web Input & Application Logic:
Essential Tip: Examine the exact JSON parsing error message carefully. It often provides clues about the field that's mismatched or missing, narrowing down your search.
Prevention for the Future
To avoid this painful issue again, implement safeguards: