Jekyll build failing today, exact source built successfully yesterday

I have a Jekyll blog. I tried to push out a new page today and the build failed, with a strange error unrelated to my actual blog source:

Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'cache/bundle/ruby/2.6.0/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.

(I don’t know why this file is getting processed: it’s is in a library and part of a generic template, not part of my blog. Based on the error message, it seems to be getting processed by Jekyll without first getting preprocessed by ERB. I also don’t know why that would happen.)

It all builds fine locally. The Ruby version (2.6.3) is the same locally and in the deploy.

I was curious whether this actually had anything to do with my actual source, so I reverted the change back to the last successful deploy. That build failed too. So, the exact source that built successfully yesterday at 11:33am Eastern, is failing today as of 10:26am Eastern.

One difference I notice is that yesterday the build version was @netlify/build 29.5.7, and today it is using 29.5.8. I also notice that it’s installing a lot more dependencies, rather than using cached ones. I’m not sure if either of those are a clue.

Any clues or suggestions? Thank you!


Netlify site name: rootsofprogress (custom domain rootsofprogress.org, Netlify domain rootsofprogress.netlify.app)

Info template requested by this article:

Deploy URL: Netlify App
Deploy ID: 63f4fc66facdad00089cf76d

Context: Production: master@9dd8a92
Deployment Type: git (triggered by push to GitHub)
Last Broken Deploy URL: Netlify App
Last Successful Deploy URL: Netlify App


Full broken build log:

12:16:24 PM: build-image version: c0621868af5001023389eeaa9dbfbbaf313f67e2 (focal)
12:16:24 PM: buildbot version: c0621868af5001023389eeaa9dbfbbaf313f67e2
12:16:24 PM: Fetching cached dependencies
12:16:24 PM: Starting to download cache of 302.7MB
12:16:27 PM: Finished downloading cache in 3.067s
12:16:27 PM: Starting to extract cache
12:16:28 PM: Finished extracting cache in 990ms
12:16:28 PM: Finished fetching cache in 4.105s
12:16:28 PM: Starting to prepare the repo for build
12:16:28 PM: Preparing Git Reference refs/heads/master
12:16:30 PM: Parsing package.json dependencies
12:16:31 PM: Starting to install dependencies
12:16:32 PM: Downloading and installing node v6.17.1...
12:16:32 PM: Downloading https://nodejs.org/dist/v6.17.1/node-v6.17.1-linux-x64.tar.xz...
12:16:32 PM: Computing checksum with sha256sum
12:16:32 PM: Checksums matched!
12:16:33 PM: Now using node v6.17.1 (npm v3.10.10)
12:16:33 PM: Started restoring cached build plugins
12:16:33 PM: Finished restoring cached build plugins
12:16:34 PM: Python version set to 3.8
12:16:34 PM: Required ruby-2.6.3 is not installed.
12:16:34 PM: To install do: 'rvm install "ruby-2.6.3"'
12:16:34 PM: Attempting Ruby version 2.6.3, read from .ruby-version file
12:16:34 PM: Required ruby-2.6.3 is not installed - installing.
12:16:34 PM: Searching for binary rubies, this might take some time.
12:16:35 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.3.tar.bz2
12:16:35 PM: Checking requirements for ubuntu.
12:16:35 PM: Requirements installation successful.
12:16:35 PM: ruby-2.6.3 - #configure
12:16:35 PM: ruby-2.6.3 - #download
12:16:35 PM: ruby-2.6.3 - #validate archive
12:16:39 PM: ruby-2.6.3 - #extract
12:16:40 PM: ruby-2.6.3 - #validate binary
12:16:41 PM: ruby-2.6.3 - #setup
12:16:41 PM: ruby-2.6.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.3@global
12:16:41 PM: ruby-2.6.3 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
12:16:41 PM: ruby-2.6.3 - #generating global wrappers........
12:16:41 PM: ruby-2.6.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.3
12:16:41 PM: ruby-2.6.3 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
12:16:42 PM: ruby-2.6.3 - #generating default wrappers........
12:16:42 PM: Using /opt/buildhome/.rvm/gems/ruby-2.6.3
12:16:42 PM: Using Ruby version 2.6.3
12:16:42 PM: Using Bundler version 1.17.2 from Gemfile.lock
12:16:43 PM: Successfully installed bundler-1.17.2
12:16:43 PM: 1 gem installed
12:16:43 PM: Started restoring cached ruby gems
12:16:43 PM: Finished restoring cached ruby gems
12:16:43 PM: Installing gem bundle
12:16:43 PM: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
12:16:45 PM: Fetching gem metadata from https://rubygems.org/.........
12:16:45 PM: Fetching public_suffix 3.0.3
12:16:45 PM: Installing public_suffix 3.0.3
12:16:45 PM: Fetching addressable 2.5.2
12:16:45 PM: Installing addressable 2.5.2
12:16:45 PM: Fetching latex-decode 0.3.1
12:16:45 PM: Installing latex-decode 0.3.1
12:16:45 PM: Fetching bibtex-ruby 4.4.7
12:16:45 PM: Installing bibtex-ruby 4.4.7
12:16:45 PM: Using bundler 1.17.2
12:16:45 PM: Fetching namae 1.0.1
12:16:45 PM: Installing namae 1.0.1
12:16:45 PM: Fetching citeproc 1.0.10
12:16:45 PM: Installing citeproc 1.0.10
12:16:45 PM: Fetching csl 1.5.1
12:16:45 PM: Installing csl 1.5.1
12:16:45 PM: Fetching citeproc-ruby 1.1.12
12:16:45 PM: Installing citeproc-ruby 1.1.12
12:16:46 PM: Fetching colorator 1.1.0
12:16:46 PM: Installing colorator 1.1.0
12:16:46 PM: Fetching concurrent-ruby 1.1.3
12:16:46 PM: Installing concurrent-ruby 1.1.3
12:16:46 PM: Fetching csl-styles 1.0.1.10
12:16:46 PM: Installing csl-styles 1.0.1.10
12:16:49 PM: Fetching eventmachine 1.2.7
12:16:49 PM: Installing eventmachine 1.2.7 with native extensions
12:17:02 PM: Fetching http_parser.rb 0.6.0
12:17:02 PM: Installing http_parser.rb 0.6.0 with native extensions
12:17:03 PM: Fetching em-websocket 0.5.1
12:17:03 PM: Installing em-websocket 0.5.1
12:17:04 PM: Fetching ffi 1.9.25
12:17:04 PM: Installing ffi 1.9.25 with native extensions
12:17:11 PM: Fetching forwardable-extended 2.6.0
12:17:11 PM: Installing forwardable-extended 2.6.0
12:17:11 PM: Fetching i18n 0.9.5
12:17:11 PM: Installing i18n 0.9.5
12:17:11 PM: Fetching rb-fsevent 0.10.3
12:17:11 PM: Installing rb-fsevent 0.10.3
12:17:11 PM: Fetching rb-inotify 0.9.10
12:17:11 PM: Installing rb-inotify 0.9.10
12:17:11 PM: Fetching sass-listen 4.0.0
12:17:11 PM: Installing sass-listen 4.0.0
12:17:11 PM: Fetching sass 3.7.2
12:17:11 PM: Installing sass 3.7.2
12:17:11 PM: Fetching jekyll-sass-converter 1.5.2
12:17:11 PM: Installing jekyll-sass-converter 1.5.2
12:17:11 PM: Fetching ruby_dep 1.5.0
12:17:11 PM: Installing ruby_dep 1.5.0
12:17:12 PM: Fetching listen 3.1.5
12:17:12 PM: Installing listen 3.1.5
12:17:12 PM: Fetching jekyll-watch 2.1.2
12:17:12 PM: Installing jekyll-watch 2.1.2
12:17:12 PM: Fetching kramdown 1.17.0
12:17:12 PM: Installing kramdown 1.17.0
12:17:12 PM: Fetching liquid 4.0.1
12:17:12 PM: Installing liquid 4.0.1
12:17:12 PM: Fetching mercenary 0.3.6
12:17:12 PM: Installing mercenary 0.3.6
12:17:12 PM: Fetching pathutil 0.16.2
12:17:12 PM: Installing pathutil 0.16.2
12:17:12 PM: Fetching rouge 3.3.0
12:17:12 PM: Installing rouge 3.3.0
12:17:12 PM: Fetching safe_yaml 1.0.4
12:17:12 PM: Installing safe_yaml 1.0.4
12:17:12 PM: Fetching jekyll 3.8.5
12:17:12 PM: Installing jekyll 3.8.5
12:17:12 PM: Fetching jekyll-compose 0.5.0
12:17:12 PM: Installing jekyll-compose 0.5.0
12:17:13 PM: Fetching mini_portile2 2.3.0
12:17:13 PM: Installing mini_portile2 2.3.0
12:17:13 PM: Fetching nokogiri 1.8.5
12:17:13 PM: Installing nokogiri 1.8.5 with native extensions
12:17:42 PM: Fetching jekyll-extlinks 0.0.3
12:17:42 PM: Installing jekyll-extlinks 0.0.3
12:17:42 PM: Fetching jekyll-feed 0.9.1
12:17:42 PM: Installing jekyll-feed 0.9.1
12:17:42 PM: Fetching jekyll-minibundle 2.2.0
12:17:42 PM: Installing jekyll-minibundle 2.2.0
12:17:42 PM: Fetching jekyll-redirect-from 0.12.1
12:17:42 PM: Installing jekyll-redirect-from 0.12.1
12:17:42 PM: Fetching jekyll-scholar 5.16.0
12:17:42 PM: Installing jekyll-scholar 5.16.0
12:17:42 PM: Bundle complete! 9 Gemfile dependencies, 41 gems now installed.
12:17:42 PM: Bundled gems are installed into `./cache/bundle`
12:17:42 PM: Post-install message from sass:
12:17:42 PM: Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
12:17:42 PM: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
12:17:42 PM:   primary implementation: https://sass-lang.com/install
12:17:42 PM: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
12:17:42 PM:   sassc gem: https://github.com/sass/sassc-ruby#readme
12:17:42 PM: * For more details, please refer to the Sass blog:
12:17:42 PM:   http://sass.logdown.com/posts/7081811
12:17:42 PM: Gem bundle installed
12:17:43 PM: Started restoring cached go cache
12:17:43 PM: Finished restoring cached go cache
12:17:43 PM: Installing Go version 1.19.5 (requested 1.19.5)
12:17:48 PM: go version go1.19.5 linux/amd64
12:17:49 PM: Using PHP version 8.0
12:17:49 PM: Install dependencies script success
12:17:49 PM: Starting build script
12:17:49 PM: Using stage install dependencies
12:17:49 PM: Detected 1 framework(s)
12:17:49 PM: "jekyll" at version "unknown"
12:17:49 PM: Section completed: initializing
12:17:51 PM: ​
12:17:51 PM:   Netlify Build                                                 
12:17:51 PM: ────────────────────────────────────────────────────────────────
12:17:51 PM: ​
12:17:51 PM: ❯ Version
12:17:51 PM:   @netlify/build 29.5.8
12:17:51 PM: ​
12:17:51 PM: ❯ Flags
12:17:51 PM:   baseRelDir: false
12:17:51 PM:   buildId: 63f4fc66facdad00089cf76b
12:17:51 PM:   deployId: 63f4fc66facdad00089cf76d
12:17:51 PM: ​
12:17:51 PM: ❯ Current directory
12:17:51 PM:   /opt/build/repo
12:17:51 PM: ​
12:17:51 PM: ❯ Config file
12:17:51 PM:   No config file was defined: using default values.
12:17:51 PM: ​
12:17:51 PM: ❯ Context
12:17:51 PM:   production
12:17:51 PM: ​
12:17:51 PM:   1. Build command from Netlify app                             
12:17:51 PM: ────────────────────────────────────────────────────────────────
12:17:51 PM: ​
12:17:51 PM: $ jekyll build
12:17:51 PM: Configuration file: /opt/build/repo/_config.yml
12:17:51 PM:             Source: /opt/build/repo
12:17:51 PM:        Destination: /opt/build/repo/_site
12:17:51 PM:  Incremental build: disabled. Enable with --incremental
12:17:51 PM:       Generating...
12:17:52 PM:              Error: could not read file /opt/build/repo/cache/bundle/ruby/2.6.0/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'cache/bundle/ruby/2.6.0/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
12:17:52 PM:              ERROR: YOUR SITE COULD NOT BE BUILT:
12:17:52 PM:                     ------------------------------------
12:17:52 PM:                     Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'cache/bundle/ruby/2.6.0/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
12:17:52 PM: ​
12:17:52 PM:   "build.command" failed                                        
12:17:52 PM: ────────────────────────────────────────────────────────────────
12:17:52 PM: ​
12:17:52 PM:   Error message
12:17:52 PM:   Command failed with exit code 1: jekyll build (https://ntl.fyi/exit-code-1)
12:17:52 PM: ​
12:17:52 PM:   Error location
12:17:52 PM:   In Build command from Netlify app:
12:17:52 PM:   jekyll build
12:17:52 PM: ​
12:17:52 PM:   Resolved config
12:17:52 PM:   build:
12:17:53 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:17:52 PM:     command: jekyll build
12:17:52 PM:     commandOrigin: ui
12:17:52 PM:     environment:
12:17:52 PM:       - YARN_FLAGS
12:17:52 PM:     publish: /opt/build/repo/_site
12:17:52 PM:     publishOrigin: ui
12:17:52 PM: Caching artifacts
12:17:52 PM: Started saving ruby gems
12:17:52 PM: Finished saving ruby gems
12:17:52 PM: Started saving build plugins
12:17:52 PM: Finished saving build plugins
12:17:52 PM: Started saving pip cache
12:17:52 PM: Finished saving pip cache
12:17:52 PM: Started saving emacs cask dependencies
12:17:52 PM: Finished saving emacs cask dependencies
12:17:52 PM: Started saving maven dependencies
12:17:52 PM: Finished saving maven dependencies
12:17:52 PM: Started saving boot dependencies
12:17:52 PM: Finished saving boot dependencies
12:17:52 PM: Started saving rust rustup cache
12:17:52 PM: Finished saving rust rustup cache
12:17:52 PM: Started saving go dependencies
12:17:52 PM: Finished saving go dependencies
12:17:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:17:53 PM: Failing build: Failed to build site
12:17:53 PM: Finished processing build request in 1m29.021s
1 Like

I’m still digging into this myself, but can confirm I’m getting exactly the same error as you Jason. . . completely out of the blue today.

I’m using:

  • Jekyll 4.2.2
  • Ruby 3.0.2
1 Like

I think Netlify is having some issues today. I’d recommend to wait a few hours before spending hours debugging when there is most probably nothing wrong on your side of things ;p

2 Likes

I have the same problem with my Hugo based website. Worked yesterday, not today. In my case @netlify/build 29.5.8 was already used yesterday and worked. I did notice that the working deploy had:

8:18:56 PM: Build ready to start
8:18:58 PM: build-image version: 832771656eb8553dfa7e316e93c18138ed69f9b1 (focal)
8:18:58 PM: buildbot version: 832771656eb8553dfa7e316e93c18138ed69f9b1

Python version set to 2.7

and the failing build has:

9:46:15 PM: build-image version: c0621868af5001023389eeaa9dbfbbaf313f67e2 (focal)
9:46:15 PM: buildbot version: c0621868af5001023389eeaa9dbfbbaf313f67e2

Python version set to 3.8
2 Likes

Same problem here, but with command failed with exit code 42: jekyll build (Search results for '"non-zero exit code: 42"' - Netlify Support Forums). Worked fine a few hours ago.

Chiming in, exact same issue here.

  • Jekyll 4.1.1
  • Ruby 2.7.6

I was just hit by the same problem. The thing that I found suspicious was this:

Error: could not read file /opt/build/repo/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb

Specifically, it says repo/cache/bundle, and doesn’t contain vendor like the default excluded paths.

The solution that worked for me was to uncomment the default exclusions in _config.yml and to add the cache/ path:

exclude:
  - Gemfile
  - Gemfile.lock
  - node_modules
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/
  - cache/

I initially added more directories, but after a bit more exploration, adding cache/ seems to be sufficient.

4 Likes

I’ve tried setting the PYTHON_VERSION environment variable to 2.7, but it seems to be ignored on build, so I assume there is a problem at Netlify’s end.

Thanks @threedaymonk.

This worked a charm. I had removed the exludes in an long ago trim of the codebase. Adding them back in as you suggested fixed the issue.

Hey all!

Could you please try building again? This might be related to a bad rollout which has now been reverted.

Apologies for the impact.

4 Likes

Working for me know, thanks!

Yes, I confirm that it now works as it used to, and there’s no need to exclude the cache directory or even to specify a custom exclude list at all.

1 Like

Awesome y’all. Thanks for confirming! (: