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

Bundler install appears broken on Ruby 2.2 #496

Closed
2 tasks done
jeremyevans opened this issue Apr 17, 2023 · 16 comments
Closed
2 tasks done

Bundler install appears broken on Ruby 2.2 #496

jeremyevans opened this issue Apr 17, 2023 · 16 comments

Comments

@jeremyevans
Copy link

jeremyevans commented Apr 17, 2023

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

Link to the failed workflow job (must be a public workflow job, so the necessary information is available)

https://github.com/jeremyevans/ruby-refrigerator/actions/runs/4716774683/jobs/8364821711

Any other notes?

This has failed in multiple projects, and appears to be a general issue with Ruby 2.2. Here's another example:
https://github.com/jeremyevans/sequel/actions/runs/4723218962/jobs/8378878032

Installation of bundler works locals:

$ gem22 install bundler -v '~> 1.0'
Fetching: bundler-1.17.3.gem (100%)
Successfully installed bundler-1.17.3
1 gem installed
$ ruby22 -v
ruby 2.2.10p489 (2018-03-28 revision 63023) [x86_64-openbsd]
$ gem22 -v
2.4.5.5

Example output:

Installing Bundler
  Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
  /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
  ERROR:  While executing gem ... (RuntimeError)
      Marshal.load reentered at marshal_load
  Took   0.36 seconds
@andngqbk
Copy link

Ruby 2.3.3 also appears to be affected by the issue.

2023-04-17T17:30:46.0486603Z ##[group]Run ruby/setup-ruby@v1
2023-04-17T17:30:46.0486903Z with:
2023-04-17T17:30:46.0487361Z   ruby-version: 2.3.3
2023-04-17T17:30:46.0487602Z   bundler-cache: true
2023-04-17T17:30:46.0487867Z env:
2023-04-17T17:30:46.0488171Z   QT_SELECT: qt4
2023-04-17T17:30:46.0488437Z ##[endgroup]
2023-04-17T17:30:46.2114536Z ##[group]Modifying PATH
2023-04-17T17:30:46.2118564Z Entries added to PATH to use selected Ruby:
2023-04-17T17:30:46.2130476Z   /opt/hostedtoolcache/Ruby/2.3.3/x64/bin
2023-04-17T17:30:46.2131462Z ##[endgroup]
2023-04-17T17:30:46.2167425Z ##[group]Downloading Ruby
2023-04-17T17:30:46.2169181Z https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.3.3-ubuntu-22.04.tar.gz
2023-04-17T17:30:46.7543496Z Took   0.54 seconds
2023-04-17T17:30:46.7544328Z ##[endgroup]
2023-04-17T17:30:46.7545248Z ##[group]Extracting  Ruby
2023-04-17T17:30:46.7578416Z [command]/usr/bin/tar -xz -C /opt/hostedtoolcache/Ruby/2.3.3 -f /home/runner/work/_temp/87846b30-9063-41ee-9910-30a959cf5edd
2023-04-17T17:30:47.6850393Z Took   0.93 seconds
2023-04-17T17:30:47.6851078Z ##[endgroup]
2023-04-17T17:30:47.6852502Z ##[group]Print Ruby version
2023-04-17T17:30:47.6861747Z [command]/opt/hostedtoolcache/Ruby/2.3.3/x64/bin/ruby --version
2023-04-17T17:30:47.7018200Z ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
2023-04-17T17:30:47.7061744Z Took   0.02 seconds
2023-04-17T17:30:47.7062883Z ##[endgroup]
2023-04-17T17:30:47.7063731Z ##[group]Installing Bundler
2023-04-17T17:30:47.7069881Z Using Bundler 1.17.3 from Gemfile.lock BUNDLED WITH 1.17.3
2023-04-17T17:30:47.7071074Z [command]/opt/hostedtoolcache/Ruby/2.3.3/x64/bin/gem install bundler -v 1.17.3
2023-04-17T17:30:48.0563788Z ERROR:  While executing gem ... (RuntimeError)
2023-04-17T17:30:48.0564473Z     Marshal.load reentered at marshal_load
2023-04-17T17:30:48.0623362Z Took   0.36 seconds
2023-04-17T17:30:48.0624528Z ##[endgroup]
2023-04-17T17:30:48.0654548Z ##[error]The process '/opt/hostedtoolcache/Ruby/2.3.3/x64/bin/gem' failed with exit code 1
2023-04-17T17:30:48.0910002Z Post job cleanup.

@MSP-Greg
Copy link
Collaborator

