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

Cannot install gem on debian:unstable #176

Closed
paulvt opened this issue Dec 5, 2023 · 19 comments
Closed

Cannot install gem on debian:unstable #176

paulvt opened this issue Dec 5, 2023 · 19 comments

Comments

@paulvt
Copy link

paulvt commented Dec 5, 2023

When I try to use a project that tries to install the gem via bundle, installation fails:

$ bundle install
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Fetching sass-embedded 1.69.5 (x86_64-linux)

Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

This is probably not an issue with this project itself, but I hope the issue can be raised somewhere somehow. Or maybe a re-upload helps?

@ntkme
Copy link
Member

ntkme commented Dec 5, 2023

This is a known bug in older version of bundler/rubygems. The minimum require version is rubygems >=3.3.22 and bundler >=2.3.22.

Please upgrade rubygems, then delete and recreate Gemfile.lock.

@ntkme ntkme closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2023
@paulvt
Copy link
Author

paulvt commented Dec 11, 2023

Not that I not believe you, but these requirements are met on my system and that URL does give a 403.
Am I missing something? Could you point me to the original issue so I can debug further?

$ ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

$ gem --version
3.4.20

$ bundle --version
Bundler version 2.4.20

$ ls Gemfile.lock
"Gemfile.lock": No such file or directory (os error 2)

$ bundle install
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Fetching sass-embedded 1.69.5 (x86_64-linux)

Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)

Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to underlying error <bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.69.5-x86_64-linux.gem)>

@ntkme
Copy link
Member

ntkme commented Dec 11, 2023

Debian unstable?

@ntkme
Copy link
Member

ntkme commented Dec 11, 2023

What is the output of the following command:

ruby -e 'puts Gem.platforms'

And what is the output of this:

ruby -e 'puts Gem::Platform.new("x86_64-linux-gnu")'

# This command should print "x86_64-linux-gnu", if it prints "x86_64-linux", you have a broken rubygems.

@paulvt
Copy link
Author

paulvt commented Dec 11, 2023

Debian unstable?

Yes!

$ ruby -e 'puts Gem.platforms'
ruby
x86_64-linux

$ ruby -e 'puts Gem::Platform.new("x86_64-linux-gnu")'
x86_64-linux

Ah, so it should actually get the ...x86_64-linux-gnu.gem?

@ntkme
Copy link
Member

ntkme commented Dec 11, 2023

@ntkme
Copy link
Member

ntkme commented Dec 11, 2023

Ah, so it should actually get the ...x86_64-linux-gnu.gem?

Yes. Debian unstable's rubygems 3.4.20 is patched by debian maintainers to match 3.3.15's behavior and it is broken. There is nothing I can do. You should report this via https://www.debian.org/Bugs/Reporting.

@ntkme ntkme changed the title Cannot install gem because of HTTP 403 Forbidden Cannot install gem on debian:unstable Dec 11, 2023
@paulvt
Copy link
Author

paulvt commented Dec 11, 2023

I see. This seems to be done to not break all existing built/packaged native extensions with rubygems 3.3 (that stripped the -gnu suffix). This is going to be fixed when Ruby 3.2 enters Debian soon anyway. Thanks for the info!

@felipecsl
Copy link

Still cannot install sass-embedded, failing also on my github action:

Run ruby/setup-ruby@v1
Modifying PATH
Downloading Ruby
Extracting  Ruby
Print Ruby version
Installing Bundler
  Using Bundler 2.5.5 from Gemfile.lock BUNDLED WITH 2.5.5
  /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/gem install bundler -v 2.5.5
  Successfully installed bundler-2.5.5
  1 gem installed
  Took   0.66 seconds
> bundle install
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local path /home/runner/work/lima.gl/lima.gl/vendor/bundle
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local deployment true
Cache key: setup-ruby-bundler-cache-v6-ubuntu-22.04-x64-ruby-3.2.2-wd-/home/runner/work/lima.gl/lima.gl-with--without--only--Gemfile.lock-330d2878ed272db[9](https://github.com/felipecsl/lima.gl/actions/runs/7584678335/job/20658884832?pr=883#step:6:10)dc133f2b439ef3b[23](https://github.com/felipecsl/lima.gl/actions/runs/7584678335/job/20658884832?pr=883#step:6:28)4387[28](https://github.com/felipecsl/lima.gl/actions/runs/7584678335/job/20658884832?pr=883#step:6:34)e0aafeb105e9dac61dd5c1477
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle install --jobs 4
Fetching gem metadata from https://rubygems.org/.........
Your bundle is locked to sass-embedded (1.70.0) from rubygems repository
https://rubygems.org/ or installed locally, but that version can no longer be
found in that source. That means the author of sass-embedded (1.70.0) has
removed it. You'll need to update your bundle to a version other than
sass-embedded (1.70.0) that hasn't been removed in order to install.
Error: The process '/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle' failed with exit code 7

@ntkme
Copy link
Member

ntkme commented Jan 19, 2024

@felipecsl You issue looks like a different one. It seems that you have the 1.70.0 platform ruby locked, which is clearly available on rubygems: https://rubygems.org/gems/sass-embedded/versions/1.70.0

I cannot reproduce it, so it might be a temporary glitch on one of rubygems' CDN mirror.

@suppadeliux
Copy link

suppadeliux commented Jan 23, 2024

I have the same 403 forbidden error in my fedora container with ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] and the latest update of this gem sass-embedded 1.70.0 (x86_64-linux) (was 1.59.3)

