Mastodon: GemNotFound - active_record_query_trace-1.8

Created on 14 Dec 2020  路  10Comments  路  Source: tootsuite/mastodon

I cannot run docker-compose up -d due to a missing Gem (active_record_query_trace-1.8) in the Gemfile of the project.

Expected behaviour

Docker Image is built correctly

Actual behaviour

/opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/spec_set.rb:86:in `block in materialize': Could not find active_record_query_trace-1.8 in any of the sources (Bundler::GemNotFound)
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/spec_set.rb:80:in `map!'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/spec_set.rb:80:in `materialize'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/definition.rb:175:in `specs'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/definition.rb:245:in `specs_for'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/definition.rb:227:in `requested_specs'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/runtime.rb:91:in `block in definition_method'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/runtime.rb:20:in `setup'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler.rb:149:in `setup'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/setup.rb:20:in `block in <top (required)>'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/ui/shell.rb:136:in `with_level'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/ui/shell.rb:88:in `silence'
    from /opt/ruby/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/lib/bundler/setup.rb:20:in `<top (required)>'
    from /opt/ruby/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
    from /opt/ruby/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
    from /opt/mastodon/config/boot.rb:3:in `<top (required)>'
    from /opt/mastodon/bin/rails:3:in `require_relative'
    from /opt/mastodon/bin/rails:3:in `<main>'

Steps to reproduce the problem

  1. Clone the project
  2. cp .env.production.sample to .env.production
  3. docker-compose up -d
bug

Most helpful comment

This is probably a problem with bundler 2.2.1.
I changed gem install bundler to gem install bundler -v 2.1.4 in the Dockerfile, and the docker build succeeded.

All 10 comments

same problem today with docker on Ubuntu 2020.

You can get the already built image from Docker Hub. Why the gem is missing needs to be investigated separately though

Try setting RAILS_ENV=production first?

But it's in Docker

The same problem occurs in Mastodon v3.2.1.
When I run docker build, it reports that active_record_query_trace-1.7 is not found.

Step 35/43 : USER mastodon
 ---> Running in 2317a40ec2c1
Removing intermediate container 2317a40ec2c1
 ---> 54708a966a3d
Step 36/43 : RUN cd ~ &&    OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile &&     yarn cache clean
 ---> Running in 7a749405bde1
/opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/spec_set.rb:86:in `block in materialize': Could not find active_record_query_trace-1.7 in any of the sources (Bundler::GemNotFound)
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/spec_set.rb:80:in `map!'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/spec_set.rb:80:in `materialize'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/definition.rb:175:in `specs'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/definition.rb:245:in `specs_for'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/definition.rb:227:in `requested_specs'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/runtime.rb:91:in `block in definition_method'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/runtime.rb:20:in `setup'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler.rb:149:in `setup'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/setup.rb:20:in `block in <top (required)>'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/ui/shell.rb:136:in `with_level'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/ui/shell.rb:88:in `silence'
    from /opt/ruby/lib/ruby/gems/2.6.0/gems/bundler-2.2.1/lib/bundler/setup.rb:20:in `<top (required)>'
    from /opt/ruby/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /opt/ruby/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /opt/mastodon/config/boot.rb:3:in `<top (required)>'
    from /opt/mastodon/bin/rails:3:in `require_relative'
    from /opt/mastodon/bin/rails:3:in `<main>'
The command '/bin/sh -c cd ~ &&     OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile &&     yarn cache clean' returned a non-zero code: 1
time="2020-12-15T12:27:08Z" level=fatal msg="exit status 1"

Same error here as well. The error also occurs when I try to compile the mastodon source code from Docker Hub website.

This is probably a problem with bundler 2.2.1.
I changed gem install bundler to gem install bundler -v 2.1.4 in the Dockerfile, and the docker build succeeded.

@orlea Ah, thanks for the hint! :)

@Gargron @ThibG
With the release of bundler 2.2.2, I can now build without having to modify the Dockerfile.
https://github.com/rubygems/rubygems/releases/tag/bundler-v2.2.2
Isn't it possible to specify the version of bundler in Gemfile.lock or something?

Someone also reported that it worked by removing the RAILS_LOG_LEVEL=warn they had in their .env.production, although I don't understand how it could be this way.

@orlea locking the bundler version might possibly be an issue as we target compatibility with multiple Ruby versions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ccoenen picture ccoenen  路  3Comments

thomaskuntzz picture thomaskuntzz  路  3Comments

psychicteeth picture psychicteeth  路  3Comments

flukejones picture flukejones  路  3Comments

lauramichet picture lauramichet  路  3Comments