datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 51 forks source link

Intermittent base64 Image Error Build Failures — gatsby-source-datocms #140

Closed thmsmtylr closed 3 years ago

thmsmtylr commented 3 years ago

Description

This is an issue across all of our projects using gatsby/datocms.

Builds fail intermittently and throw the following error:

11:46:42 AM: error There was an error in your GraphQL query:
11:46:42 AM: Error: connect ETIMEDOUT 172.67.208.228:443
11:46:42 AM:    1 | fragment GatsbyDatoCmsSizes on DatoCmsFluid {
11:46:42 AM: >  2 |   base64
11:46:42 AM:      |   ^
11:46:42 AM:    3 |   aspectRatio
11:46:42 AM:    4 |   src
11:46:42 AM:    5 |   srcSet
11:46:42 AM:    6 |   sizes
11:46:42 AM:    7 | }
11:46:42 AM:    8 |
11:46:42 AM:    9 | fragment GatsbyDatoCmsSeoMetaTags on DatoCmsSeoMetaTags {
11:46:42 AM:   10 |   tags
11:46:42 AM:   11 | }
11:46:42 AM:   12 |
11:46:42 AM: File path: /opt/build/repo/src/templates/exhibition.js
11:46:42 AM: Url path: /exhibition/entertainment-is-like-friendship
11:46:42 AM: Plugin: none
11:46:42 AM: not finished run page queries - 53.213s
11:46:43 AM: ​
11:46:43 AM: ────────────────────────────────────────────────────────────────
11:46:43 AM:   "build.command" failed                                        
11:46:43 AM: ────────────────────────────────────────────────────────────────
11:46:43 AM: ​
11:46:43 AM:   Error message
11:46:43 AM:   Command failed with exit code 1: gatsby clean && gatsby build
11:46:43 AM: ​
11:46:43 AM:   Error location
11:46:43 AM:   In Build command from Netlify app:
11:46:43 AM:   gatsby clean && gatsby build
11:46:43 AM: ​
11:46:43 AM:   Resolved config
11:46:43 AM:   build:
11:46:43 AM:     command: gatsby clean && gatsby build
11:46:43 AM:     commandOrigin: ui
11:46:43 AM:     environment:
11:46:43 AM:       - DATO_API_TOKEN
11:46:43 AM:       - REVIEW_ID
11:46:43 AM:     publish: /opt/build/repo/public
11:46:43 AM: Caching artifacts
11:46:43 AM: Started saving node modules
11:46:43 AM: Finished saving node modules
11:46:43 AM: Started saving build plugins
11:46:43 AM: Finished saving build plugins
11:46:43 AM: Started saving yarn cache
11:46:43 AM: Finished saving yarn cache
11:46:43 AM: Started saving pip cache
11:46:43 AM: Finished saving pip cache
11:46:43 AM: Started saving emacs cask dependencies
11:46:43 AM: Finished saving emacs cask dependencies
11:46:43 AM: Started saving maven dependencies
11:46:43 AM: Finished saving maven dependencies
11:46:43 AM: Started saving boot dependencies
11:46:43 AM: Finished saving boot dependencies
11:46:43 AM: Started saving rust rustup cache
11:46:43 AM: Finished saving rust rustup cache
11:46:43 AM: Started saving go dependencies
11:46:43 AM: Finished saving go dependencies
11:46:43 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:46:43 AM: Failing build: Failed to build site
11:46:43 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:46:43 AM: Finished processing build request in 1m46.319222258s

Steps to reproduce

Run gatsby build using gatsby-source-datocms plugin on projects with a large number of media/images. Expected result

Build succeeds Actual result

Build intermittently fails Environment

System: OS: macOS 10.15.7 CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.7.0 - ~/.nvm/versions/node/v14.7.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.7 - ~/.nvm/versions/node/v14.7.0/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 86.0.4240.193 Firefox: 82.0.3 Safari: 14.0.1 npmPackages: gatsby: ^2.24.8 => 2.24.65 gatsby-image: ^2.4.4 => 2.4.19 gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5 gatsby-plugin-create-client-paths: ^2.3.10 => 2.3.11 gatsby-plugin-firebase: ^0.2.0-beta.4 => 0.2.0-beta.4 gatsby-plugin-google-tagmanager: ^2.3.11 => 2.3.12 gatsby-plugin-manifest: ^2.4.6 => 2.4.31 gatsby-plugin-preact: ^4.0.2 => 4.0.12 gatsby-plugin-preconnect: ^1.1.54 => 1.1.54 gatsby-plugin-preload-fonts: ^1.2.21 => 1.2.25 gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 gatsby-plugin-robots-txt: ^1.5.0 => 1.5.3 gatsby-plugin-sass: ^2.3.1 => 2.3.13 gatsby-plugin-sharp: ^2.6.6 => 2.6.36 gatsby-plugin-sitemap: ^2.4.2 => 2.4.13 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5 gatsby-source-apiserver: ^2.1.7 => 2.1.7 gatsby-source-custom-api: ^2.1.4 => 2.1.4 gatsby-source-datocms: 2.5.x => 2.5.2 gatsby-source-filesystem: ^2.3.3 => 2.3.30 gatsby-theme-auth0: ^1.1.1 => 1.1.1 gatsby-transformer-remark: ^2.8.23 => 2.8.35 gatsby-transformer-sharp: ^2.5.2 => 2.5.15 gatsby-transformer-yaml: ^2.4.10 => 2.4.12

Any ideas on how to prevent this from happening would be much appreciated!

matjack1 commented 3 years ago

thank you for the report @thmsmtylr we are going to investigate on our end and get back to you

matjack1 commented 3 years ago

hey @thmsmtylr, we've done a change in our infrastructure. Could you please try clearing the gatsby cache and trying again? Thanks!

thmsmtylr commented 3 years ago

Hi @matjack1 the issue is no longer occurring. Thank you! Can I ask what the change was?

matjack1 commented 3 years ago

Sure! We did a change in our Cloudflare firewall that was causing some intermittent blocks thinking that you were doing DoS :)

Thank you for the feedback!