dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

dawarich-app container restart loop since 0.35.0: bundler cannot find foreman (prometheus exporter enabled)

Open rmi1974 opened this issue 1 month ago • 4 comments

OS & Hardware Debian 13 (Proxmox LXC) with docker compose stack

Version 0.35.0, 0.35.1

Describe the bug

dawarich-app container restart loop.

NOTE: prometheus exporting is enabled

Logs

Snippet of failing docker container startup:

...
    dawarich-app  | 2025-11-10T09:46:22.429961000Z Running seeds...
    dawarich-app  | 2025-11-10T09:46:24.807487000Z [dotenv] Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY
    dawarich-app  | 2025-11-10T09:46:24.807964000Z [dotenv] Loaded .env.development
    dawarich-app  | 2025-11-10T09:46:24.874580000Z E, [2025-11-10T09:46:24.874370 #41] ERROR -- : Prometheus Exporter, failed to send message Connection refused - connect(2) for "0.0.0.0" port 9394
    dawarich-app  | 2025-11-10T09:46:25.275839000Z   ActiveRecord::SchemaMigration Load (5.0ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
    dawarich-app  | 2025-11-10T09:46:25.348208000Z   User Exists? (0.8ms)  SELECT 1 AS one FROM "users" LIMIT $1  [["LIMIT", 1]]
    dawarich-app  | 2025-11-10T09:46:25.372117000Z   Country Exists? (0.9ms)  SELECT 1 AS one FROM "countries" LIMIT $1  [["LIMIT", 1]]
    dawarich-app  | 2025-11-10T09:46:25.562223000Z /var/app/vendor/bundle/ruby/3.4.0/bin/foreman
    dawarich-app  | 2025-11-10T09:46:25.565794000Z Installing foreman...
    dawarich-app  | 2025-11-10T09:46:26.796297000Z Successfully installed foreman-0.90.0
    dawarich-app  | 2025-11-10T09:46:26.796590000Z 1 gem installed
    dawarich-app  | 2025-11-10T09:46:26.805936000Z Starting Foreman with Procfile.prometheus.dev...
    dawarich-app  | 2025-11-10T09:46:27.170072000Z /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:265:in 'block in Gem.replace_bin_path': can't find executable foreman for gem foreman. foreman is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
    dawarich-app  | 2025-11-10T09:46:27.170202000Z  from /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:293:in 'block in Gem.replace_bin_path'
    dawarich-app  | 2025-11-10T09:46:27.170249000Z  from /var/app/vendor/bundle/ruby/3.4.0/bin/foreman:25:in '<main>'
    dawarich-app exited with code 1 (restarting)
    dawarich-app  | 2025-11-10T09:46:27.600218000Z ⚠️ Starting Rails environment: development ⚠️
    dawarich-app  | 2025-11-10T09:46:27.618435000Z Setting up all required databases...
    dawarich-app  | 2025-11-10T09:46:27.618543000Z Attempting to create database dawarich if it doesn't exist...
    dawarich-app  | 2025-11-10T09:46:27.704051000Z Note: Database dawarich may already exist or couldn't be created now
    dawarich-app  | 2025-11-10T09:46:27.704234000Z ⏳ Waiting for database dawarich to be ready...
    dawarich-app  | 2025-11-10T09:46:27.747635000Z ✅ PostgreSQL database dawarich is ready!
    dawarich-app  | 2025-11-10T09:46:27.747884000Z Running migrations for all databases...
    dawarich-app  | 2025-11-10T09:46:27.748167000Z Running primary database migrations...
...
<restarts again>

Additional context

Downgrading to 0.34.2 solves the issue.

Relevant part of startup sequence:

dawarich-app  | 2025-11-10T09:51:35.783073000Z Running seeds...
dawarich-app  | 2025-11-10T09:51:38.350387000Z [dotenv] Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY
dawarich-app  | 2025-11-10T09:51:38.350761000Z [dotenv] Loaded .env.development
dawarich-app  | 2025-11-10T09:51:38.419560000Z E, [2025-11-10T09:51:38.419289 #41] ERROR -- : Prometheus Exporter, failed to send message Connection refused - connect(2) for "0.0.0.0" port 9394
dawarich-app  | 2025-11-10T09:51:38.706533000Z   ActiveRecord::SchemaMigration Load (4.6ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
dawarich-app  | 2025-11-10T09:51:38.827588000Z   User Exists? (0.7ms)  SELECT 1 AS one FROM "users" LIMIT $1  [["LIMIT", 1]]
dawarich-app  | 2025-11-10T09:51:38.853223000Z   Country Exists? (0.9ms)  SELECT 1 AS one FROM "countries" LIMIT $1  [["LIMIT", 1]]
dawarich-app  | 2025-11-10T09:51:39.035933000Z Installing foreman...
dawarich-app  | 2025-11-10T09:51:39.036289000Z /var/app/vendor/bundle/ruby/3.4.0/bin/foreman
dawarich-app  | 2025-11-10T09:51:40.142802000Z Successfully installed foreman-0.90.0
dawarich-app  | 2025-11-10T09:51:40.143121000Z 1 gem installed
dawarich-app  | 2025-11-10T09:51:40.148033000Z Starting Foreman with Procfile.prometheus.dev...
dawarich-app  | 2025-11-10T09:51:40.567408000Z 09:51:40 prometheus_exporter.1 | started with pid 85
dawarich-app  | 2025-11-10T09:51:40.567726000Z 09:51:40 web.1                 | started with pid 86
dawarich-app  | 2025-11-10T09:51:41.872603000Z 09:51:41 prometheus_exporter.1 | I, [2025-11-10T09:51:41.868486 #85]  INFO -- : Starting prometheus exporter on ANY:9394
dawarich-app  | 2025-11-10T09:51:43.061959000Z 09:51:43 web.1                 | => Booting Puma
dawarich-app  | 2025-11-10T09:51:43.062439000Z 09:51:43 web.1                 | => Rails 8.0.3 application starting in development 
dawarich-app  | 2025-11-10T09:51:43.062665000Z 09:51:43 web.1                 | => Run `bin/rails server --help` for more startup options
dawarich-app  | 2025-11-10T09:51:43.207863000Z 09:51:43 web.1                 | [dotenv] Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY
dawarich-app  | 2025-11-10T09:51:43.208488000Z 09:51:43 web.1                 | [dotenv] Loaded .env.development

Regards

rmi1974 avatar Nov 10 '25 10:11 rmi1974

I'm having a similar problem (I don't use prometheus export) - the Dawarich container starts and stops immediately.

Log output is this: /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:265:in 'block in Gem.replace_bin_path': can't find executable foreman for gem foreman. foreman is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) from /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:293:in 'block in Gem.replace_bin_path' from /var/app/vendor/bundle/ruby/3.4.0/bin/foreman:25:in '

' Installing foreman... Successfully installed foreman-0.90.0 1 gem installed Starting Foreman with Procfile.dev...

This problem didn't happen with the previous release (0.34.2).

AlexNathan345 avatar Nov 10 '25 10:11 AlexNathan345

I am having the same issue with the same error log on my installation, I also had to downgrade to version 0.34.2

AndDiSa avatar Nov 11 '25 11:11 AndDiSa

Exactly the same issue here.

Downgrading also solved the issu

wilcochris avatar Nov 13 '25 06:11 wilcochris

Same issue. Downgraded to 0.34.2. It installs foreman but does not find the executable later.

dawarich_app_1      | Note: Database dawarich_prod may already exist or couldn't be created now
dawarich_app_1      | ⏳ Waiting for database dawarich_prod to be ready...
dawarich_app_1      | ✅ PostgreSQL database dawarich_prod is ready!
dawarich_app_1      | Running migrations for all databases...
dawarich_app_1      | Running primary database migrations...
dawarich_app_1      | [dotenv] Loaded .env.development
dawarich_app_1      | Running DATA migrations...      
dawarich_app_1      | [dotenv] Loaded .env.development
dawarich_app_1      | Running seeds...                
dawarich_app_1      | [dotenv] Loaded .env.development
dawarich_app_1      | Installing foreman...                        
dawarich_app_1      | /var/app/vendor/bundle/ruby/3.4.0/bin/foreman
dawarich_app_1      | Successfully installed foreman-0.90.0
dawarich_app_1      | 1 gem installed                      
dawarich_app_1      | Starting Foreman with Procfile.dev...                                                                                                                                                                                                                                                        
dawarich_app_1      | /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:265:in 'block in Gem.replace_bin_path': can't find executable foreman for gem foreman. foreman is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
dawarich_app_1      |   from /usr/local/bundle/gems/bundler-2.5.21/lib/bundler/rubygems_integration.rb:293:in 'block in Gem.replace_bin_path'
dawarich_app_1      |   from /var/app/vendor/bundle/ruby/3.4.0/bin/foreman:25:in '<main>'

tbuchloh avatar Nov 15 '25 09:11 tbuchloh

Should be fixed in 0.36.1

Freika avatar Nov 29 '25 22:11 Freika

Yes, it works. Thank you!

tbuchloh avatar Nov 30 '25 10:11 tbuchloh