Error Failed to fetch data from Strapi Request failed with status code 404

System Information
  • **Strapi Version 3.6.8 (node v14.15.4) **:
  • Operating System MacOs:
  • Database postgres:
  • Node Version node v14.15.4:
  • Yarn Version 1.22.10:

Hi, once in a while I get this error. I use Strapi (on Heroku) with Gatsby (on Netlify). It does not occur always. It occurs about 50% of the time. The error occurs when strapi is on heroku, when strapi is running locally it works every time.

1:42:37 PM: error Failed to fetch data from Strapi Request failed with status code 404
1:42:37 PM: 
1:42:37 PM: 
1:42:37 PM:   Error: Request failed with status code 404
1:42:37 PM:   
1:42:37 PM:   - createError.js:16 createError
1:42:37 PM:     [repo]/[gatsby-source-strapi]/[axios]/lib/core/createError.js:16:15
1:42:37 PM:   
1:42:37 PM:   - settle.js:17 settle
1:42:37 PM:     [repo]/[gatsby-source-strapi]/[axios]/lib/core/settle.js:17:12
1:42:37 PM:   
1:42:37 PM:   - http.js:260 IncomingMessage.handleStreamEnd
1:42:37 PM:     [repo]/[gatsby-source-strapi]/[axios]/lib/adapters/http.js:260:11
1:42:37 PM:   
1:42:37 PM:   - node:events:402 IncomingMessage.emit
1:42:37 PM:     node:events:402:35
1:42:37 PM:   
1:42:37 PM:   - readable:1343 endReadableNT
1:42:37 PM:     node:internal/streams/readable:1343:12
1:42:37 PM:   
1:42:37 PM:   - task_queues:83 processTicksAndRejections
1:42:37 PM:     node:internal/process/task_queues:83:21
1:42:37 PM:   
1:42:37 PM: 
1:42:37 PM: not finished source and transform nodes - 1.050s
1:42:37 PM: not finished Fetched Strapi Data - 0.754s