Description
Description
Sometimes when I deploy my current site to Netlify, the build fails pretty weirdly. I get a very cryptic Error: Input file missing or of an unsupported image format
or some other correlated ambiguous error. The thing is, I can eventually get the site to deploy. It just takes 5 or 6 tries sometimes. Everything runs fine on my machine, but for some reason when I deploy it likes to just throw this error. While it isn't exactly critical, it's extremely frustrating because all I can do is keep trying to redeploy and hope it eventually works.
Steps to reproduce
Not really anything I can reproduce. For some reason things are just failing from time to time. It seems like that's the nature of gatsby, though. Sometimes things just don't build for a really random reason.
Expected result
Site should build without errors
Actual result
Full output:
8:21:22 AM: Build ready to start
8:21:24 AM: Fetching cached dependencies
8:21:24 AM: Starting to download cache of 254.8KB
8:21:24 AM: Finished downloading cache in 119.348679ms
8:21:24 AM: Starting to extract cache
8:21:24 AM: Failed to fetch cache, continuing with build
8:21:24 AM: Starting to prepare the repo for build
8:21:24 AM: No cached dependencies found. Cloning fresh repo
8:21:24 AM: git clone git@github.com:Darthmaul/Gatsby-Andrewn
8:21:25 AM: Preparing Git Reference refs/heads/dev
8:21:25 AM: Starting build script
8:21:25 AM: Installing dependencies
8:21:26 AM: Downloading and installing node v8.11.3...
8:21:26 AM: Downloading https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz...
8:21:27 AM:
#
8:21:27 AM: 2.3%
8:21:27 AM:
#########
8:21:27 AM: 13.7%
8:21:27 AM:
##################
8:21:27 AM: 26.1%
8:21:27 AM:
############################
8:21:27 AM: 39.4%
8:21:27 AM: #
8:21:27 AM: ##################################### 53.1%
8:21:27 AM:
######################################
8:21:27 AM: ########## 67.5%
8:21:27 AM:
########################################################### 82.3%
8:21:28 AM:
###################################################################### 97.9%
8:21:28 AM:
######################################################################## 100.0%
8:21:28 AM: Computing checksum with sha256sum
8:21:28 AM: Checksums matched!
8:21:30 AM: Now using node v8.11.3 (npm v5.6.0)
8:21:30 AM: Attempting ruby version 2.3.6, read from environment
8:21:31 AM: Using ruby version 2.3.6
8:21:31 AM: Using PHP version 5.6
8:21:31 AM: Started restoring cached node modules
8:21:31 AM: Finished restoring cached node modules
8:21:31 AM: Installing NPM modules using NPM version 5.6.0
8:21:35 AM: npm WARN notice
8:21:35 AM: [SECURITY] ws has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=ws&version=3.0.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
8:21:53 AM: > sharp@0.20.5 install /opt/build/repo/node_modules/sharp
8:21:53 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
8:21:54 AM: info
8:21:54 AM: sharp Detected globally-installed libvips v8.6.2
8:21:54 AM: info sharp Building from source via node-gyp
8:21:55 AM: make: Entering directory `/opt/build/repo/node_modules/sharp/build'
8:21:55 AM: TOUCH Release/obj.target/libvips-cpp.stamp
8:21:55 AM: CXX(target) Release/obj.target/sharp/src/common.o
8:21:56 AM: CXX(target) Release/obj.target/sharp/src/metadata.o
8:21:57 AM: CXX(target) Release/obj.target/sharp/src/stats.o
8:21:58 AM: CXX(target) Release/obj.target/sharp/src/operations.o
8:22:00 AM: CXX(target) Release/obj.target/sharp/src/pipeline.o
8:22:02 AM: CXX(target) Release/obj.target/sharp/src/sharp.o
8:22:03 AM: CXX(target) Release/obj.target/sharp/src/utilities.o
8:22:04 AM: SOLINK_MODULE(target) Release/obj.target/sharp.node
8:22:04 AM: COPY Release/sharp.node
8:22:04 AM: make: Leaving directory `/opt/build/repo/node_modules/sharp/build'
8:22:05 AM: > pngquant-bin@4.0.0 postinstall /opt/build/repo/node_modules/pngquant-bin
8:22:05 AM: > node lib/install.js
8:22:06 AM: ✔ pngquant pre-build test passed successfully
8:22:06 AM: > cwebp-bin@4.0.0 postinstall /opt/build/repo/node_modules/cwebp-bin
8:22:06 AM: > node lib/install.js
8:22:06 AM: ✔ cwebp pre-build test passed successfully
8:22:09 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
8:22:09 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:22:09 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/chokidar/node_modules/fsevents):
8:22:09 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:22:09 AM: added 2015 packages in 37.185s
8:22:09 AM: NPM modules installed
8:22:09 AM: Started restoring cached go cache
8:22:09 AM: Finished restoring cached go cache
8:22:09 AM: unset GOOS;
8:22:09 AM: unset GOARCH;
8:22:09 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64';
8:22:09 AM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
8:22:09 AM: go version >&2;
8:22:09 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env';
8:22:09 AM: go version go1.10 linux/amd64
8:22:09 AM: Installing missing commands
8:22:09 AM: Verify run directory
8:22:09 AM: Executing user command: gatsby build
8:22:11 AM: success open and validate gatsby-config — 0.006 s
8:22:12 AM: success onPreBootstrap — 0.357 s
8:22:12 AM: success delete html and css files from previous builds — 0.006 s
8:22:12 AM: success copy gatsby files — 0.010 s
8:22:12 AM: =START PLUGIN=====================================
8:22:12 AM: Site URL: https://admin.andrewn.me
8:22:12 AM: Site hosted on Wordpress.com: false
8:22:12 AM: Using ACF: true
8:22:12 AM: Using Auth: undefined undefined
8:22:12 AM: Verbose output: true
8:22:12 AM: Mama Route URL: https://admin.andrewn.me/wp-json
8:22:12 AM: Route discovered : /
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /oembed/1.0
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /oembed/1.0/embed
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /oembed/1.0/proxy
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2/posts
8:22:12 AM: Valid route found. Will try to fetch.
8:22:12 AM: Route discovered : /wp/v2/posts/(?P<id>[\d]+)
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2/posts/(?P<parent>[\d]+)/revisions
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2/posts/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2/pages
8:22:12 AM: Valid route found. Will try to fetch.
8:22:12 AM: Route discovered : /wp/v2/pages/(?P<id>[\d]+)
8:22:12 AM: Invalid route.
8:22:12 AM: Route discovered : /wp/v2/pages/(?P<parent>[\d]+)/revisions
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/pages/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/media
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/media/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/types
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/types/(?P<type>[\w-]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/statuses
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/statuses/(?P<status>[\w-]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/taxonomies
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/taxonomies/(?P<taxonomy>[\w-]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/categories
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/categories/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/tags
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/tags/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/users
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/users/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/users/me
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/comments
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Route discovered : /wp/v2/comments/(?P<id>[\d]+)
8:22:13 AM: Invalid route.
8:22:13 AM: Route discovered : /wp/v2/settings
8:22:13 AM: Valid route found. Will try to fetch.
8:22:13 AM: Added ACF Options route.
8:22:13 AM: Fetching the JSON data from 13 valid API Routes...
8:22:13 AM: === [ Fetching wordpress__POST ] === https://admin.andrewn.me/wp-json/wp/v2/posts
8:22:13 AM: -> wordpress__POST fetched : 7
8:22:13 AM: Fetching the wordpress__POST took: 390.414ms
8:22:13 AM: === [ Fetching wordpress__PAGE ] === https://admin.andrewn.me/wp-json/wp/v2/pages
8:22:13 AM: -> wordpress__PAGE fetched : 2
8:22:13 AM: Fetching the wordpress__PAGE took: 318.930ms
8:22:13 AM: === [ Fetching wordpress__wp_media ] === https://admin.andrewn.me/wp-json/wp/v2/media
8:22:13 AM: -> wordpress__wp_media fetched : 2
8:22:13 AM: Fetching the wordpress__wp_media took: 314.963ms
8:22:13 AM: === [ Fetching wordpress__wp_types ] === https://admin.andrewn.me/wp-json/wp/v2/types
8:22:13 AM: -> wordpress__wp_types fetched : 1
8:22:13 AM: Fetching the wordpress__wp_types took: 287.646ms
8:22:14 AM: === [ Fetching wordpress__wp_statuses ] === https://admin.andrewn.me/wp-json/wp/v2/statuses
8:22:14 AM: -> wordpress__wp_statuses fetched : 1
8:22:14 AM: Fetching the wordpress__wp_statuses took: 329.429ms
8:22:14 AM: === [ Fetching wordpress__wp_taxonomies ] === https://admin.andrewn.me/wp-json/wp/v2/taxonomies
8:22:14 AM: -> wordpress__wp_taxonomies fetched : 1
8:22:15 AM: Fetching the wordpress__wp_taxonomies took: 332.851ms
8:22:15 AM: === [ Fetching wordpress__CATEGORY ] === https://admin.andrewn.me/wp-json/wp/v2/categories
8:22:16 AM: -> wordpress__CATEGORY fetched : 1
8:22:16 AM: Fetching the wordpress__CATEGORY took: 296.298ms
8:22:16 AM: === [ Fetching wordpress__TAG ] === https://admin.andrewn.me/wp-json/wp/v2/tags
8:22:16 AM: -> wordpress__TAG fetched : 0
8:22:16 AM: Fetching the wordpress__TAG took: 343.814ms
8:22:16 AM: === [ Fetching wordpress__wp_users ] === https://admin.andrewn.me/wp-json/wp/v2/users
8:22:16 AM: -> wordpress__wp_users fetched : 1
8:22:16 AM: Fetching the wordpress__wp_users took: 295.189ms
8:22:16 AM: === [ Fetching wordpress__wp_me ] === https://admin.andrewn.me/wp-json/wp/v2/users/me
8:22:16 AM: The server response was "401 Unauthorized"
8:22:16 AM: Inner exception message : "You are not currently logged in."
8:22:16 AM: Fetching the wordpress__wp_me took: 290.590ms
8:22:16 AM: === [ Fetching wordpress__wp_comments ] === https://admin.andrewn.me/wp-json/wp/v2/comments
8:22:16 AM: -> wordpress__wp_comments fetched : 1
8:22:16 AM: Fetching the wordpress__wp_comments took: 165.549ms
8:22:16 AM: === [ Fetching wordpress__wp_settings ] === https://admin.andrewn.me/wp-json/wp/v2/settings
8:22:16 AM: -> wordpress__wp_settings fetched : 1
8:22:16 AM: Fetching the wordpress__wp_settings took: 131.561ms
8:22:16 AM: === [ Fetching wordpress__acf_options ] === https://admin.andrewn.me/wp-json/acf/v2/options
8:22:16 AM: -> wordpress__acf_options fetched : 1
8:22:16 AM: Fetching the wordpress__acf_options took: 131.670ms
8:22:16 AM: =END PLUGIN=====================================: 4188.889ms
8:26:21 AM: success source and transform nodes — 249.780 s
8:26:30 AM: success building schema — 8.558 s
8:26:31 AM: The requested width "500px" for a resolutions field for
8:26:31 AM: the file /opt/build/repo/.cache/gatsby-source-filesystem/ec0940c83045cbbfc8c05ae8253eced3.png
8:26:31 AM: was wider than the actual image width of 90px!
8:26:31 AM: If possible, replace the current image with a larger one.
8:26:31 AM: error Failed to process image /opt/build/repo/.cache/gatsby-source-filesystem/ec0940c83045cbbfc8c05ae8253eced3.png
8:26:31 AM:
8:26:31 AM: Error: Input file is missing or of an unsupported image format
8:26:31 AM:
8:26:31 AM: Caching artifacts
8:26:31 AM: Started saving node modules
8:26:31 AM: Finished saving node modules
8:26:31 AM: Started saving pip cache
8:26:31 AM: Finished saving pip cache
8:26:31 AM: Started saving emacs cask dependencies
8:26:31 AM: Finished saving emacs cask dependencies
8:26:31 AM: Started saving maven dependencies
8:26:31 AM: Finished saving maven dependencies
8:26:31 AM: Started saving boot dependencies
8:26:31 AM: Finished saving boot dependencies
8:26:31 AM: Started saving go dependencies
8:26:31 AM: Finished saving go dependencies
8:26:31 AM: Cached node version v8.11.3
8:26:31 AM: Error running command: Build script returned non-zero exit code: 1
8:26:31 AM: Failing build: Failed to build site
8:26:31 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:26:31 AM: Finished processing build request in 5m8.016082159s
Environment
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
Binaries:
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.0.0-beta.16 => 2.0.0-beta.16
gatsby-image: ^2.0.0-beta.4 => 2.0.0-beta.4
gatsby-plugin-glamor: next => 2.0.0-beta.2
gatsby-plugin-react-helmet: ^3.0.0-beta.3 => 3.0.0-beta.3
gatsby-plugin-remove-trailing-slashes: ^1.0.9 => 1.0.9
gatsby-plugin-sharp: ^2.0.0-beta.2 => 2.0.0-beta.2
gatsby-plugin-typography: next => 2.2.0-beta.2
gatsby-source-filesystem: ^1.5.39 => 1.5.39
gatsby-source-wordpress: ^2.0.93 => 2.0.93
gatsby-transformer-sharp: ^2.1.1-beta.3 => 2.1.1-beta.3
File contents (if changed)
gatsby-config.js
:
module.exports = {
siteMetadata: {
title: `Andrew Nolan`,
subtitle: `Web Designer & Developer | WordPress Developer`,
},
plugins: [
// https://public-api.wordpress.com/wp/v2/sites/gatsbyjsexamplewordpress.wordpress.com/pages/
/*
* Gatsby's data processing layer begins with “source”
* plugins. Here the site sources its data from Wordpress.
*/
{
resolve: `gatsby-source-wordpress`,
options: {
/*
* The base URL of the Wordpress site without the trailingslash and the protocol. This is required.
* Example : 'gatsbyjswpexample.wordpress.com' or 'www.example-site.com'
*/
baseUrl: `admin.andrewn.me`,
// The protocol. This can be http or https.
protocol: `https`,
searchAndReplaceContentUrls: {
sourceUrl: "https://admin.andrew.me",
replacementUrl: "https://andrew.me",
},
// Indicates whether the site is hosted on wordpress.com.
// If false, then the asumption is made that the site is self hosted.
// If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
// If your site is hosted on wordpress.org, then set this to false.
hostingWPCOM: false,
// If useACF is true, then the source plugin will try to import the Wordpress ACF Plugin contents.
// This feature is untested for sites hosted on Wordpress.com
useACF: true,
verboseOutput: true,
},
},
`gatsby-plugin-remove-trailing-slashes`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-glamor`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`
}
},
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography.js`,
},
},
],
}
package.json
:
{
"name": "gatsby-example-using-wordpress",
"private": true,
"description": "Gatsby example site using the Wordpress source plugin",
"version": "1.0.0-beta.6",
"author": "Sebastien Fichot <fichot.sebastien@gmail.com>",
"dependencies": {
"bootstrap": "^4.1.1",
"gatsby": "^2.0.0-beta.16",
"gatsby-image": "^2.0.0-beta.4",
"gatsby-plugin-glamor": "next",
"gatsby-plugin-react-helmet": "^3.0.0-beta.3",
"gatsby-plugin-sharp": "^2.0.0-beta.2",
"gatsby-plugin-typography": "next",
"gatsby-source-filesystem": "^1.5.39",
"gatsby-source-wordpress": "^2.0.93",
"gatsby-transformer-sharp": "^2.1.1-beta.3",
"glamor": "^2.20.40",
"graphql": "^0.13.2",
"jquery": "^3.3.1",
"lodash": "^4.16.4",
"popper.js": "^1.14.3",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-helmet": "^5.2.0",
"react-icons": "^2.2.7",
"react-typography": "^0.16.13",
"typography": "^0.16.16",
"typography-theme-wordpress-2013": "^0.15.10",
"webpack": "^4.14.0"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"scripts": {
"dev": "gatsby develop",
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1",
"develop": "gatsby develop",
"build": "gatsby build",
"start": "gatsby serve",
"predeploy": "gatsby build --prefix-paths"
},
"devDependencies": {
"eslint": "^4.1.1",
"gatsby-plugin-remove-trailing-slashes": "^1.0.9"
}
}
gatsby-node.js
:
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const slash = require(`slash`)
// Implement the Gatsby API “createPages”. This is
// called after the Gatsby bootstrap is finished so you have
// access to any information necessary to programmatically
// create pages.
// Will create pages for Wordpress pages (route : /{slug})
// Will create pages for Wordpress posts (route : /post/{slug})
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions
return new Promise((resolve, reject) => {
// The “graphql” function allows us to run arbitrary
// queries against the local Wordpress graphql schema. Think of
// it like the site has a built-in database constructed
// from the fetched data that you can run queries against.
// ==== PAGES (WORDPRESS NATIVE) ====
graphql(
`
{
allWordpressPage {
edges {
node {
id
slug
status
template
}
}
}
}
`
)
.then(result => {
if (result.errors) {
console.log(result.errors)
reject(result.errors)
}
// Create Page pages.
const pageTemplate = path.resolve(`./src/templates/page.js`)
// We want to create a detailed page for each
// page node. We'll just use the Wordpress Slug for the slug.
// The Page ID is prefixed with 'PAGE_'
_.each(result.data.allWordpressPage.edges, edge => {
// Gatsby uses Redux to manage its internal state.
// Plugins and sites can use functions like "createPage"
// to interact with Gatsby.
createPage({
// Each page is required to have a `path` as well
// as a template component. The `context` is
// optional but is often necessary so the template
// can query data specific to each page.
path: `/${edge.node.slug}/`,
component: slash(pageTemplate),
context: {
id: edge.node.id,
},
})
if (edge.node.slug.match(/^\/about/)) {
// It's assumed that `landingPage.js` exists in the `/layouts/` directory
page.layout = "about";
// Update the page.
createPage(page);
}
})
})
// ==== END PAGES ====
// ==== POSTS (WORDPRESS NATIVE AND ACF) ====
.then(() => {
graphql(
`
{
allWordpressPost {
edges {
node {
id
slug
status
template
format
featured_media {
localFile {
childImageSharp {
fixed(width: 500, height: 500) {
base64
tracedSVG
aspectRatio
width
height
src
srcSet
srcWebp
srcSetWebp
originalName
}
}
}
}
}
}
}
}
`
).then(result => {
if (result.errors) {
console.log(result.errors)
reject(result.errors)
}
const postTemplate = path.resolve(`./src/templates/post.js`)
// We want to create a detailed page for each
// post node. We'll just use the Wordpress Slug for the slug.
// The Post ID is prefixed with 'POST_'
_.each(result.data.allWordpressPost.edges, edge => {
createPage({
path: edge.node.slug,
component: slash(postTemplate),
context: {
id: edge.node.id,
},
})
})
resolve()
})
})
// ==== END POSTS ====
})
}
gatsby-browser.js
: N/A
gatsby-ssr.js
: N/A
I know you guys can't fix everything, but I would love to hear if there's any insight into this error. I feel like I'm probably not the only one getting this.
Activity