I deployed my Ruby app and got the error
Deploy Error: Container Terminated
But I could not find any errors from the logs (below). My questions are:
Here are the actions I have tried to fix this but they did not work:
Before this issue, my app was deployed successfully several times and I did not change any configs
Below are the deploy logs
[2024-05-07 11:12:59] => Booting Puma
[2024-05-07 11:12:59] => Rails 7.0.8.1 application starting in production
[2024-05-07 11:12:59] => Run `bin/rails server --help` for more startup options
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.945654 #1] INFO -- : Sidekiq 7.1.4 connecting to Redis with options {:size=>10, :pool_name=>"internal", :url=>"redis://default:REDACTED@159.203.99.32:6379/10"}
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.955913 #1] INFO -- : SidekiqScheduler is disabled
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.956054 #1] INFO -- : Running in ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.956077 #1] INFO -- : See LICENSE and the LGPL-3.0 for licensing details.
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.956089 #1] INFO -- : Upgrade to Sidekiq Pro for more features and support: https://sidekiq.org
[2024-05-07 11:13:01] D, [2024-05-07T11:13:01.958575 #1] DEBUG -- : Client Middleware:
[2024-05-07 11:13:01] D, [2024-05-07T11:13:01.958811 #1] DEBUG -- : Server Middleware: Sidekiq::Metrics::Middleware
[2024-05-07 11:13:01] D, [2024-05-07T11:13:01.958842 #1] DEBUG -- : Firing startup event
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.965152 #1] INFO -- : Loading Schedule
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.965234 #1] INFO -- : Scheduling import_stocks {"cron"=>"0 0 * * *", "class"=>"FinancialData::ImportStockListWorker", "queue"=>"low", "description"=>"Importing stock list"}
[2024-05-07 11:13:01] I, [2024-05-07T11:13:01.971657 #1] INFO -- : Schedules Loaded
[2024-05-07 11:13:01] D, [2024-05-07T11:13:01.972075 #1] DEBUG -- : {:labels=>#<Set: {}>, :require=>".", :environment=>nil, :concurrency=>5, :timeout=>25, :poll_interval_average=>nil, :average_scheduled_poll_interval=>5, :on_complex_arguments=>:raise, :error_handlers=>[#<Proc:0x00007ec1be81c398 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-7.1.4/lib/sidekiq/config.rb:37 (lambda)>], :death_handlers=>[], :lifecycle_events=>{:startup=>[], :quiet=>[#<Proc:0x00007ec1bdb31430 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-scheduler-5.0.3/lib/sidekiq-scheduler.rb:24>], :shutdown=>[], :heartbeat=>[], :beat=>[#<Proc:0x00007ec1bdb30800 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-7.1.4/lib/sidekiq/metrics/tracking.rb:133>]}, :dead_max_jobs=>10000, :dead_timeout_in_seconds=>15552000, :reloader=>#<Sidekiq::Rails::Reloader @app=XProjectCore::Application>, :backtrace_cleaner=>#<Proc:0x00007ec1bdb30eb8 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-7.1.4/lib/sidekiq/rails.rb:59 (lambda)>, :schedule_manager=>#<SidekiqScheduler::Manager:0x00007ec1bdb16ec8 @scheduler_instance=#<SidekiqScheduler::Scheduler:0x00007ec1bdb168d8 @scheduler_config=#<SidekiqScheduler::Config:0x00007ec1bdb17260 @sidekiq_config=#<Sidekiq::Config:0x00007ec1bf456280 @options={...}, @directory={}, @redis_config={:url=>"redis://default:08cfebeee790aa22fb277decaacb85568c93207d2d15b046e3cefc9cd90374d7@159.203.99.32:6379/10"}, @capsules={"default"=>#<Sidekiq::Capsule:0x00007ec1bdb31688 @name="default", @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @queues=["critical", "default", "mailers", "low"], @weights={"critical"=>0, "default"=>0, "mailers"=>0, "low"=>0}, @concurrency=2, @mode=:strict, @client_chain=#<Sidekiq::Middleware::Chain:0x00007ec1bdb182a0 @config=#<Sidekiq::Capsule:0x00007ec1bdb31688 ...>, @entries=[]>, @server_chain=#<Sidekiq::Middleware::Chain:0x00007ec1bdb17eb8 @config=#<Sidekiq::Capsule:0x00007ec1bdb31688 ...>, @entries=[#<Sidekiq::Middleware::Entry:0x00007ec1bdb308a0 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @klass=Sidekiq::Metrics::Middleware, @args=[#<Sidekiq::Metrics::ExecutionTracker:0x00007ec1bdb30cd8 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @jobs={}, @totals={}, @grams={}, @lock=#<Thread::Mutex:0x00007ec1bdb30b20>>]>]>>}, @logger=#<Sidekiq::Logger:0x00007ec1bdb306e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x00007ec1bdb306c0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x00007ec1bdb30670 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x00007ec1bdb30648>, @mon_data_owner_object_id=35340>>, @server_chain=#<Sidekiq::Middleware::Chain:0x00007ec1bdb30a80 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @entries=[#<Sidekiq::Middleware::Entry:0x00007ec1bdb308a0 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @klass=Sidekiq::Metrics::Middleware, @args=[#<Sidekiq::Metrics::ExecutionTracker:0x00007ec1bdb30cd8 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @jobs={}, @totals={}, @grams={}, @lock=#<Thread::Mutex:0x00007ec1bdb30b20>>]>]>, @redis=#<ConnectionPool:0x00007ec1bdb2b288 @size=10, @timeout=1, @auto_reload_after_fork=true, @available=#<ConnectionPool::TimedStack:0x00007ec1bdb2b0f8 @create_block=#<Proc:0x00007ec1bdb2b210 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-7.1.4/lib/sidekiq/redis_connection.rb:22>, @created=1, @que=[#<Sidekiq::RedisClientAdapter::CompatClient:0x00007ec1bdb2a428 @client=#<RedisClient redis://159.203.99.32:6379/10>, @_pipeline_class=Sidekiq::RedisClientAdapter::CompatClient::Pipeline>], @max=10, @mutex=#<Thread::Mutex:0x00007ec1bdb2b058>, @resource=#<Thread::ConditionVariable:0x00007ec1bdb2afe0>, @shutdown_block=nil>, @key=:"pool-35360", @key_count=:"pool-35360-count">, @client_chain=#<Sidekiq::Middleware::Chain:0x00007ec1bdb18318 @config=#<Sidekiq::Config:0x00007ec1bf456280 ...>, @entries=[]>>, @scheduler_config={:enabled=>true, :dynamic=>false, :dynamic_every=>"5s", :schedule=>{"import_stocks"=>{"cron"=>"0 0 * * *", "class"=>"FinancialData::ImportStockListWorker", "queue"=>"low", "description"=>"Importing stock list"}}, :rufus_scheduler_options=>{}}>, @enabled=true, @dynamic=false, @dynamic_every="5s", @listened_queues_only=nil, @rufus_scheduler_options={}, @scheduled_jobs={"import_stocks"=>#<Rufus::Scheduler::CronJob:0x00007ec1bdb12f30 @scheduler=#<Rufus::Scheduler:0x00007ec1bdb13fc0 @opts={}, @started_at=#<EtOrbi::EoTime:0x00007ec1bdb13750 @seconds=1715080381.9655557, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=nil>, @paused_at=nil, @jobs=#<Rufus::Scheduler::JobArray:0x00007ec1bdb13f20 @mutex=#<Thread::Mutex:0x00007ec1bdb13ea8>, @array=[#<Rufus::Scheduler::CronJob:0x00007ec1bdb12f30 ...>]>, @frequency=0.3, @discard_past=true, @mutexes={}, @work_queue=#<Thread::Queue:0x00007ec1bdb13bb0>, @join_queue=#<Thread::Queue:0x00007ec1bdb13b10>, @max_work_threads=28, @stderr=#<IO:<STDERR>>, @thread_key="rufus_scheduler_35380", @scheduler_lock=#<Rufus::Scheduler::NullLock:0x00007ec1bdb139d0>, @trigger_lock=#<Rufus::Scheduler::NullLock:0x00007ec1bdb13958>, @thread=#<Thread:0x00007ec1bdb13390 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler.rb:634 sleep>>, @original="0 0 * * *", @opts={:job=>true, :tags=>["import_stocks"]}, @handler=#<Proc:0x00007ec1bdb13048 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-scheduler-5.0.3/lib/sidekiq-scheduler/scheduler.rb:258>, @callable=#<Proc:0x00007ec1bdb13048 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-scheduler-5.0.3/lib/sidekiq-scheduler/scheduler.rb:258>, @scheduled_at=#<EtOrbi::EoTime:0x00007ec1bdb12e18 @seconds=1715080381.9664898, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=nil>, @unscheduled_at=nil, @last_time=nil, @discard_past=nil, @locals={}, @local_mutex=#<Thread::Mutex:0x00007ec1bdb12d78>, @id="cron_1715080381.9664898_35400", @name=nil, @tags=["import_stocks"], @count=0, @last_work_time=0.0, @mean_work_time=0.0, @paused_at=nil, @times=nil, @first_at_no_error=false, @first_at=nil, @last_at=nil, @resume_discard_past=nil, @cron_line=#<Fugit::Cron:0x00007ec1bd7fd8b8 @original="0 0 * * *", @cron_s=nil, @day_and=nil, @seconds=[0], @minutes=[0], @hours=[0], @monthdays=nil, @months=nil, @weekdays=nil, @zone=nil, @timezone=nil>, @next_time=#<EtOrbi::EoTime:0x00007ec1bd7f61a8 @seconds=1715126400.0, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=2024-05-08 00:00:00 +0000>>}, @rufus_scheduler=#<Rufus::Scheduler:0x00007ec1bdb13fc0 @opts={}, @started_at=#<EtOrbi::EoTime:0x00007ec1bdb13750 @seconds=1715080381.9655557, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=nil>, @paused_at=nil, @jobs=#<Rufus::Scheduler::JobArray:0x00007ec1bdb13f20 @mutex=#<Thread::Mutex:0x00007ec1bdb13ea8>, @array=[#<Rufus::Scheduler::CronJob:0x00007ec1bdb12f30 @scheduler=#<Rufus::Scheduler:0x00007ec1bdb13fc0 ...>, @original="0 0 * * *", @opts={:job=>true, :tags=>["import_stocks"]}, @handler=#<Proc:0x00007ec1bdb13048 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-scheduler-5.0.3/lib/sidekiq-scheduler/scheduler.rb:258>, @callable=#<Proc:0x00007ec1bdb13048 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-scheduler-5.0.3/lib/sidekiq-scheduler/scheduler.rb:258>, @scheduled_at=#<EtOrbi::EoTime:0x00007ec1bdb12e18 @seconds=1715080381.9664898, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=nil>, @unscheduled_at=nil, @last_time=nil, @discard_past=nil, @locals={}, @local_mutex=#<Thread::Mutex:0x00007ec1bdb12d78>, @id="cron_1715080381.9664898_35400", @name=nil, @tags=["import_stocks"], @count=0, @last_work_time=0.0, @mean_work_time=0.0, @paused_at=nil, @times=nil, @first_at_no_error=false, @first_at=nil, @last_at=nil, @resume_discard_past=nil, @cron_line=#<Fugit::Cron:0x00007ec1bd7fd8b8 @original="0 0 * * *", @cron_s=nil, @day_and=nil, @seconds=[0], @minutes=[0], @hours=[0], @monthdays=nil, @months=nil, @weekdays=nil, @zone=nil, @timezone=nil>, @next_time=#<EtOrbi::EoTime:0x00007ec1bd7f61a8 @seconds=1715126400.0, @zone=#<TZInfo::DataTimezone: Etc/UTC>, @time=2024-05-08 00:00:00 +0000>>]>, @frequency=0.3, @discard_past=true, @mutexes={}, @work_queue=#<Thread::Queue:0x00007ec1bdb13bb0>, @join_queue=#<Thread::Queue:0x00007ec1bdb13b10>, @max_work_threads=28, @stderr=#<IO:<STDERR>>, @thread_key="rufus_scheduler_35380", @scheduler_lock=#<Rufus::Scheduler::NullLock:0x00007ec1bdb139d0>, @trigger_lock=#<Rufus::Scheduler::NullLock:0x00007ec1bdb13958>, @thread=#<Thread:0x00007ec1bdb13390 /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler.rb:634 sleep>>>>}
[2024-05-07 11:13:02] I, [2024-05-07T11:13:01.979786 #1] INFO -- : Sidekiq 7.1.4 connecting to Redis with options {:size=>2, :pool_name=>"default", :url=>"redis://default:REDACTED@159.203.99.32:6379/10"}
[2024-05-07 11:13:02] D, [2024-05-07T11:13:01.985799 #1] DEBUG -- : Firing heartbeat event
[2024-05-07 11:13:02] I, [2024-05-07T11:13:02.176670 #1] INFO -- : Sidekiq running embedded, total process thread count: 7
[2024-05-07 11:13:02] D, [2024-05-07T11:13:02.176758 #1] DEBUG -- : [nil, nil, nil, "sidekiq.heartbeat", "sidekiq.scheduler", "sidekiq.default/processor", "sidekiq.default/processor"]
[2024-05-07 11:13:02] [1] Puma starting in cluster mode...
[2024-05-07 11:13:02] [1] * Puma version: 5.6.8 (ruby 3.1.2-p20) ("Birdie's Version")
[2024-05-07 11:13:02] [1] * Min threads: 5
[2024-05-07 11:13:02] [1] * Max threads: 5
[2024-05-07 11:13:02] [1] * Environment: production
[2024-05-07 11:13:02] [1] * Master PID: 1
[2024-05-07 11:13:02] [1] * Workers: 28
[2024-05-07 11:13:02] [1] * Restarts: (✔) hot (✖) phased
[2024-05-07 11:13:02] [1] * Preloading application
[2024-05-07 11:13:02] [1] * Listening on http://0.0.0.0:8080
[2024-05-07 11:13:02] [1] Use Ctrl-C to stop
[]
;
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Just got a response and it fixed the issue – the WEB_CONCURRENCY environment variable must be set at the app level. I set mine to 3 (best practice seems to be between 2 and 4, but it depends on your setup) and the app deployed successfully.
With the help from the DO team I got this solved. In my case it was that it was spinning 28 workers by default :/ I added WEB_CONCURRENCY environment variable and I set the value to 2. It’s deplying correctly now.
I’m at least glad to hear it’s not just me. I submitted a ticket 3 days ago and they’re looking into it, because it’s been working for months, and suddenly it’s just failing, so clearly it’s something Digital Ocean changed on their end.