This is interesting.

  1. I see a workflow run that was fine in ruby-refrigerator just 18 hours ago. Note that both workflows used the same runner image version (20230409.1).
  2. setup-ruby hasn't had any changes since 04-Apr.
  3. I updated the ci.yml file in ruby-refrigerator, using Ubuntu-20.04, and also updating actions/checkout to v3. Ruby 2.2 passed.

Given the above, I have no idea what the issue is...

@philr
Copy link

philr commented Apr 17, 2023

This is possibly related to the deprecation of the RubyGems dependencies API. There's a brownout today (2023-04-17). See https://blog.rubygems.org/2023/02/22/dependency-api-deprecation.html and https://blog.rubygems.org/2023/04/07/dependency-api-deprecation-delayed.html.

Ruby 2.1 has also been encountering issues (see #493).

@hsbt
Copy link
Member

hsbt commented Apr 18, 2023

Is this duplicate of #493 ?

@eregon
Copy link
Member

eregon commented Apr 18, 2023

This is clearly a RubyGems issue, would be best to file it there.

@jeremyevans
Copy link
Author

I filed this because I didn't think it was the same as #493 (for one, it didn't affect Ruby 2.1). However, looking at the comments in #493, it does seem to discuss the Marshal.load reentered at marshal_load issue. I'm fine closing this if maintainers want to track it in #493.

@jeremyevans
Copy link
Author

There's another rubygems.org Dependency API deprecation brownout today (April 24), so the Ruby 2.2 failures have reoccurred (example: https://github.com/jeremyevans/tilt/actions/runs/4782416382/jobs/8501734094). I tried installing bundler manually again on ruby 2.2 on a different system and still didn't have any problems:

$ gem22 install bundler -v '~> 1.0'                
Fetching: bundler-1.17.3.gem (100%)
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 10 seconds
1 gem installed

Maybe this is not the fault of setup-ruby, but I am unable to reproduce the problem outside of it.

@jeremyevans
Copy link
Author

Maybe one possible fix would be to add --ignore-dependencies to the gem install bundler call, at least on Ruby 2.2? bundler doesn't have any dependencies, and maybe this would avoid any potential issues with the rubygems.org Dependency API.

@eregon
Copy link
Member

eregon commented Apr 24, 2023

I tried to repro, but got a segfault instead: https://github.com/eregon/setup-ruby-test/actions/runs/4789939825/jobs/8518407285
I think it's time to drop Ruby 2.2 support to be honest.

I would guess recent compilers miscompile Ruby 2.2 and cause such segfault or wrong behavior (hooray for C undefined behavior).
I have no plans to use hacks/workarounds like using old compilers for setup-ruby.

@eregon
Copy link
Member

eregon commented Apr 24, 2023

@eregon
Copy link
Member

eregon commented Apr 24, 2023

So from the above runs it seems to always work on 20.04, and always fail on 22.04.
So a simple workaround for now is using ubuntu 20.04 for such old Rubies (and when 20.04 is removed there will be no way to get Ruby 2.2 to run on a GitHub-hosted Linux runner probably).

@eregon
Copy link
Member

eregon commented Apr 24, 2023

Even when using --ignore-dependencies it still segfaults on 22.04: https://github.com/eregon/setup-ruby-test/actions/runs/4790042844/jobs/8518648009

@jeremyevans
Copy link
Author

@eregon Thank you very much for testing and that information.

remvee added a commit to remvee/exifr that referenced this issue May 26, 2023
remvee added a commit to remvee/exifr that referenced this issue May 26, 2023
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 14, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 14, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 15, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 16, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
konsolebox added a commit to konsolebox/digest-kangarootwelve-ruby that referenced this issue Jun 18, 2023
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 19, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
urbanautomaton pushed a commit to futurelearn/valid_email that referenced this issue Jun 19, 2023
These builds now all pass for the time being, so since they were in the
original .travis.yml I'm adding them here.

To get ruby 2.2 working with the official setup-ruby action I've had to
pin the runner on ubuntu-20.04 due to a known issue with setup-ruby, 2.2
and ubuntu-latest: ruby/setup-ruby#496
imanel added a commit to imanel/websocket-ruby that referenced this issue Sep 19, 2023
eregon added a commit that referenced this issue Sep 19, 2023
mhgbrown added a commit to mhgbrown/cached_resource that referenced this issue Sep 30, 2023
Maumagnaguagno added a commit to Maumagnaguagno/Spriter that referenced this issue Oct 3, 2023
tjschuck added a commit to bcrypt-ruby/bcrypt-ruby that referenced this issue Nov 17, 2023
gemmaro added a commit to gemmaro/specinfra that referenced this issue Dec 24, 2023
Ruby 2.2.10 cannot be installed on the latest Ubuntu.

Reference: GitHub / ruby / setup-ruby / Bundler install appears broken
on Ruby 2.2 / comment by eregon [1]

Error output:

  Installing Bundler
    Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
    /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
    ERROR:  While executing gem ... (RuntimeError)
        Marshal.load reentered at marshal_load
    Took   0.28 seconds

[1] ruby/setup-ruby#496 (comment)
gemmaro added a commit to gemmaro/specinfra that referenced this issue Dec 24, 2023
Ruby 2.2.10 cannot be installed on the latest Ubuntu but the Ubuntu 20.04.

Reference: GitHub / ruby / setup-ruby / Bundler install appears broken
           on Ruby 2.2 / the summary comment by eregon [1]

Error output:

  Installing Bundler
    Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
    /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
    ERROR:  While executing gem ... (RuntimeError)
        Marshal.load reentered at marshal_load
    Took   0.28 seconds

[1] ruby/setup-ruby#496 (comment)
gemmaro added a commit to gemmaro/specinfra that referenced this issue Dec 24, 2023
Ruby 2.2.10 cannot be installed on the latest Ubuntu but the Ubuntu 20.04.

Reference: GitHub / ruby / setup-ruby / Bundler install appears broken
           on Ruby 2.2 / the summary comment by eregon [1]

Error output:

  Installing Bundler
    Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
    /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
    ERROR:  While executing gem ... (RuntimeError)
        Marshal.load reentered at marshal_load
    Took   0.28 seconds

[1] ruby/setup-ruby#496 (comment)
gemmaro added a commit to gemmaro/specinfra that referenced this issue Dec 24, 2023
Ruby 2.2.10 cannot be installed on the latest Ubuntu but the Ubuntu 20.04.

Reference: GitHub / ruby / setup-ruby / Bundler install appears broken
           on Ruby 2.2 / the summary comment by eregon [1]

Error output:

  Installing Bundler
    Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
    /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
    ERROR:  While executing gem ... (RuntimeError)
        Marshal.load reentered at marshal_load
    Took   0.28 seconds

[1] ruby/setup-ruby#496 (comment)
gemmaro added a commit to gemmaro/specinfra that referenced this issue Dec 24, 2023
Ruby 2.2.10 cannot be installed on the latest Ubuntu but the Ubuntu 20.04.

Reference: GitHub / ruby / setup-ruby / Bundler install appears broken
           on Ruby 2.2 / the summary comment by eregon [1]

Error output:

  Installing Bundler
    Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
    /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
    ERROR:  While executing gem ... (RuntimeError)
        Marshal.load reentered at marshal_load
    Took   0.28 seconds

[1] ruby/setup-ruby#496 (comment)
Maumagnaguagno added a commit to Maumagnaguagno/MindFreak that referenced this issue Dec 26, 2023
Maumagnaguagno added a commit to Maumagnaguagno/Map_generator that referenced this issue Dec 29, 2023
felixbuenemann added a commit to felixbuenemann/xlsxtream that referenced this issue Mar 15, 2024
laserlemon added a commit to laserlemon/rspec-wait that referenced this issue Apr 26, 2024
tagliala added a commit to nesquena/rabl that referenced this issue May 14, 2024
- Test against Ruby 3.3
- Use a string value instead of experimental boolean for improved
  readability
- Test legacy Ruby versions against ubuntu-20.04 to avoid segmentation
  faults and errors related to `Marshal`

Ref: ruby/setup-ruby#496
dentarg added a commit to spinels/rack-ssl-enforcer that referenced this issue Jul 31, 2024
Until we have dropped support for the old Rubies.

See ruby/setup-ruby#496 (comment)
willnet added a commit to willnet/health_check that referenced this issue Aug 1, 2024
nevans added a commit to nevans/eventmachine that referenced this issue Sep 3, 2024
This avoids the following error:
     Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
     /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
     ERROR:  While executing gem ... (RuntimeError)
         Marshal.load reentered at marshal_load

See ruby/setup-ruby#496

This works fine on ubuntu 20.04 and 24.04.
nevans added a commit to nevans/eventmachine that referenced this issue Sep 3, 2024
This avoids the following error:
     Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
     /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
     ERROR:  While executing gem ... (RuntimeError)
         Marshal.load reentered at marshal_load

See ruby/setup-ruby#496

This works fine on ubuntu 20.04 and 24.04.
nevans added a commit to nevans/eventmachine that referenced this issue Sep 3, 2024
This avoids the following error:
     Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
     /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
     ERROR:  While executing gem ... (RuntimeError)
         Marshal.load reentered at marshal_load

See ruby/setup-ruby#496

This works fine on ubuntu 20.04 and 24.04.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants