Builds fails to fetch API once every few builds

Hello Support team :wave: ,

We have an issue on our build, once every seven / ten builds, we receive an error.
Errors can be:

  • 622e25c2970760549f643256: 6:15:35 PM: request to https://api.myapp.com/graphql failed, reason: **read ECONNRESET**
  • 622f088714612968740bf78c: 10:21:59 AM: FetchError: invalid json response body at https://api.myapp.com/graphql reason: Unexpected end of JSON input
  • 622f4730e27e550b7b34fafd: 2:51:27 PM: error There was a problem loading the local build command. Gatsby may not be installed. Perhaps you need to run "npm install"? Cannot find module 'mime'

No trace of those calls found on our logs, no fails reported on API side.
We closely monitor our services and network without seeing any issue. Moreover, the third issue is not even related to our api but maybe a connection lost to internal npm repos mirrors.

So I suspects some networking issue from the build VM in Netlify, could you please tell me what you think we or you should do, just mitigating it by replaying the build (it works well until today to replay build after failure)?

I’ve read another very similar post:

But there is no answer, just a mitigation.

Our site id : 2d8e4327-cb5f-49c9-a338-66a667d317ba
Our repos are private, our api is exposed throught netlify domain [DNS settings].

If you need further informations, please let me know.

Thanks.

Hey @Compagnie,

We checked this and it appears that you’ve had a lot of successful builds with only a few ones that failed. Even the ones that failed, almost all of those had a different error each time.

We also noticed that the API you’re trying to call during the build time is actually proxied through Netlify. Is there a specific reason for doing that? Why not call the target API directly? I believe by doing that you’re adding a step in your process which can be a source of error and that’s probably unnecessary.

1 Like

Hello @hrishikesh,

Thanks for your answer, I’m a bit late to the party but anyway.

You are totally right, we will try do make this change and see how it goes. We’ll keep you updated.

Many thanks !