Can't bundle install/update a Gem After Publishing to rubygems.pkg.github.com

Hello, I’m having an issue in which we can’t bundle install or update a gem that we’ve published to our GitHub Packages RubyGems repository after a certain version. We’ve successfully published this gem in the past and Packages indicates we have also published our latest version. Rolling back to previous versions works just fine, however newer versions are not installable. I’m receiving two stacktraces that I can’t suss out.

Running bundle install --verbose produces the stacktraces below. In particular I can’t find anything to explain Net::HTTPNotFound: https://<SCRUBBED-USER>@rubygems.pkg.github.com/<SCRUBBED-ORG-NAME>/quick/Marshal.4.8/<SCRUBBED-GEM-NAME>-0.gemspec.rz, as we do not have a version “0” of our gem published.

Ruby version: 2.7.0
bundler version: 2.1.4
gem version: 3.2.2

Stacktrace 1

This one seems to be failing on pulling versions for our org on the GitHub RubyGems server, which it succeeds at for other gem repositories.

HTTP 404 Not Found https://<SCRUBBED USER>:<SCRUBBED TOKEN>@rubygems.pkg.github.com/<SCRUBBED ORG>/versions
Bundler::Fetcher::FallbackError: Net::HTTPNotFound: https://<SCRUBBED USER>@rubygems.pkg.github.com/<SCRUBBED ORG>/versions
/Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/downloader.rb:43:in `fetch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/compact_index.rb:131:in `call'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/compact_index_client/updater.rb:53:in `block in update'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/2.7.0/tmpdir.rb:89:in `mktmpdir'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/compact_index_client/updater.rb:31:in `update'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/compact_index_client.rb:98:in `update'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/compact_index_client.rb:85:in `update_and_parse_checksums!'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/compact_index.rb:75:in `available?'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/compact_index.rb:16:in `call'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/compact_index.rb:16:in `block in compact_index_request'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher.rb:162:in `use_api'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:388:in `block in api_fetchers'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:388:in `select'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:388:in `api_fetchers'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:393:in `block in remote_specs'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/index.rb:11:in `build'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:392:in `remote_specs'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/source/rubygems.rb:88:in `specs'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:273:in `block (2 levels) in index'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:271:in `each'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:271:in `block in index'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/index.rb:11:in `build'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:268:in `index'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:258:in `resolve'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:158:in `resolve_remotely!'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:303:in `resolve_if_needed'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:84:in `block in run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:9:in `open'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:9:in `lock'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:73:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:25:in `install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/install.rb:66:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:256:in `block in install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/settings.rb:124:in `temporary'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:255:in `install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/bin/bundle:23:in `load'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/bin/bundle:23:in `<main>'

Stacktrace 2 (later in the bundle install run)

This one seems to be trying to find a non-existent version of our gem.

Fetching source index from https://rubygems.pkg.github.com/<SCRUBBED ORG>/
Fetching source index from https://rubygems.org/
Resolving dependencies.........HTTP GET https://<SCRUBBED USER>:<SCRUBBED TOKEN>@rubygems.pkg.github.com/<SCRUBBED-ORG-NAME>/quick/Marshal.4.8/<SCRUBBED INTERNAL GEM NAME>-0.gemspec.rz
HTTP 404 Not Found https://<SCRUBBED-USER>:<SCRUBBED TOKEN>@rubygems.pkg.github.com/<SCRUBBED-ORG-NAME>/quick/Marshal.4.8/<SCRUBBED-GEM-NAME>-0.gemspec.rz

Net::HTTPNotFound: https://<SCRUBBED-USER>@rubygems.pkg.github.com/<SCRUBBED-ORG-NAME>/quick/Marshal.4.8/<SCRUBBED-GEM-NAME>-0.gemspec.rz
Bundler::Fetcher::FallbackError: Net::HTTPNotFound: https://<SCRUBBED-USER>@rubygems.pkg.github.com/<SCRUBBED-ORG-NAME>/quick/Marshal.4.8/<SCRUBBED-GEM-NAME>-0.gemspec.rz
/Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher/downloader.rb:43:in `fetch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/fetcher.rb:107:in `fetch_spec'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/remote_specification.rb:98:in `_remote_specification'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/remote_specification.rb:104:in `method_missing'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/remote_specification.rb:76:in `dependencies'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver/spec_group.rb:81:in `block in __dependencies'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver/spec_group.rb:50:in `block in dependencies_for_activated_platforms'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver/spec_group.rb:50:in `map'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver/spec_group.rb:50:in `dependencies_for_activated_platforms'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:101:in `dependencies_for'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:18:in `block in dependencies_for'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:17:in `dependencies_for'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:807:in `block in group_possibilities'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:806:in `reverse_each'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:806:in `group_possibilities'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:778:in `possibilities_for_requirement'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:761:in `push_state_for_requirements'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:698:in `attempt_to_filter_existing_spec'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:673:in `attempt_to_activate'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:254:in `process_topmost_state'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:182:in `resolve'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb:43:in `resolve'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:50:in `start'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:22:in `resolve'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:258:in `resolve'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:158:in `resolve_remotely!'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:303:in `resolve_if_needed'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:84:in `block in run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:9:in `open'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/process_lock.rb:9:in `lock'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:73:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/installer.rb:25:in `install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/install.rb:66:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:256:in `block in install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/settings.rb:124:in `temporary'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:255:in `install'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/bin/bundle:23:in `load'
  /Users/jimkirkbride/.rbenv/versions/2.7.0/bin/bundle:23:in `<main>'

In our Gemfile we have:

source "https://rubygems.pkg.github.com/<SCRUBBED-ORG>" do
  gem '<SCRUBBED-GEM-NAME>', '~> 2.0.0'
  # other gems that are also published to the package repo
end

I’ve researched this as much as can, but so far I haven’t found anything for this specific error. Any assistance would be welcome. I’ll be entirely happy to learn that I’m doing something tremendously stupid/ill-advised.

This has been resolved. The root cause ended up being that we had multiple references to the unversioned (conflicting) gem in question in engines for our Rails app. Bumping the version of the gem in those engines cleared the stacktraces and allowed bundle install to complete successfully.