Unexplained ruby version and error handling

wai-accessibility-principles.netlify.app
Deploy preview #34 - full build from empty chache

11:06:25 AM: Build ready to start
11:06:27 AM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
11:06:27 AM: build-image tag: v2.8.2
11:06:27 AM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a
11:06:27 AM: No cache source specified, skip fetching cache
11:06:27 AM: Starting to prepare the repo for build
11:06:27 AM: No cached dependencies found. Cloning fresh repo
11:06:27 AM: git clone https://github.com/w3c/wai-accessibility-principles
11:06:28 AM: Preparing Git Reference pull/34/head
11:06:29 AM: Found netlify.toml. Overriding site configuration
11:06:29 AM: Different publish path detected, going to use the one specified in the toml file: '_site' versus '_site/' in the site
11:06:29 AM: Different build command detected, going to use the one specified in the toml file: 'bundle exec jekyll build --config '_config.yml,_config_staging.yml'' versus 'bundle exec jekyll build --config "_config.yml,_config_staging.yml"' in the site
11:06:29 AM: Starting build script
11:06:29 AM: Installing dependencies
11:06:30 AM: Downloading and installing node v8.17.0...
11:06:31 AM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz...
11:06:31 AM: 
#################
11:06:31 AM:                                      24.9%
11:06:31 AM: 
#############################################################
11:06:31 AM: ########### 100.0%
11:06:31 AM: Computing checksum with sha256sum
11:06:31 AM: Checksums matched!
11:06:34 AM: Now using node v8.17.0 (npm v6.13.4)
11:06:34 AM: Attempting ruby version 2.3.6, read from environment
11:06:36 AM: Using ruby version 2.3.6
11:06:37 AM: Using PHP version 5.6
11:06:37 AM: Started restoring cached ruby gems
11:06:37 AM: Finished restoring cached ruby gems
11:06:37 AM: Installing gem bundle
11:06:39 AM: Fetching gem metadata from https://rubygems.org/
11:06:39 AM: .
11:06:39 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:40 AM: .
11:06:41 AM: Fetching gem metadata from https://rubygems.org/
11:06:41 AM: .
11:06:41 AM: Resolving dependencies...
11:06:41 AM: Fetching public_suffix 4.0.6
11:06:42 AM: Installing public_suffix 4.0.6
11:06:42 AM: Fetching addressable 2.7.0
11:06:42 AM: Installing addressable 2.7.0
11:06:42 AM: Using bundler 2.0.1
11:06:42 AM: Fetching colorator 1.1.0
11:06:42 AM: Installing colorator 1.1.0
11:06:42 AM: Fetching concurrent-ruby 1.1.7
11:06:42 AM: Installing concurrent-ruby 1.1.7
11:06:42 AM: Fetching eventmachine 1.2.7
11:06:42 AM: Installing eventmachine 1.2.7 with native extensions
11:07:05 AM: Fetching http_parser.rb 0.6.0
11:07:05 AM: Installing http_parser.rb 0.6.0 with native extensions
11:07:06 AM: Fetching em-websocket 0.5.2
11:07:06 AM: Installing em-websocket 0.5.2
11:07:06 AM: Fetching ffi 1.13.1
11:07:06 AM: Installing ffi 1.13.1 with native extensions
11:07:16 AM: Fetching forwardable-extended 2.6.0
11:07:17 AM: Installing forwardable-extended 2.6.0
11:07:17 AM: Fetching i18n 0.9.5
11:07:17 AM: Installing i18n 0.9.5
11:07:17 AM: Fetching rb-fsevent 0.10.4
11:07:17 AM: Installing rb-fsevent 0.10.4
11:07:17 AM: Fetching rb-inotify 0.10.1
11:07:17 AM: Installing rb-inotify 0.10.1
11:07:17 AM: Fetching sass-listen 4.0.0
11:07:17 AM: Installing sass-listen 4.0.0
11:07:17 AM: Fetching sass 3.7.4
11:07:17 AM: Installing sass 3.7.4
11:07:17 AM: Fetching jekyll-sass-converter 1.5.2
11:07:17 AM: Installing jekyll-sass-converter 1.5.2
11:07:17 AM: Fetching listen 3.3.1
11:07:18 AM: Installing listen 3.3.1
11:07:18 AM: Fetching jekyll-watch 2.2.1
11:07:18 AM: Installing jekyll-watch 2.2.1
11:07:18 AM: Fetching rexml 3.2.4
11:07:18 AM: Installing rexml 3.2.4
11:07:18 AM: Fetching kramdown 2.3.0
11:07:18 AM: Installing kramdown 2.3.0
11:07:18 AM: Fetching liquid 4.0.3
11:07:18 AM: Installing liquid 4.0.3
11:07:18 AM: Fetching mercenary 0.3.6
11:07:18 AM: Installing mercenary 0.3.6
11:07:18 AM: Fetching pathutil 0.16.2
11:07:19 AM: Installing pathutil 0.16.2
11:07:19 AM: Fetching rouge 3.25.0
11:07:19 AM: Installing rouge 3.25.0
11:07:19 AM: Fetching safe_yaml 1.0.5
11:07:19 AM: Installing safe_yaml 1.0.5
11:07:19 AM: Fetching jekyll 3.9.0
11:07:19 AM: Installing jekyll 3.9.0
11:07:20 AM: Fetching jekyll-include-cache 0.2.1
11:07:20 AM: Installing jekyll-include-cache 0.2.1
11:07:20 AM: Fetching jekyll-redirect-from 0.15.0
11:07:20 AM: Installing jekyll-redirect-from 0.15.0
11:07:20 AM: Fetching jekyll-relative-links 0.6.1
11:07:20 AM: Installing jekyll-relative-links 0.6.1
11:07:20 AM: Fetching rubyzip 1.3.0
11:07:20 AM: Installing rubyzip 1.3.0
11:07:20 AM: Fetching jekyll-remote-theme 0.4.2
11:07:20 AM: Installing jekyll-remote-theme 0.4.2
11:07:20 AM: Fetching jekyll-seo-tag 2.6.1
11:07:20 AM: Installing jekyll-seo-tag 2.6.1
11:07:20 AM: Fetching jekyll-sitemap 1.4.0
11:07:21 AM: Installing jekyll-sitemap 1.4.0
11:07:21 AM: Fetching kramdown-parser-gfm 1.1.0
11:07:21 AM: Installing kramdown-parser-gfm 1.1.0
11:07:21 AM: Fetching wai-website-plugin 0.2
11:07:21 AM: Installing wai-website-plugin 0.2
11:07:21 AM: Bundle complete! 8 Gemfile dependencies, 35 gems now installed.
11:07:21 AM: Bundled gems are installed into `/opt/build/cache/bundle`
11:07:21 AM: Post-install message from sass:
11:07:21 AM: Ruby Sass has reached end-of-life and should no longer be used.
11:07:21 AM: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
11:07:21 AM:   primary implementation: https://sass-lang.com/install
11:07:21 AM: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
11:07:21 AM:   sassc gem: https://github.com/sass/sassc-ruby#readme
11:07:21 AM: * For more details, please refer to the Sass blog:
11:07:21 AM:   https://sass-lang.com/blog/posts/7828841
11:07:21 AM: Gem bundle installed
11:07:21 AM: Started restoring cached go cache
11:07:21 AM: Finished restoring cached go cache
11:07:21 AM: Installing Go version 1.10
11:07:27 AM: unset GOOS;
11:07:27 AM: unset GOARCH;
11:07:27 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
11:07:27 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
11:07:27 AM: go version >&2;
11:07:27 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env"
11:07:27 AM: go version go1.10 linux/amd64
11:07:27 AM: Installing missing commands
11:07:27 AM: Verify run directory
11:07:27 AM: Executing user command: bundle exec jekyll build --config '_config.yml,_config_staging.yml'
11:07:29 AM: Configuration file: _config.yml
11:07:29 AM: Configuration file: _config_staging.yml
11:07:29 AM:             Source: /opt/build/repo
11:07:29 AM:        Destination: /opt/build/repo/_site
11:07:29 AM:  Incremental build: disabled. Enable with --incremental
11:07:29 AM:       Generating...
11:07:29 AM:       Remote Theme: Using theme w3c/wai-website-theme
11:07:29 AM: WARNING: skipped symlink /tmp/jekyll-remote-theme-20201120-1972-t0zk2d/_data/lang.json
11:07:29 AM: WARNING: skipped symlink /tmp/jekyll-remote-theme-20201120-1972-t0zk2d/_data/techniques.yml
11:07:29 AM: WARNING: skipped symlink /tmp/jekyll-remote-theme-20201120-1972-t0zk2d/_data/translations.yml
11:07:29 AM: WARNING: skipped symlink /tmp/jekyll-remote-theme-20201120-1972-t0zk2d/_data/wcag.yml
11:07:32 AM:                     done in 3.161 seconds.
11:07:32 AM:  Auto-regeneration: disabled. Use --watch to enable.
11:07:32 AM: Skipping functions preparation step: no functions directory set
11:07:32 AM: Caching artifacts
11:07:32 AM: Started saving ruby gems
11:07:32 AM: Finished saving ruby gems
11:07:32 AM: Started saving pip cache
11:07:32 AM: Finished saving pip cache
11:07:32 AM: Started saving emacs cask dependencies
11:07:32 AM: Finished saving emacs cask dependencies
11:07:32 AM: Started saving maven dependencies
11:07:32 AM: Finished saving maven dependencies
11:07:32 AM: Started saving boot dependencies
11:07:32 AM: Finished saving boot dependencies
11:07:32 AM: Started saving go dependencies
11:07:34 AM: Finished saving go dependencies
11:07:38 AM: Build script success
11:07:38 AM: Starting to deploy site from '_site'
11:07:38 AM: Creating deploy tree 
11:07:38 AM: Creating deploy upload records
11:07:38 AM: 6 new files to upload
11:07:38 AM: 0 new functions to upload
11:07:39 AM: Starting post processing
11:07:39 AM: Post processing - HTML
11:07:39 AM: Post processing - header rules
11:07:39 AM: Post processing - redirect rules
11:07:39 AM: Post processing done
11:07:40 AM: Site is live ✨
11:08:21 AM: Finished processing build request in 1m54.116944257s

No env vars set

I’ve 2 questions:

  1. why is ruby set to 2.3.6 when I can find nothing specifying it in env vars. Your docs for the image (Ubuntu Trusty 14.04 legacy) say default version is 2.6.2. How can I find out?
11:06:34 AM: Attempting ruby version 2.3.6, read from environment
11:06:36 AM: Using ruby version 2.3.6
  1. When I build locally (both on mac and ubuntu) the build fails like this but deploy build doesn’t. How can I find out why? The file does exist but is a link to the skipped link, but under the project root not tmp.
WARNING: skipped symlink '/tmp/jekyll-remote-theme-20201120-22354-5hojr2/_data/lang.json'.
WARNING: skipped symlink '/tmp/jekyll-remote-theme-20201120-22354-5hojr2/_data/techniques.yml'.
WARNING: skipped symlink '/tmp/jekyll-remote-theme-20201120-22354-5hojr2/_data/translations.yml'.
WARNING: skipped symlink '/tmp/jekyll-remote-theme-20201120-22354-5hojr2/_data/wcag.yml'.
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
Errno::ENOENT: No such file or directory @ rb_sysopen - /home/steve/wai-accessibility-principles/_data/translations.yml
  1. Do you provide a container image we can use for local builds so we get as close as possible to your environment?

Thanks

Hey @slim :wave:t2:

FYI you can set and control the ruby version used in the builds - This link should automatically scroll you down to the “Ruby” section, but tl;dr: you can either set a RUBY_VERSION env var or use a .ruby-version file to specify your version.

As for the failed build locally, I don’t think Netlify offers any pre-made clonable images per se… but what build command are you running? And did you pull down all the dependencies prior to building by running bundle? Similar to how you have to pull down js dependencies prior to running by running yarn or npm install (depending on which package manager you prefer… in this case Ruby only has one, bundle)


Jon

Thanks john, it seems I was not clear.

I can see neither of those options being used, yet the ruby version is less than that documented as the default one.

But I just thought I can try setting it explicitly in case the docs are incorrect :slight_smile:

build command are you running?

see above

And did you pull down all the dependencies prior to building

no as bundle install is run automatically during image initialisation and then the gems are cached (I empty the cache to get a full install).

as an aside I thought it it would be useful to be able to disable the automatic bundle install and caching so we can run bundle install --deployment. That would be slower but more deterministic. In my case though I have not gemfile.lock which that option requires

The point with the error is it happens on local installs but NOT in the deployment build. Or if it does happen it is ignored. I want visibility into why.

Hey @slim

Well I’m not sure what’s causing your particular site to default to an older version of Ruby :confused: but if you need a newer version, you can utilize the env var or file. I checked both build images, the source code for either, and a couple of Jekyll sites I run that don’t specify either a file or env var, but everything points toward running the normal default. Is there an open source repo you could share? I can take a peek through that and see if anything looks awry if you’d like.

Yes, this is what I was getting at - apologies if that wasn’t clear. The Netlify Build images will automatically run bundle install to install dependencies before running your build command, but if you’re not running bundle install locally your build will definitely fail locally. I’m not actually concerned about Netlify’s build because it appears to be in working order :slight_smile: I want to make sure you’re installing dep’s locally


Jon

1 Like

Thanks as always Jon, for going the extra mile

The repo is - https://github.com/w3c/wai-accessibility-principles/pull/34
and the env settings in the control panel is definitely empty.

As for bundle - yes - is installed locally. Else would not have got that far. It looks like the remote theme gem is failing to install something access via a symblink but I’m not yet sure of expected behaviour here.

Is there some option in netlify to force all build errors to fail that could be off by default. Seems a long shot but…

@jonsully It looks like a git submodules issues Locally the submodules are not getting handled but the netlify build does.

I need to explore that - thanks for offering to help

Steve

for any others reading this this might help the build error was due to the repo using git submodules and locally I did not check out using --recursive. I guess netlify does, though it doesn’t log the flags used.

So the only question is why ruby version is so low but I don;t need an answer.