Bug #19070
closed"Could not locate Gemfile (Bundler::GemfileNotFound)" starting standalone Foreman service
Description
It seems that a package-based installation (following 3.3.1 in the installation docs) do not currently work in either 1.13 or 1.14. As far as I can tell, using foreman-installer still works, but in our environment we cannot use the installer-based approach.
I am able to reproduce this on a new CentOS 7 AWS AMI or local CentOS install from media by doing the following on a fresh install:
sudo yum install -y http://yum.theforeman.org/releases/1.14/el7/x86_64/foreman-release.rpm
sudo yum install -y foreman-release-scl epel-release
sudo yum install -y foreman foreman-proxy foreman-debug foreman-cli foreman-sqlite
sudo -u foreman /usr/share/foreman/extras/dbmigrate
sudo systemctl start foreman
Foreman logs the following to syslog:
Starting foreman: /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler/shared_helpers.rb:26:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler/shared_helpers.rb:31:in `default_lockfile'
from /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler.rb:253:in `default_lockfile'
from /usr/share/foreman/bin/spring:10:in `<top (required)>'
from /usr/share/foreman/bin/rails:3:in `load'
from /usr/share/foreman/bin/rails:3:in `<main>'
Attempting to start foreman manually by invoking the rails server (using tfm-ruby) throws the same error.
As far as I can tell, I can't reproduce this behavior for installations using foreman-installer. This seems to only happen to package-based installs, and only on versions 1.13 and 1.14.
Updated by Dominic Cleal almost 8 years ago
- Subject changed from CentOS 7 packaged installs in foreman-release 1.13 and 1.14 cause foreman not to start to "Could not locate Gemfile (Bundler::GemfileNotFound)" starting standalone Foreman service
- Category set to RPMs
Updated by Sandro Emma almost 8 years ago
- Priority changed from Normal to Urgent
- Translation missing: en.field_release set to 209
- Difficulty set to medium
Same error in foreman-1.15.0-0.1.RC1.el7.noarch on Centos7
Updated by Dominic Cleal almost 8 years ago
- Priority changed from Urgent to High
- Translation missing: en.field_release deleted (
209)
Please don't modify the release field.
Updated by Sandro Emma almost 8 years ago
Sandro Emma wrote:
Same error in foreman-1.15.0-0.1.RC1.el7.noarch on RHEL7.3
Updated by Dominic Cleal almost 8 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
- Translation missing: en.field_release set to 241
Updated by Dominic Cleal almost 8 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset foreman-packaging|8c9db2470c7203aee39535eba088be8c47736123.
Updated by Sandro Emma almost 8 years ago
Dominic Cleal wrote:
Applied in changeset foreman-packaging|8c9db2470c7203aee39535eba088be8c47736123.
Thanks :) !
When will the updated package be available in upstream ?
Updated by Dominic Cleal almost 8 years ago
Release is set for 1.14.4, see Foreman_114_Schedule for the approximate date.
Delete /usr/share/foreman/bin/spring as a workaround, it should start then.
Updated by Sandro Emma almost 8 years ago
Dominic Cleal wrote:
Release is set for 1.14.4, see [[Foreman_114_Schedule]] for the approximate date.
Delete /usr/share/foreman/bin/spring as a workaround, it should start then.
Nope after deleting the file and restarting httpd
Message from application: Validation failed: Role is locked for user modifications. (ActiveRecord::RecordInvalid)
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:43:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `block in save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in `transaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/usr/share/foreman/app/services/cache_manager.rb:13:in `create_new_filter_cache'
/usr/share/foreman/app/services/cache_manager.rb:20:in `recache!'
/usr/share/foreman/config/initializers/fix_cache.rb:10:in `<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instrument'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:651:in `load_config_initializer'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:226:in `block in tsort_each'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:429:in `each_strongly_connected_component_from'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:419:in `block in each_strongly_connected_component_from'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:413:in `call'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:413:in `each_strongly_connected_component_from'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:347:in `block in each_strongly_connected_component'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `each'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `call'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `each_strongly_connected_component'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:224:in `tsort_each'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:203:in `tsort_each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
config.ru:3:in `block in <main>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:in `instance_eval'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
Updated by Dominic Cleal almost 8 years ago
That's unrelated to this bug, please file a bug against Foreman for it.
Updated by Michael Roth over 7 years ago
I've found a workaround for the problem.
Just generate an empty Gemfile and an empty Gemfile.lock in Foreman Home Directory.
touch /usr/share/foreman/Gemfile
touch /usr/share/foreman/Gemfile.lock
Now you can start foreman as a service with systemctl start foreman