Failing to deploy Rails app, struggling to understand Rails logs

57 Views Asked by At

I have an app that works great in local and on Heroku

I am trying to deploy my Rails app to fly.io that uses docker, but it fails

I managed to get the logs, but it's had to understand which part is failing:

2022-11-23T08:29:51Z app[34fbf58e] cdg [info]bin/rails server
2022-11-23T08:29:52Z app[34fbf58e] cdg [info]=> Booting Puma
2022-11-23T08:29:52Z app[34fbf58e] cdg [info]=> Rails 6.1.5 application starting in production
2022-11-23T08:29:52Z app[34fbf58e] cdg [info]=> Run `bin/rails server --help` for more startup options
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]Exiting
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]/app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/delivery_methods.rb:42:in `<module:ClassMethods>': uninitialized constant Mail::TestMailer (NameError)
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]      delegate :deliveries, :deliveries=, to: Mail::TestMailer
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]action_mailer/delivery_methods.rb:40:in `<module:DeliveryMetho
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/delivery_methods.rb:40:in `<module:DeliveryMetho
s>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/delivery_methods.rb:8:in `<module:ActionMailer>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/delivery_methods.rb:5:in `<top (required)>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/base.rb:438:in `<class:Base>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/base.rb:437:in `<module:ActionMailer>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.5/lib/action_mailer/base.rb:12:in `<top (required)>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/app/mailers/application_mailer.rb:1:in `<top (required)>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `instance_exec'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `run'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:61:in `block in run_initializers'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:347:in `each'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:347:in `call'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:60:in `run_initializers'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application.rb:391:in `initialize!'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/config/environment.rb:5:in `<top (required)>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from config.ru:3:in `require_relative'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from config.ru:3:in `block in <main>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:312:in `block in start'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:379:in `handle_profiling'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/server.rb:311:in `start'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/commands/server/server_command.rb:39:in `start'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/commands/server/server_command.rb:144:in `block in perform'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from <internal:kernel>:90:in `tap'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/commands/server/server_command.rb:135:in `perform'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/command/base.rb:69:in `perform'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/command.rb:48:in `invoke'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/commands.rb:18:in `<top (required)>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from bin/rails:6:in `require'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]   from bin/rails:6:in `<main>'
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]rails aborted!
2022-11-23T08:29:53Z app[34fbf58e] cdg [info]Command failed with status (1): [bin/rails server...]

I am not sure if the error comes from from bin/rails:6, but I got this in the file

#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative "../config/boot"
require "rails/commands"

I thought that it might be bootsnap and I disabled it in production, but it didn't change the error

0

There are 0 best solutions below