Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify deploy failing (Invalid filename 'icons/icon-96x96.png?v=a19f3881b4ae7f39c6f8740545bdbfb6915cf4b0'. Deployed filenames cannot contain # or ? characters) #12754

Closed
jakeherp opened this issue Mar 22, 2019 · 14 comments

Comments

@jakeherp
Copy link
Contributor

jakeherp commented Mar 22, 2019

Description

Since a couple of days ago it keeps failing to deploy to Netlify with the following error:
8:20:02 AM: failed during stage 'deploying site': Invalid filename 'icons/icon-96x96.png?v=a19f3881b4ae7f39c6f8740545bdbfb6915cf4b0'. Deployed filenames cannot contain # or ? characters

I have confirmed this to be a problem with gatsby-plugin-manifest by locking its version to 2.0.18. In 2.0.18 it compiles fine.

Steps to reproduce

Cannot reproduce the issue locally, even using Netlify's own Docker container. Files do not get generated with query strings in my local environment.

Expected result

Gatsby project gets built and served on Netlify server.

Actual result

Deploy failing due to query string in icon filename.

@moonmeister moonmeister added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Mar 23, 2019
@moonmeister
Copy link
Contributor

@jakeherp Thanks for the report. I wrote that cache busting code and will see if I can reproduce.

Is there any more context for that error? That should be the url link provided in the html head, not the actual file name I'm not sure from this error which it's complaining about.

It is possible Netlify doesn't support url queries on files. Cache busting can be set to name or none mode to fix this. https://www.gatsbyjs.org/packages/gatsby-plugin-manifest/?=#disabling-or-changing-cache-busting-mode

It might not be needed for netlify: https://www.netlify.com/blog/2015/09/11/instant-cache-invalidation/

@moonmeister
Copy link
Contributor

I will note that The gatsbyjs.org site is on Netlify and using query base cache busting with no problem. Though maybe someone already made a work around.

@moonmeister
Copy link
Contributor

@jakeherp I just deployed the default gatsby starter no problem. If you could post your env info using gatsby info --clipboard and please also post the configuration for gatsby-plugin-manifest and if you've added a netlify config via gatsby-plugin-netlify or a netlify.toml those configs as well. Thanks!

@moonmeister moonmeister added status: needs more info Needs triaging and reproducible examples or more information to be resolved status: awaiting author response Additional information has been requested from the author labels Mar 23, 2019
@jakeherp
Copy link
Contributor Author

jakeherp commented Mar 23, 2019

The full log from Netlify is:

1:29:13 PM: Build ready to start
1:29:15 PM: build-image version: bc22f7ea2f97324f8ca25c36353605ddd91e092d
1:29:15 PM: build-image tag: v2.6.15
1:29:15 PM: buildbot version: 59deb060408a50f6010f1ca095e86edd927f5d91
1:29:15 PM: Fetching cached dependencies
1:29:16 PM: Starting to download cache of 98.7MB
1:29:17 PM: Finished downloading cache in 1.384600426s
1:29:17 PM: Starting to extract cache
1:29:20 PM: Finished extracting cache in 3.770310427s
1:29:21 PM: Finished fetching cache in 5.22995681s
1:29:21 PM: Starting to prepare the repo for build
1:29:21 PM: Preparing Git Reference refs/heads/master
1:29:22 PM: Starting build script
1:29:22 PM: Installing dependencies
1:29:23 PM: Started restoring cached node version
1:29:24 PM: Finished restoring cached node version
1:29:24 PM: v8.15.1 is already installed.
1:29:25 PM: Now using node v8.15.1 (npm v6.4.1)
1:29:25 PM: Attempting ruby version 2.3.6, read from environment
1:29:27 PM: Using ruby version 2.3.6
1:29:27 PM: Using PHP version 5.6
1:29:27 PM: Started restoring cached node modules
1:29:27 PM: Finished restoring cached node modules
1:29:27 PM: Started restoring cached yarn cache
1:29:27 PM: Finished restoring cached yarn cache
1:29:28 PM: Installing NPM modules using Yarn version 1.3.2
1:29:29 PM: yarn install v1.3.2
1:29:29 PM: [1/4] Resolving packages...
1:29:29 PM: warning @contentful/[email protected]: Package no longer supported. We recommend using @contentful/rich-text-react-renderer package. Please follow the link to learn more details https://www.gatsbyjs.org/packages/gatsby-source-contentful/\?\=contentful\#contentful-rich-text
1:29:33 PM: warning react-typed > styled-components > [email protected]: New custom equality api does not play well with all equality helpers. Please use v5.x
1:29:33 PM: [2/4] Fetching packages...
1:29:51 PM: info [email protected]: The platform "linux" is incompatible with this module.
1:29:51 PM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
1:29:51 PM: info [email protected]: The platform "linux" is incompatible with this module.
1:29:51 PM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
1:29:51 PM: [3/4] Linking dependencies...
1:29:51 PM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0".
1:29:51 PM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".
1:29:51 PM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.13.0".
1:29:51 PM: warning "gatsby > mini-css-extract-plugin > schema-utils > [email protected]" has unmet peer dependency "ajv@>=5.0.0".
1:29:51 PM: warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
1:29:59 PM: [4/4] Building fresh packages...
1:30:02 PM: success Saved lockfile.
1:30:02 PM: Done in 33.75s.
1:30:02 PM: NPM modules installed using Yarn
1:30:03 PM: Started restoring cached go cache
1:30:03 PM: Finished restoring cached go cache
1:30:03 PM: Installing Go version 1.10
1:30:08 PM: unset GOOS;
1:30:08 PM: unset GOARCH;
1:30:08 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
1:30:08 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
1:30:08 PM: go version >&2;
1:30:08 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env"
1:30:08 PM: go version go1.10 linux/amd64
1:30:08 PM: Installing missing commands
1:30:08 PM: Verify run directory
1:30:08 PM: Executing user command: gatsby build
1:30:10 PM: success open and validate gatsby-configs — 0.009 s
1:30:10 PM: success load plugins — 0.349 s
1:30:11 PM: success onPreInit — 0.926 s
1:30:11 PM: success delete html and css files from previous builds — 0.104 s
1:30:11 PM: success initialize cache — 0.010 s
1:30:11 PM: success copy gatsby files — 0.022 s
1:30:11 PM: success onPreBootstrap — 0.008 s
1:30:11 PM: Starting to fetch data from Contentful
1:30:11 PM: Fetching default locale
1:30:12 PM: default locale is : en-US
1:30:12 PM: contentTypes fetched 1
1:30:12 PM: Updated entries  6
1:30:12 PM: Deleted entries  0
1:30:12 PM: Updated assets  8
1:30:12 PM: Deleted assets  0
1:30:12 PM: Fetch Contentful data: 512.102ms
1:30:12 PM: success source and transform nodes — 0.658 s
1:30:12 PM: success building schema — 0.399 s
1:30:12 PM: success createPages — 0.077 s
1:30:13 PM: success createPagesStatefully — 0.047 s
1:30:13 PM: success onPreExtractQueries — 0.007 s
1:30:13 PM: success update schema — 0.231 s
1:30:13 PM: success extract queries from components — 0.181 s
1:30:15 PM: success run graphql queries — 1.831 s — 17/17 9.29 queries/second
1:30:15 PM: success write out page data — 0.004 s
1:30:15 PM: success write out redirect data — 0.058 s
1:30:15 PM: success onPostBootstrap — 0.163 s
1:30:15 PM: info bootstrap finished - 7.369 s
1:30:30 PM: success Building production JavaScript and CSS bundles — 15.313 s
1:30:32 PM: success Building static HTML for pages — 1.464 s — 14/14 41.35 pages/second
1:30:32 PM: Generated public/sw.js, which will precache 11 files, totaling 297480 bytes.
1:30:32 PM: info Done building in 24.443 sec
1:30:32 PM: Caching artifacts
1:30:32 PM: Started saving node modules
1:30:32 PM: Finished saving node modules
1:30:32 PM: Started saving yarn cache
1:30:32 PM: Finished saving yarn cache
1:30:32 PM: Started saving pip cache
1:30:32 PM: Finished saving pip cache
1:30:32 PM: Started saving emacs cask dependencies
1:30:32 PM: Finished saving emacs cask dependencies
1:30:32 PM: Started saving maven dependencies
1:30:32 PM: Finished saving maven dependencies
1:30:32 PM: Started saving boot dependencies
1:30:32 PM: Finished saving boot dependencies
1:30:32 PM: Started saving go dependencies
1:30:34 PM: Finished saving go dependencies
1:30:34 PM: failed during stage 'deploying site': Invalid filename 'icons/icon-256x256.png?v=a19f3881b4ae7f39c6f8740545bdbfb6915cf4b0'. Deployed filenames cannot contain # or ? characters
1:30:34 PM: Build script success
1:30:34 PM: Starting to deploy site from 'public/'
1:30:34 PM: Failing build: Failed to deploy site
1:30:35 PM: Finished processing build request in 1m19.461584539s
1:30:35 PM: Shutting down logging, 0 messages pending

I am now not in the office, from where I have had the issue, but the system report for my Macbook with the same configuration is:

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.0 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 72.0.3626.121
    Safari: 12.0.3
  npmPackages:
    gatsby: ^2.1.4 => 2.1.4
    gatsby-image: ^2.0.29 => 2.0.29
    gatsby-plugin-manifest: 2.0.18 => 2.0.18
    gatsby-plugin-nprogress: ^2.0.8 => 2.0.8
    gatsby-plugin-offline: ^2.0.24 => 2.0.23
    gatsby-plugin-react-helmet: ^3.0.6 => 3.0.6
    gatsby-plugin-robots-txt: ^1.4.0 => 1.4.0
    gatsby-plugin-sass: ^2.0.10 => 2.0.10
    gatsby-plugin-sharp: ^2.0.20 => 2.0.20
    gatsby-plugin-sitemap: ^2.0.5 => 2.0.5
    gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4
    gatsby-source-contentful: ^2.0.29 => 2.0.29
    gatsby-source-filesystem: ^2.0.20 => 2.0.20
    gatsby-transformer-sharp: ^2.1.13 => 2.1.13
    gatsby-v2-plugin-page-transitions: ^1.0.0 => 1.0.0

My configuration for gatsby-plugin-manifest:

    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `jacob-herper`,
        short_name: `jacob`,
        start_url: `/`,
        background_color: `#E94E1B`,
        theme_color: `#E94E1B`,
        display: `minimal-ui`,
        icon: `src/assets/images/favicon.png` // This path is relative to the root of the site.
      }
    }

