The site in question: allianceforpatientaccess.org
The Netlify URL (redirects to the primary domain): afpa.netlify.app
Brief
My Gatsby-WordPress site is suffering from some sort of caching issue, but I’m struggling to determine the cause (or a solution).
The initial load appears to work correctly with a fresh browser session (e.g. following a hard refresh, or in incognito mode), but immediately fails (<8ms) with the generic net::ERR_FAILED
on any successive visit.
Details
The issue was first reported on June 10th. The Gatsby site is rebuilt every time new content is published to the WordPress instance, which happens a few times a day. Looking at the logs from around June 10th doesn’t reveal anything out of the ordinary, but I’ve included the log for the last build before the first error reports below. (There are a few warnings & errors within it, but none that stick out as relating to this issue.)
Thoughts
I’ve been unable to repro this error in my local environment, so I’m guessing that it has something to do with either the site/domain config (could this possibly be related to DNS or SSL?), or the interaction b/w Netlify & Gatsby. My last update to the Gatsby site was almost a week before the first bug reports (details in Attempted Fixes below), so it doesn’t seem like this issue is the result of code changes. I could also see this being a trivial matter, and that I’m only having difficulty due to a lack of conceptual knowledge somewhere - but this behavior seems pretty pequliar to me.
If there’s any other info that I could provide that is relevant to the matter, please let me know!
Attempted Fixes
- I initially tried the Clear cache and deploy site operation in Netlify, which made no difference.
- My last update to the Gatsby site was adding
LogRocket
&LogRocketReact
on June 5th. The timeline doesn’t quite line up with the code changes, but even so I rolled this back - to no avail. - I also tried disabling Gatsby’s service worker (
gatsby-plugin-offline
). Given how quickly the network request fails (<8ms) I thought there may be some conflict with the downloaded website. This also had no discernible effect.
Build log - Jun 9 at 4:17
4:17:26 PM: Build ready to start
4:17:28 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
4:17:28 PM: build-image tag: v3.7.6
4:17:28 PM: buildbot version: 0e3c0977102e4a2f70b6394a3004ef3b079e9861
4:17:28 PM: Fetching cached dependencies
4:17:28 PM: Starting to download cache of 467.4MB
4:17:31 PM: Finished downloading cache in 3.437058609s
4:17:31 PM: Starting to extract cache
4:17:47 PM: Finished extracting cache in 15.713240462s
4:17:47 PM: Finished fetching cache in 19.293481656s
4:17:47 PM: Starting to prepare the repo for build
4:17:47 PM: Preparing Git Reference refs/heads/master
4:17:48 PM: Parsing package.json dependencies
4:17:49 PM: Starting build script
4:17:49 PM: Installing dependencies
4:17:49 PM: Python version set to 2.7
4:17:49 PM: Started restoring cached node version
4:17:54 PM: Finished restoring cached node version
4:17:55 PM: v10.24.1 is already installed.
4:17:56 PM: Now using node v10.24.1 (npm v6.14.12)
4:17:56 PM: Started restoring cached build plugins
4:17:56 PM: Finished restoring cached build plugins
4:17:56 PM: Attempting ruby version 2.6.2, read from environment
4:17:58 PM: Using ruby version 2.6.2
4:17:58 PM: Using PHP version 5.6
4:17:58 PM: Started restoring cached node modules
4:17:58 PM: Finished restoring cached node modules
4:17:58 PM: Started restoring cached go cache
4:18:00 PM: Finished restoring cached go cache
4:18:00 PM: Installing Go version 1.12
4:18:00 PM: unset GOOS;
4:18:00 PM: unset GOARCH;
4:18:00 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
4:18:00 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
4:18:00 PM: go version >&2;
4:18:00 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
4:18:00 PM: go version go1.12 linux/amd64
4:18:00 PM: Installing missing commands
4:18:00 PM: Verify run directory
4:18:00 PM:
4:18:00 PM: ────────────────────────────────────────────────────────────────
4:18:00 PM: Netlify Build
4:18:00 PM: ────────────────────────────────────────────────────────────────
4:18:00 PM:
4:18:00 PM: ❯ Version
4:18:00 PM: @netlify/build 11.37.0
4:18:00 PM:
4:18:00 PM: ❯ Flags
4:18:00 PM: deployId: 60c121d58f68f72a521b7ed2
4:18:00 PM:
4:18:00 PM: ❯ Current directory
4:18:00 PM: /opt/build/repo
4:18:00 PM:
4:18:00 PM: ❯ Config file
4:18:00 PM: /opt/build/repo/netlify.toml
4:18:00 PM:
4:18:00 PM: ❯ Context
4:18:00 PM: production
4:18:00 PM:
4:18:00 PM: ────────────────────────────────────────────────────────────────
4:18:00 PM: 1. Build command from Netlify app
4:18:00 PM: ────────────────────────────────────────────────────────────────
4:18:00 PM:
4:18:00 PM: $ npm run build
4:18:01 PM: > afpa-wordpress@1.0.0 build /opt/build/repo
4:18:01 PM: > run-p build:gatsby build:lambda
4:18:01 PM: > afpa-wordpress@1.0.0 build:gatsby /opt/build/repo
4:18:01 PM: > gatsby build
4:18:01 PM: > afpa-wordpress@1.0.0 build:lambda /opt/build/repo
4:18:01 PM: > netlify-lambda build src/lambda
4:18:02 PM: netlify-lambda: Building functions
4:18:03 PM: Hash: b8f26f1732209796f315
4:18:03 PM: Version: webpack 4.46.0
4:18:03 PM: Time: 750ms
4:18:03 PM: Built at: 06/09/2021 8:18:03 PM
4:18:03 PM: Asset Size Chunks Chunk Names
4:18:03 PM: newGFEntry.js 2.46 KiB 0 newGFEntry
4:18:03 PM: Entrypoint newGFEntry = newGFEntry.js
4:18:03 PM: [0] ./newGFEntry.js 1.5 KiB {0} [built] [failed] [1 error]
4:18:03 PM: ERROR in ./newGFEntry.js
4:18:03 PM: Module build failed (from /opt/build/repo/node_modules/babel-loader/lib/index.js):
4:18:03 PM: Error: [BABEL] /opt/build/repo/src/lambda/newGFEntry.js: `babel-preset-gatsby` has been loaded, which consumes config generated by the Gatsby CLI. Set `NODE_ENV=test` to bypass, or run `gatsby build` first. (While processing: "/opt/build/repo/node_modules/babel-preset-gatsby/index.js")
4:18:03 PM: at loadCachedConfig (/opt/build/repo/node_modules/babel-preset-gatsby/index.js:26:15)
4:18:03 PM: at preset (/opt/build/repo/node_modules/babel-preset-gatsby/index.js:42:29)
4:18:03 PM: at async (/opt/build/repo/node_modules/@babel/core/lib/gensync-utils/async.js:33:33)
4:18:03 PM: at async (/opt/build/repo/node_modules/gensync/index.js:186:15)
4:18:03 PM: at /opt/build/repo/node_modules/gensync/index.js:216:13
4:18:03 PM: at Generator.next (<anonymous>)
4:18:03 PM: at /opt/build/repo/node_modules/@babel/core/lib/config/full.js:213:21
4:18:03 PM: at Generator.next (<anonymous>)
4:18:03 PM: at Function.<anonymous> (/opt/build/repo/node_modules/@babel/core/lib/gensync-utils/async.js:16:3)
4:18:03 PM: at Generator.next (<anonymous>)
4:18:03 PM: at step (/opt/build/repo/node_modules/gensync/index.js:269:25)
4:18:03 PM: at evaluateAsync (/opt/build/repo/node_modules/gensync/index.js:291:5)
4:18:03 PM: at Function.errback (/opt/build/repo/node_modules/gensync/index.js:113:7)
4:18:03 PM: at errback (/opt/build/repo/node_modules/@babel/core/lib/gensync-utils/async.js:60:18)
4:18:03 PM: at async (/opt/build/repo/node_modules/gensync/index.js:188:31)
4:18:03 PM: at onFirstPause (/opt/build/repo/node_modules/gensync/index.js:216:13)
4:18:06 PM: success open and validate gatsby-configs - 0.670s
4:18:07 PM: success load plugins - 1.268s
4:18:07 PM: success onPreInit - 0.047s
4:18:07 PM: success delete html and css files from previous builds - 0.003s
4:18:07 PM: success initialize cache - 0.007s
4:18:07 PM: success copy gatsby files - 0.060s
4:18:07 PM: warning [gatsby-source-wordpress] This version of gatsby-source-wordpress will soon be deprecated.
4:18:07 PM: https://www.gatsbyjs.org/blog/2020-07-07-wordpress-source-beta/
4:18:07 PM: success onPreBootstrap - 0.020s
4:18:07 PM: success createSchemaCustomization - 0.004s
4:18:08 PM: -> wordpress__acf_options fetched : 1
4:18:09 PM: -> wordpress__acf_posts fetched : 0
4:18:09 PM: -> wordpress__acf_pages fetched : 9
4:18:09 PM: -> wordpress__acf_media fetched : 95
4:18:09 PM: -> wordpress__acf_blocks fetched : 0
4:18:09 PM: -> wordpress__acf_sliders fetched : 4
4:18:09 PM: -> wordpress__acf_working_groups fetched : 11
4:18:10 PM: -> wordpress__acf_coalitions fetched : 16
4:18:10 PM: -> wordpress__acf_home_resources fetched : 6
4:18:10 PM: -> wordpress__acf_annual_reports fetched : 6
4:18:10 PM: -> wordpress__acf_guiding_principles fetched : 3
4:18:10 PM: -> wordpress__acf_leadership fetched : 9
4:18:10 PM: -> wordpress__acf_videos fetched : 71
4:18:10 PM: -> wordpress__acf_infographics fetched : 49
4:18:11 PM: -> wordpress__acf_events fetched : 20
4:18:11 PM: -> wordpress__acf_surveys fetched : 44
4:18:11 PM: -> wordpress__acf_covid_19s fetched : 55
4:18:11 PM: -> wordpress__acf_copays fetched : 16
4:18:11 PM: -> wordpress__acf_legislative_advocacy fetched : 22
4:18:11 PM: -> wordpress__acf_regulatory_advocacy fetched : 5
4:18:11 PM: -> wordpress__acf_backpages fetched : 21
4:18:11 PM: -> wordpress__acf_categories fetched : 4
4:18:12 PM: -> wordpress__acf_tags fetched : 0
4:18:12 PM: -> wordpress__acf_comments fetched : 0
4:18:12 PM: -> wordpress__acf_users fetched : 1
4:18:12 PM: -> wordpress__wp_api_menus_v2 fetched : 1
4:18:12 PM: -> wordpress__wp_api_menus_menus_items fetched : 1
4:18:12 PM: -> wordpress__wp_api_menus_menus fetched : 1
4:18:12 PM: -> wordpress__wp_api_menus_menu_locations fetched : 0
4:18:13 PM: -> wordpress__PAGE fetched : 9
4:18:13 PM: -> wordpress__wp_media fetched : 489
4:18:13 PM: -> wordpress__wp_sliders fetched : 4
4:18:14 PM: -> wordpress__wp_working_groups fetched : 11
4:18:14 PM: -> wordpress__wp_coalitions fetched : 16
4:18:14 PM: -> wordpress__wp_home_resources fetched : 6
4:18:14 PM: -> wordpress__wp_annual_reports fetched : 6
4:18:14 PM: -> wordpress__wp_guiding_principles fetched : 3
4:18:14 PM: -> wordpress__wp_leadership fetched : 9
4:18:15 PM: -> wordpress__wp_videos fetched : 71
4:18:15 PM: -> wordpress__wp_infographics fetched : 49
4:18:15 PM: -> wordpress__wp_events fetched : 20
4:18:15 PM: -> wordpress__wp_surveys fetched : 44
4:18:16 PM: -> wordpress__wp_covid_19s fetched : 55
4:18:16 PM: -> wordpress__wp_copays fetched : 16
4:18:16 PM: -> wordpress__wp_legislative_advocacy fetched : 22
4:18:16 PM: -> wordpress__wp_regulatory_advocacy fetched : 5
4:18:16 PM: -> wordpress__wp_backpages fetched : 21
4:18:16 PM: -> wordpress__CATEGORY fetched : 4
4:18:17 PM: -> wordpress__TAG fetched : 17
4:18:53 PM: Normalizing links...
4:18:53 PM: Done!
4:18:54 PM: success Downloading remote files - 36.794s - 489/489 13.29/s
4:18:54 PM: Starting Gravity Forms Source plugin
4:18:54 PM: Using: https://admin.allianceforpatientaccess.org
4:18:54 PM: Basic auth details not included
4:18:54 PM: Fetching form ids
4:18:55 PM: Fetching fields for form 1
4:18:55 PM: Fetching fields for form 2
4:18:55 PM: Processing forms
4:18:55 PM: Completed Gravity Forms Source plugin
4:18:55 PM: success Checking for changed pages - 0.000s
4:18:55 PM: success source and transform nodes - 48.196s
4:18:56 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_copays.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:56 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_covid_19s.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:56 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_surveys.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:56 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_events.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:56 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_infographics.acf.link` - [`link___NODE`, `link`]. Gatsby will use `link___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__wp_media.guid` - [`guid___NODE`, `guid`]. Gatsby will use `guid___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__acf_copays.acf.link` - [`link___NODE`, `link`]. Gatsby will use `link___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__acf_covid_19s.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__acf_surveys.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__acf_events.acf.link` - [`link`, `link___NODE`]. Gatsby will use `link___NODE`.
4:18:57 PM: warning Multiple node fields resolve to the same GraphQL field `wordpress__acf_infographics.acf.link` - [`link___NODE`, `link`]. Gatsby will use `link___NODE`.
4:18:58 PM: warning There are conflicting field types in your data.
4:18:58 PM: If you have explicitly defined a type for those fields, you can safely ignore this warning message.
4:18:58 PM: Otherwise, Gatsby will omit those fields from the GraphQL schema.
4:18:58 PM: If you know all field types in advance, the best strategy is to explicitly define them with the `createTypes` action, and skip inference with the `@dontInfer` directive.
4:18:58 PM: See https://www.gatsbyjs.org/docs/actions/#createTypes
4:18:58 PM: GF__Form.confirmations.pageId:
4:18:58 PM: - type: number
4:18:58 PM: value: 0
4:18:58 PM: - type: string
4:18:58 PM: value: ''
4:18:58 PM: success building schema - 2.680s
4:18:58 PM: info Total nodes: 2296, SitePage nodes: 23 (use --verbose for breakdown)
4:18:58 PM: success createPages - 0.078s
4:18:58 PM: success Checking for changed pages - 0.000s
4:18:58 PM: success createPagesStatefully - 0.098s
4:18:58 PM: success update schema - 0.059s
4:18:58 PM: success onPreExtractQueries - 0.000s
4:19:04 PM: success extract queries from components - 5.534s
4:19:04 PM: success write out redirect data - 0.002s
4:19:04 PM: success Build manifest and related icons - 0.377s
4:19:04 PM: success onPostBootstrap - 0.379s
4:19:04 PM: info bootstrap finished - 62.948s
4:19:13 PM: warning
4:19:13 PM: The requested width "600px" for a resolutions field for
4:19:13 PM: the file /opt/build/repo/src/images/logo-light.png
4:19:13 PM: was larger than the actual image width of 346px!
4:19:13 PM: If possible, replace the current image with a larger one.
4:19:20 PM: success run static queries - 15.348s - 20/20 1.30/s
4:19:24 PM: success run page queries - 4.406s - 33/33 7.49/s
4:19:24 PM: success write out requires - 0.009s
4:19:35 PM: warning ⠀
4:19:35 PM: warning warn - Tailwind is not purging unused styles because no template paths have been provided.
4:19:35 PM: warning warn - If you have manually configured PurgeCSS outside of Tailwind or are deliberately not removing unused styles, set `purge: false` in your Tailwind config file to silence this warning.
4:19:35 PM: warning warn - https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css
4:21:23 PM: success Building production JavaScript and CSS bundles - 118.380s
4:21:24 PM: success Rewriting compilation hashes - 0.003s
4:23:45 PM: success Generating image thumbnails - 280.304s - 731/731 2.61/s
4:23:56 PM: success Building HTML renderer - 11.376s
4:23:57 PM: 0 true
4:23:57 PM: 1 true
4:23:57 PM: 2 true
4:23:57 PM: 3 true
4:23:57 PM: { edges:
4:23:57 PM: [ { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] },
4:23:57 PM: { node: [Object] } ] }
4:23:58 PM: success Building static HTML for pages - 2.324s - 33/33 14.20/s
4:24:00 PM: warning styles.74297a2fdaf186db7112.css is 4.83 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.warning offline-plugin-app-shell-fallback/index.html is 4.84 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.Generated public/sw.js, which will precache 7 files, totaling 1153878 bytes.
4:24:00 PM: success onPostBuild - 1.126s
4:24:00 PM: info Done building in 358.238 sec
4:24:00 PM:
4:24:00 PM: (build.command completed in 5m 59.7s)
4:24:00 PM:
4:24:00 PM: ────────────────────────────────────────────────────────────────
4:24:00 PM: 2. Functions bundling
4:24:00 PM: ────────────────────────────────────────────────────────────────
4:24:00 PM:
4:24:00 PM: The Netlify Functions setting targets a non-existing directory: lambda
4:24:00 PM:
4:24:00 PM: (Functions bundling completed in 0ms)
4:24:00 PM:
4:24:00 PM: ────────────────────────────────────────────────────────────────
4:24:00 PM: 3. Deploy site
4:24:00 PM: ────────────────────────────────────────────────────────────────
4:24:00 PM:
4:24:00 PM: Starting to deploy site from 'public'
4:24:01 PM: Creating deploy tree asynchronously
4:24:01 PM: Creating deploy upload records
4:24:03 PM: 2 new files to upload
4:24:03 PM: 0 new functions to upload
4:24:03 PM: Site deploy was successfully initiated
4:24:03 PM:
4:24:03 PM: (Deploy site completed in 3s)
4:24:03 PM:
4:24:03 PM: ────────────────────────────────────────────────────────────────
4:24:03 PM: Netlify Build Complete
4:24:03 PM: ────────────────────────────────────────────────────────────────
4:24:03 PM:
4:24:03 PM: (Netlify Build completed in 6m 2.7s)
4:24:04 PM: Caching artifacts
4:24:04 PM: Started saving node modules
4:24:04 PM: Finished saving node modules
4:24:04 PM: Started saving build plugins
4:24:04 PM: Finished saving build plugins
4:24:04 PM: Started saving pip cache
4:24:04 PM: Finished saving pip cache
4:24:04 PM: Started saving emacs cask dependencies
4:24:04 PM: Finished saving emacs cask dependencies
4:24:04 PM: Started saving maven dependencies
4:24:04 PM: Finished saving maven dependencies
4:24:04 PM: Started saving boot dependencies
4:24:04 PM: Finished saving boot dependencies
4:24:04 PM: Started saving rust rustup cache
4:24:04 PM: Finished saving rust rustup cache
4:24:04 PM: Started saving go dependencies
4:24:06 PM: Finished saving go dependencies
4:24:06 PM: Build script success
4:24:06 PM: Starting post processing
4:24:06 PM: Post processing - HTML
4:24:07 PM: Post processing - header rules
4:24:07 PM: Post processing - redirect rules
4:24:07 PM: Post processing done
4:24:07 PM: Site is live ✨
4:25:34 PM: Finished processing build request in 8m6.819865629s