Trouble deploying Rails 7.1 app - Docker issue on RUN gem update

I have an almost fresh Ruby on Rails 7.1 app that I want to deploy on Fly.

I’m using the default Dockerfile from https://github.com/fly-apps/dockerfile-rails/, set up with rails g dockerfile (also tried rails g dockerfile --fullstaq --jemalloc)

After running fly deploy (also with --local-only) the script hangs on

=> ERROR [base 3/3] RUN gem update --system --no-document && gem install -N bundler` when it breaks after 18.

throwing

Error: failed to fetch an image or build from source: error building: failed to solve: process “/bin/bash -o pipefail -c gem update --system --no-document && gem install -N bundler” did not complete successfully: exit code: 134

I need help with debugging! :pray:t4:

It looks like you are hitting several different problems. The problem shown in the screenshot is the one hardest to address (qemu segv on aarch64), so lets put that one aside for now.

What happens if you build without --local-only and without fullstaq?

1 Like

Removing fullstaq seems has resolved this issue!

However fly deploy crashes after --> Pushing image done. Likely due to my SQLite/litestack setup which I’m trying to resolve now…

Check its logs: here's the last lines below, or run 'fly logs -i e82dd02a069258':
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:149:in `with_argv'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:69:in `invoke'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands.rb:18:in `<main>'
  /rails/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  Tasks: TOP => db:prepare => db:load_config => environment
  (See full trace by running task with --trace)
  --- Litejob detected an exit, cleaning up
   --- Exiting with 0 jobs in flight
  Health check on port 3000 has failed. Your app is not responding properly.
   INFO Main child exited normally with code: 1
   INFO Starting clean up.
   INFO Umounting /dev/vdb from /data
   WARN hallpass exited, pid: 314, status: signal: 15 (SIGTERM)
  2023/10/16 14:40:16 listening on [fdaa:3:4cc0:a7b:ed:8c42:e3a2:2]:22 (DNS: [fdaa::3]:53)
  [    4.249448] reboot: Restarting system
  machine did not have a restart policy, defaulting to restart
  [    0.034804] PCI: Fatal: No config space access function found
   INFO Starting init (commit: 15238e9)...
   INFO Mounting /dev/vdb at /data w/ uid: 1000, gid: 1000 and chmod 0755
   INFO Resized /data to 1069547520 bytes
   INFO starting statics vsock server
   INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as rails
   INFO [fly api proxy] listening at /.fly/api
  2023/10/16 14:40:18 listening on [fdaa:3:4cc0:a7b:ed:8c42:e3a2:2]:22 (DNS: [fdaa::3]:53)
  bin/rails aborted!
  ActiveSupport::MessageEncryptor::InvalidMessage:
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/messages/codec.rb:57:in `catch_and_raise'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/message_encryptor.rb:242:in `decrypt_and_verify'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/encrypted_file.rb:109:in `decrypt'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/encrypted_file.rb:72:in `read'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/encrypted_configuration.rb:57:in `read'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/encrypted_configuration.rb:76:in `config'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/encrypted_configuration.rb:95:in `options'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/module/delegation.rb:332:in `method_missing'
  /rails/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.1/lib/active_record/railtie.rb:384:in `block (2 levels) in <class:Railtie>'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:77:in `each'
  /rails/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/application/finisher.rb:93:in `block in <module:Finisher>'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/initializable.rb:32:in `instance_exec'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/initializable.rb:32:in `run'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/initializable.rb:61:in `block in run_initializers'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/initializable.rb:60:in `run_initializers'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/application.rb:423:in `initialize!'
  /rails/config/environment.rb:5:in `<main>'
  /rails/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  /rails/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/application.rb:399:in `require_environment!'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/application.rb:571:in `block in run_tasks_blocks'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
  /rails/vendor/bundle/ruby/3.2.0/gems/sentry-ruby-5.12.0/lib/sentry/rake.rb:24:in `execute'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
  /rails/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:156:in `invoke_rake'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:73:in `block in invoke'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:149:in `with_argv'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/command.rb:69:in `invoke'
  /rails/vendor/bundle/ruby/3.2.0/gems/railties-7.1.1/lib/rails/commands.rb:18:in `<main>'
  /rails/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  Tasks: TOP => db:prepare => db:load_config => environment
  (See full trace by running task with --trace)
  --- Litejob detected an exit, cleaning up
   --- Exiting with 0 jobs in flight
   INFO Main child exited normally with code: 1
   INFO Starting clean up.
   INFO Umounting /dev/vdb from /data
   WARN hallpass exited, pid: 314, status: signal: 15 (SIGTERM)
  2023/10/16 14:40:21 listening on [fdaa:3:4cc0:a7b:ed:8c42:e3a2:2]:22 (DNS: [fdaa::3]:53)

Does this help? Existing Rails Apps · Fly Docs