gatsby-plugin-netlify or netlify.toml are not set up, but I'll look into that now.

@moonmeister
Copy link
Contributor

Looks like it is the file names it's complaining about. I'll see if in can re-create this. Send me the config if you get a chance.

@jakeherp
Copy link
Contributor Author

Sorry, missed your previous message. Which config do you need?

@moonmeister
Copy link
Contributor

moonmeister commented Mar 25, 2019

Manifest plugin config - but I just saw you posted it above. Looks like we both missed something. I'll take a look in to morning

@jakeherp
Copy link
Contributor Author

Great, thank you!

@moonmeister moonmeister removed status: awaiting author response Additional information has been requested from the author status: needs more info Needs triaging and reproducible examples or more information to be resolved labels Mar 26, 2019
@moonmeister
Copy link
Contributor

@jakeherp I'm unable to reproduce this. I've read the through the logic multiple times, it seems to be correct. If you can post a repo this is happening on then maybe we can go from there. If you can't post your production repo maybe make a copy and rip out all the custom work and just leave the plugins and configs, deploy it to netlify and confirm your issue is still happening.

Otherwise I'd make sure you're not committing public to a your repo. Also, try deploying to a new netlify instance for kicks and giggles. It "Should" be the same, but who knows.

@moonmeister moonmeister added the status: awaiting author response Additional information has been requested from the author label Mar 26, 2019
@jakeherp
Copy link
Contributor Author

jakeherp commented Mar 26, 2019

I can't reproduce it in my local environment myself, yet it fails on Netlify.
Just tested it again with the same error:

8:41:14 AM: Build ready to start
8:41:16 AM: build-image version: bc22f7ea2f97324f8ca25c36353605ddd91e092d
8:41:16 AM: build-image tag: v2.6.15
8:41:16 AM: buildbot version: 59deb060408a50f6010f1ca095e86edd927f5d91
8:41:16 AM: Fetching cached dependencies
8:41:16 AM: Starting to download cache of 214.7MB
8:41:17 AM: Finished downloading cache in 1.221278553s
8:41:17 AM: Starting to extract cache
8:41:25 AM: Finished extracting cache in 7.905432269s
8:41:25 AM: Finished fetching cache in 9.247575207s
8:41:25 AM: Starting to prepare the repo for build
8:41:26 AM: Preparing Git Reference refs/heads/master
8:41:27 AM: Starting build script
8:41:27 AM: Installing dependencies
8:41:27 AM: Started restoring cached node version
8:41:28 AM: Finished restoring cached node version
8:41:29 AM: v8.15.1 is already installed.
8:41:30 AM: Now using node v8.15.1 (npm v6.4.1)
8:41:30 AM: Attempting ruby version 2.3.6, read from environment
8:41:31 AM: Using ruby version 2.3.6
8:41:31 AM: Using PHP version 5.6
8:41:31 AM: Started restoring cached node modules
8:41:31 AM: Finished restoring cached node modules
8:41:31 AM: Started restoring cached yarn cache
8:41:31 AM: Finished restoring cached yarn cache
8:41:32 AM: Installing NPM modules using Yarn version 1.3.2
8:41:33 AM: yarn install v1.3.2
8:41:33 AM: [1/4] Resolving packages...
8:41:35 AM: [2/4] Fetching packages...
8:41:53 AM: info [email protected]: The platform "linux" is incompatible with this module.
8:41:53 AM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
8:41:53 AM: info [email protected]: The platform "linux" is incompatible with this module.
8:41:53 AM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
8:41:53 AM: [3/4] Linking dependencies...
8:41:53 AM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0".
8:41:53 AM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".
8:41:53 AM: warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.13.0".
8:41:53 AM: warning "gatsby > mini-css-extract-plugin > schema-utils > [email protected]" has unmet peer dependency "ajv@>=5.0.0".
8:41:53 AM: warning "gatsby > pnp-webpack-plugin > [email protected]" has unmet peer dependency "typescript@*".
8:41:53 AM: warning "gatsby-plugin-netlify > [email protected]" has unmet peer dependency "webpack@>=4.4.0".
8:41:53 AM: warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
8:42:03 AM: [4/4] Building fresh packages...
8:42:06 AM: success Saved lockfile.
8:42:06 AM: Done in 32.86s.
8:42:06 AM: NPM modules installed using Yarn
8:42:06 AM: Started restoring cached go cache
8:42:08 AM: Finished restoring cached go cache
8:42:08 AM: Installing Go version 1.10
8:42:08 AM: unset GOOS;
8:42:08 AM: unset GOARCH;
8:42:08 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
8:42:08 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
8:42:08 AM: go version >&2;
8:42:08 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env';
8:42:08 AM: go version go1.10 linux/amd64
8:42:08 AM: Installing missing commands
8:42:08 AM: Verify run directory
8:42:08 AM: Executing user command: gatsby build
8:42:10 AM: success open and validate gatsby-configs — 0.006 s
8:42:11 AM: success load plugins — 0.318 s
8:42:12 AM: success onPreInit — 0.936 s
8:42:12 AM: success delete html and css files from previous builds — 0.008 s
8:42:12 AM: success initialize cache — 0.108 s
8:42:12 AM: success copy gatsby files — 0.020 s
8:42:12 AM: success onPreBootstrap — 0.005 s
8:42:12 AM: Starting to fetch data from Contentful
8:42:12 AM: Fetching default locale
8:42:12 AM: default locale is : en-US
8:42:13 AM: contentTypes fetched 1
8:42:13 AM: Updated entries  6
8:42:13 AM: Deleted entries  0
8:42:13 AM: Updated assets  8
8:42:13 AM: Deleted assets  0
8:42:13 AM: Fetch Contentful data: 601.487ms
8:42:13 AM: success source and transform nodes — 0.762 s
8:42:13 AM: success building schema — 0.299 s
8:42:13 AM: success createPages — 0.059 s
8:42:13 AM: success createPagesStatefully — 0.061 s
8:42:13 AM: success onPreExtractQueries — 0.007 s
8:42:13 AM: success update schema — 0.043 s
8:42:13 AM: success extract queries from components — 0.180 s
8:42:14 AM: success run graphql queries — 0.438 s — 17/17 38.96 queries/second
8:42:14 AM: success write out page data — 0.004 s
8:42:14 AM: success write out redirect data — 0.001 s
8:42:14 AM: success onPostBootstrap — 0.301 s
8:42:14 AM: info bootstrap finished - 6.035 s
8:42:31 AM: success Building production JavaScript and CSS bundles — 17.120 s
8:42:33 AM: success Building static HTML for pages — 1.640 s — 14/14 35.85 pages/second
8:42:33 AM: Generated public/sw.js, which will precache 12 files, totaling 297056 bytes.
8:42:33 AM: info Done building in 24.906 sec
8:42:33 AM: Caching artifacts
8:42:33 AM: Started saving node modules
8:42:33 AM: Finished saving node modules
8:42:33 AM: Started saving yarn cache
8:42:33 AM: Finished saving yarn cache
8:42:33 AM: Started saving pip cache
8:42:33 AM: Finished saving pip cache
8:42:33 AM: Started saving emacs cask dependencies
8:42:33 AM: Finished saving emacs cask dependencies
8:42:33 AM: Started saving maven dependencies
8:42:33 AM: Finished saving maven dependencies
8:42:33 AM: Started saving boot dependencies
8:42:33 AM: Finished saving boot dependencies
8:42:33 AM: Started saving go dependencies
8:42:34 AM: Finished saving go dependencies
8:42:34 AM: Build script success
8:42:34 AM: Starting to deploy site from 'public/'
8:42:34 AM: Failing build: Failed to deploy site
8:42:35 AM: failed during stage 'deploying site': Invalid filename 'icons/icon-512x512.png?v=a19f3881b4ae7f39c6f8740545bdbfb6915cf4b0'. Deployed filenames cannot contain # or ? characters
8:42:35 AM: Finished processing build request in 1m18.697460709s
8:42:35 AM: Shutting down logging, 0 messages pending

Netlify support wrote:

Hi Jacob,
Well, nothing much to learn at that URL - your build has a file with that name. I understand that is not your expectation, but it is nothing we are doing special to affect your build. Since we won't be able to help debug your source code in any more detail, here's how you can examine your build output so you can debug:

The easiest way to debug your build in our environment is to pull down the docker container that we use as a build image and use it interactively. First please clone a new copy of your repository so it will look like the one we clone (without any local changes), and also replace my placeholder VAR=value on line 5 to match yours here: https://app.netlify.com/sites/herper-io/settings/deploys#build-environment-variables

docker pull netlify/build
git clone https://github.com/netlify/build-image
cd build-image
git checkout -b trusty
./test-tools/start-image.sh /path/to/your/checked/out/repository
export var=VALUE
build gatsby build
If you want some more context on why I suggest this, our build process is described in detail here:

https://www.netlify.com/blog/2016/10/18/how-our-build-bots-build-sites/

I have done all that, still can't reproduce the same result, even when using their Docker container.
Having the version of gatsby-plugin-manifest locked to 2.0.23 deploys just fine, so it must be a change within the 2.0.24 release.

The repo for my project can be found here.

Thanks again for your help!

@jakeherp jakeherp removed the status: awaiting author response Additional information has been requested from the author label Mar 26, 2019
@moonmeister
Copy link
Contributor

@jakeherp Yeah, I've been try to reproduce on Netlify. 2.0.24 is where the cache busting feature got added, so this makes sense. Should have been a minor tick and not patch but oh well. I'll try with your repo and go from there.

@moonmeister
Copy link
Contributor

moonmeister commented Mar 27, 2019

@jakeherp https://github.com/jakeherp/gatsby-portfolio/blob/master/gatsby-config.js -- Your gatsby-plugin-manifest is configured twice! This means the build is probably running twice and because we're mutating variables it incorrectly names files on the second run.

@jakeherp
Copy link
Contributor Author

Gosh, I'm sorry for keeping you busy with that! Didn't realise that I had it in there twice.
It is in fact working now! Thanks so much for your help!

@jakeherp jakeherp removed the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Mar 27, 2019
@moonmeister
Copy link
Contributor

@jakeherp Glad we figured it out and always happy help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants