alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
11.33k stars 11.28k forks source link

Failed to build on Netlify #2788

Closed HenryF23 closed 1 month ago

HenryF23 commented 1 month ago

Have you checked that your issue isn't already filed?

Bug description

Failed to build on Netlify

How to reproduce the bug

  1. Clone the repository.
  2. Set the environment variable RUBY_VERSION to 3.2.2 on Netlify.
  3. Deploy on Netlify.

Error messages and logs

3:30:20 AM: $ bundle exec jekyll build
3:30:21 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:30:21 AM: /opt/build/cache/bundle/ruby/3.2.0/gems/mini_racer-0.15.0/lib/mini_racer.rb:22:in `load': /opt/build/cache/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/mini_racer-0.15.0/mini_racer_extension.so: undefined symbol: __libc_single_threaded (LoadError)
    from /opt/build/cache/bundle/ruby/3.2.0/gems/mini_racer-0.15.0/lib/mini_racer.rb:22:in `<top (required)>'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:60:in `require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:55:in `each'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:55:in `block in require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:44:in `each'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:44:in `require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler.rb:187:in `require'
    from /opt/build/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.4/lib/jekyll/plugin_manager.rb:53:in `require_from_bundler'
    from /opt/build/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.4/exe/jekyll:11:in `<top (required)>'
    from /opt/build/cache/bundle/ruby/3.2.0/bin/jekyll:25:in `load'
    from /opt/build/cache/bundle/ruby/3.2.0/bin/jekyll:25:in `<main>'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `eval'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `<main>'
​
3:30:21 AM: "build.command" failed                                        
3:30:21 AM: ────────────────────────────────────────────────────────────────
3:30:21 AM: ​
3:30:21 AM:   Error message
3:30:21 AM:   Command failed with exit code 1: bundle exec jekyll build (https://ntl.fyi/exit-code-1)
3:30:21 AM: ​
3:30:21 AM:   Error location
3:30:21 AM:   In Build command from Netlify app:
3:30:21 AM:   bundle exec jekyll build
3:30:21 AM: ​
3:30:21 AM:   Resolved config
3:30:21 AM:   build:
3:30:21 AM:     command: bundle exec jekyll build
3:30:21 AM:     commandOrigin: ui
3:30:21 AM:     environment:
3:30:21 AM:       - RUBY_VERSION
3:30:21 AM:     publish: /opt/build/repo/_site
3:30:21 AM:     publishOrigin: ui
3:30:21 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:30:21 AM: Failing build: Failed to build site
3:30:22 AM: Finished processing build request in 1m8.435s

What operating system are you using?

Linux

Where are you seeing the problem on?

Deployed site

More info

I attempted to deploy the latest version of al-folio on Netlify but encountered the following error: error: mini_racer_extension.so: undefined symbol: __libc_single_threaded (LoadError). I have updated the Gemfile.lock using bundle update inside the Docker container. I am unsure if this error is due to Netlify using an older version of the Ubuntu image. Please help, thanks!

Build image on Netlify: Ubuntu Focal 20.04 (default, the only available Ubuntu image on Netlify right now)

Netlify Build Configuration

image

george-gca commented 1 month ago

Take a look at the configuration I used in #2432. See if that works for you.

HenryF23 commented 1 month ago

Thanks for your reply. Unfortunately, I got the same error message even using the configuration in https://github.com/alshedivat/al-folio/issues/2432

Everything works perfectly fine using GitHub pages.

7:59:00 PM: ❯ Current directory
7:59:00 PM:   /opt/build/repo
7:59:00 PM: ​
7:59:00 PM: ❯ Config file
7:59:00 PM:   No config file was defined: using default values.
7:59:00 PM: ​
7:59:00 PM: ❯ Context
7:59:00 PM:   production
7:59:00 PM: ​
7:59:00 PM: Build command from Netlify app                                
7:59:00 PM: ────────────────────────────────────────────────────────────────
7:59:00 PM: ​
7:59:00 PM: $ sed -i "s/^\(baseurl: \).*$/baseurl:/" _config.yml && bundle exec jekyll build
7:59:01 PM: /opt/build/cache/bundle/ruby/3.2.0/gems/mini_racer-0.15.0/lib/mini_racer.rb:22:in `load': /opt/build/cache/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/mini_racer-0.15.0/mini_racer_extension.so: undefined symbol: __libc_single_threaded (LoadError)
    from /opt/build/cache/bundle/ruby/3.2.0/gems/mini_racer-0.15.0/lib/mini_racer.rb:22:in `<top (required)>'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:60:in `require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:55:in `each'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:55:in `block in require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:44:in `each'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler/runtime.rb:44:in `require'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/gems/bundler-2.5.7/lib/bundler.rb:187:in `require'
    from /opt/build/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.4/lib/jekyll/plugin_manager.rb:53:in `require_from_bundler'
    from /opt/build/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.4/exe/jekyll:11:in `<top (required)>'
    from /opt/build/cache/bundle/ruby/3.2.0/bin/jekyll:25:in `load'
    from /opt/build/cache/bundle/ruby/3.2.0/bin/jekyll:25:in `<main>'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `eval'
    from /opt/buildhome/.rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `<main>'
​
7:59:01 PM: "build.command" failed                                        
7:59:01 PM: ────────────────────────────────────────────────────────────────
7:59:01 PM: ​
7:59:01 PM:   Error message
7:59:01 PM:   Command failed with exit code 1: sed -i "s/^\(baseurl: \).*$/baseurl:/" _config.yml && bundle exec jekyll build (https://ntl.fyi/exit-code-1)
7:59:01 PM: ​
7:59:01 PM:   Error location
7:59:01 PM:   In Build command from Netlify app:
7:59:01 PM:   sed -i "s/^\(baseurl: \).*$/baseurl:/" _config.yml && bundle exec jekyll build
7:59:01 PM: ​
7:59:01 PM:   Resolved config
7:59:01 PM:   build:
7:59:01 PM:     command: 'sed -i "s/^\(baseurl: \).*$/baseurl:/" _config.yml && bundle exec jekyll build'
7:59:01 PM:     commandOrigin: ui
7:59:01 PM:     environment:
7:59:01 PM:       - RUBY_VERSION
7:59:01 PM:     publish: /opt/build/repo/_site
7:59:01 PM:     publishOrigin: ui
7:59:02 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
7:59:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:59:02 PM: Failing build: Failed to build site
7:59:02 PM: Finished processing build request in 1m1.697s
george-gca commented 1 month ago

My build settings are these:

image

I also have these environment variables set

image

HenryF23 commented 1 month ago

Hmm, it gives me the same error using the same build settings.

image image

george-gca commented 1 month ago

Just realized that I am in fact having the same issue, also here in #2432.

george-gca commented 1 month ago

Get the latest updates and try it again. I just removed mini_racer in #2791.

HenryF23 commented 1 month ago

Everything works smoothly after removing mini_racer. Thanks!

george-gca commented 1 month ago

Since you recently set your Netlify, would you mind sending a PR adding this to our CUSTOMIZE.md?

HenryF23 commented 1 month ago

I have opened PR #2798 to include steps to deploy al-folio on Netlify in CUSTOMIZE.md.