After restart the server foreman doesnt work

hi all,

after restart the Puppet/Foreman-Server foreman cannot be started, when I stop foreman-proxy, foreman.service & foreman.socket. Puppet work fine.
What I see in journalctl -xe:


Jul 04 11:57:09 mysite foreman[34668]:         from /usr/share/foreman/bin/rails:9:in `<main>'
Jul 04 11:57:09 mysite systemd[1]: foreman.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit foreman.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jul 04 11:57:09 mysite systemd[1]: foreman.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit foreman.service has entered the 'failed' state with result 'exit-code'.
Jul 04 11:57:09 mysite systemd[1]: Failed to start Foreman.
-- Subject: A start job for unit foreman.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit foreman.service has finished with a failure.
--
-- The job identifier is 19829 and the job result is failed.
Jul 04 11:57:09 mysite systemd[1]: Starting Foreman...
-- Subject: A start job for unit foreman.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit foreman.service has begun execution.
--
-- The job identifier is 19995.
Jul 04 11:57:09 mysite CRON[34675]: pam_unix(cron:session): session closed for user root
Jul 04 11:57:13 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/graphql-1.8.18/lib/graphql/schema/mutation.rb:70: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:13 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/graphql-1.8.18/lib/graphql/schema/member/has_fields.rb:51: warning: The called method `field' is defined here
Jul 04 11:57:13 mysite foreman[34813]: => Booting Puma
Jul 04 11:57:13 mysite foreman[34813]: => Rails 6.0.3.7 application starting in production
Jul 04 11:57:13 mysite foreman[34813]: => Run `rails server --help` for more startup options
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/models/concerns/has_many_common.rb:48: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.3.7/lib/active_record/associations.rb:1370: warning: The called method `has_many' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/models/concerns/has_many_common.rb:53: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.3.7/lib/active_record/associations.rb:1826: warning: The called method `has_and_belongs_to_many' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/models/concerns/has_many_common.rb:77: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.3.7/lib/active_record/associations.rb:1657: warning: The called method `belongs_to' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/registries/foreman/settings/general.rb:53: warning: Passing the keyword argument as the last hash parameter is deprecated
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/registries/foreman/setting_manager.rb:98: warning: The called method `validates' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/registries/foreman/settings/email.rb:82: warning: Passing the keyword argument as the last hash parameter is deprecated
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/registries/foreman/setting_manager.rb:98: warning: The called method `validates' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/services/setting_registry.rb:138: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/app/services/setting_registry.rb:167: warning: The called method `_add' is defined here
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/postgresql_adapter.rb:46: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Jul 04 11:57:14 mysite foreman[34813]: /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.3.5/lib/pg.rb:68: warning: The called method `connect' is defined here

systemctl status foreman:

# systemctl status foreman.service
â—Ź foreman.service - Foreman
     Loaded: loaded (/lib/systemd/system/foreman.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/foreman.service.d
             └─installer.conf
     Active: activating (start) since Mon 2022-07-04 11:57:59 CEST; 2s ago
TriggeredBy: â—Ź foreman.socket
       Docs: https://theforeman.org
   Main PID: 35541 (foreman-ruby)
      Tasks: 1 (limit: 19088)
     Memory: 69.4M
     CGroup: /system.slice/foreman.service
             └─35541 foreman-ruby /usr/share/foreman/bin/rails server --environment production

Does anyone know why?

its possible to restore only users table from the dump ?

Hi,
I don’t see any errors in the journalctl -xe, can you post the content of the /var/log/foreman log?

its possible to restore only users table from the dump ?

I don’t have personal experience but from this article [0] it should be possible.

[0] Restoring a single table from a Postgres database or backup

1 Like

thank you so much @lstejska it works for me