17:55:49 Fetching pathutil 0.16.2
17:55:49 Installing pathutil 0.16.2
17:55:49 Fetching sass-embedded 1.70.0 (x86_64-linux) (was 1.59.3)
17:55:49 
17:55:49 Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.70.0-x86_64-linux.gem)
17:55:49 
17:55:49 Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.70.0-x86_64-linux.gem)
17:55:49 Fetching kramdown 2.4.0
17:55:49 
17:55:49 Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/sass-embedded-1.70.0-x86_64-linux.gem)
17:55:49 Installing kramdown 2.4.0

All i can see is that there is no such sass-embedded-1.70.0-x86_64-linux.gem in the list of downloads

@ntkme
Copy link
Member

ntkme commented Jan 23, 2024

@suppadeliux It should never install -linux as there are only -linux-gnu and -linux-musl. If your rubygems is attempting to install -linux that means you have either a broken rubygems/bundler, or a Gemfile.lock previously created by a broken rubygems/bundler. Please try upgrade rubygems, remove Gemfile.lock, and then try again.

@suppadeliux
Copy link

@ntkme Thank you for the tips!
I was able to fix the problem, by updating gem with gem update --system and regenerating my Gem.lock.
Now my Gem lock looks like this, i'm not sure if that's good or bad, but at least it"s working

    safe_yaml (1.0.5)
    sass-embedded (1.70.0-aarch64-linux-gnu)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-aarch64-linux-musl)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-arm-linux-gnueabihf)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-arm-linux-musleabihf)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-arm64-darwin)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-x86-linux-gnu)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-x86-linux-musl)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-x86_64-darwin)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-x86_64-linux-gnu)
      google-protobuf (~> 3.25)
    sass-embedded (1.70.0-x86_64-linux-musl)
      google-protobuf (~> 3.25)
    terminal-table (3.0.2)
      unicode-display_width (>=

@shawnyeager
Copy link

shawnyeager commented Jan 25, 2024

I'm running into the same problem with sass-embedded. I'm able to build my project locally on my M2 Mac, but I see the 403 errors when attempting to build on Netlify in an Ubuntu 20 LTS container. This only started after running bundle update earlier this week. I assume there's been a gem update over the last week.

Delete my Gemfile.lock, running gem update --system and regenerating my .lock file does not resolve the problem. Still seeing the failures on Netlify.

@suppadeliux
Copy link

@shawnyeager Since ruby installs also the latest version of rubygems, have you tried to instead, update ruby, to the latest version?

@ntkme
Copy link
Member

ntkme commented Jan 25, 2024

I'm running into the same problem with sass-embedded. I'm able to build my project locally on my M2 Mac, but I see the 403 errors when attempting to build on Netlify in an Ubuntu 20 LTS container. This only started after running bundle update earlier this week. I assume there's been a gem update over the last week.

Likely means that the netlify Ubuntu container has an old version of rubygems. I'm not sure if you can upgrade that. Alternatively if you can upgrade to use a ruby 3.2 or 3.3 container, the default rubygems version from ruby >=3.2 should always be good.

@shawnyeager
Copy link

@suppadeliux Changing .ruby-version to 3.2.3 fixed the build failures on Netlify. Thanks. 🙏🏼

@lsilvam
Copy link

lsilvam commented Feb 24, 2024

where did you edit this .ruby-version to 3.2.3?

@lsilvam
Copy link

lsilvam commented Feb 24, 2024

where did you edit this .ruby-version to 3.2.3?

found it. also works for 3.3.0; with this version was able to deploy on netlify

mattxwang added a commit to just-the-docs/just-the-docs-template that referenced this issue Apr 17, 2024
…45)

* Bump just-the-docs from 0.8.1 to 0.8.2

Bumps [just-the-docs](https://github.com/just-the-docs/just-the-docs) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/just-the-docs/just-the-docs/releases)
- [Changelog](https://github.com/just-the-docs/just-the-docs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/just-the-docs/just-the-docs/commits)

---
updated-dependencies:
- dependency-name: just-the-docs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run `bundle update`

Not sure what's going on with `sass-embedded` here...

* Regenerate `Gemfile.lock` on a "clean" linux box

This was an absolute pain to figure out

* Prune platform list

* Regen `Gemfile.lock` with updated RubyGems; modifies Netlify env var to use 3.3.0

See: sass-contrib/sass-embedded-host-ruby#176
sass-contrib/sass-embedded-host-ruby#187

* Attempt at manually trimming platform constraints

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Matt Wang <mxw@cs.washington.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants