Code stack you are integrating Builder with
Gatsby
Reproducible code example
This occurs randomly. I can run the same build again with no code changes and its successful. I can also run the build and handful of times and have it fail on different queries on different pages. I have 2 projects running and both have the same random errors occur, though frequent enough to happen a couple of times a day.
As Steve pointed out we feel reasonably certain we have squashed the Unexpected token < in JSON at position 0 error. But you seem to be experiencing I and E at position 0 as well.
Few questions:
Because the previous error was location-specific, could you provide us with your approximate location, so we can see which data center your request is going to?
How persistent is this. Does this fail consistently or just really.
(I don’t know how technical you are) Would it be possible for you to somehow capture the response and send it to us?
Also, any way you can think of we could reproduce this problem?
@Misko Its unfortunate that I didn’t have the other errors at the time of the initial ticket creation, however, if you have a closer look at my second comment on this thread, you can see there that the Unexpected token I had been flagged there, so I had highlighted that there are many different error responses returning from your system. I assure you too that the Unexpected token E has occurred many times in the past also. Which error it is that comes up is random so it was luck of the draw for what screenshots I could provide you really.
The errors in my latest comment had come from a build using the first API key that I provided above if that helps determine which data center that particular account is connected to?
As mentioned, its persistence is pretty random. For example, the second API key had a number of builds fired between the time you flagged a fix was in place and now, and we have only seen one failed build out of about 9 builds. The error that occurred in that build was:
As for capturing what the actual response is behind it, I would LOVE to as I’d like to see what it is for myself to know if there’s anything on our side we can do to prevent it, however, after much research, I don’t believe Gatsby logs the errors coming from GraphQL, or even what occurs during the node creation of the data. We are using your gatsby package @builder.io/gatsby to create those nodes to use in these queries if that helps any? If you have any ideas on how and where we can somehow log whats happening behind this, I’m all ears - I’ve not found any way of doing so though.
Probably goes without saying, this is a pretty annoying problem. It is wasting clients build minutes, is unreliable in knowing whether changes can be pushed live in a timely manner, and the worst part is that its unpredictable - as mentioned, we can redeploy after an error and it works, or we have to redeploy 5-6 times before it will successfully go through (which is a strong indication that its not the code). Not ideal when clients have time-sensitive builds that need to happen and have to wait half a day sometimes before we get a successful build through. I’d find it hard to believe that we’re the only accounts affected by this also - if I’m honest.
@Misko@steve Are there any updates on this? We’re still experiencing these errors, albeit, in the last couple of days, I will say we’ve had more successful builds than failed ones (that’s inclusive of the weekend though).
Thanks @Misko - Not sure if there might be something wrong with it as my local test build errors within 10 seconds.
Heres a ZIP of the folder it created: Download - TransferNow
To confirm - if I remove the proxy, the error doesn’t seem to occur and the build continues as normal.
Pulling the HTML out of the error and rendering it, I get:
Thanks @Misko - that looks to have done the trick… at least from allowing the build to continue.
Unfortunately, it doesn’t look like its capturing the error though. I have created another ZIP as instructed: Download - TransferNow however I’ve eyeballed the JSONs created and the error (screenshot enclosed in the ZIP also) or the data pertaining to the error doesn’t seem to exist in any of the files, not that I could see anyway.
Yes, you are right. There is nothing out of ordinary in the logs. As far as we can tell the back-end service is working as intended. At this point, we need to be able to reproduce the issue locally to be able to help you further. Could you try to create a minimal reproduction for us?
@Ash We just pushed a fix to our infrastructure that should address the issue you were facing. Please give it a try and let us know if you are still having problems building your site with Gatsby.