Fresh install of foreman 3.12

Hi,
i am trying a fresh install on ubuntu 22.04 with the 3.12 installer, but the installation fails everytime with the following output:

Should i install the database not using the foreman-installer? As i understand the foreman installer should install and configure the postgresql database itself or am i wrong?

Problem:
initial foreman-installer run fails with postgresql error
Expected outcome:
foreman-installer installs postgresql with needed configuration by itself
Foreman and Proxy versions:
3.12
Foreman and Proxy plugin versions:
3.12
Distribution and version:
Ubuntu 22.04 (tried with Ubuntu 20.04 too with the same result)

Other relevant data:

2024-10-08 09:01:54 [NOTICE] [root] Loading installer configuration. This will take some time.
2024-10-08 09:01:57 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2024-10-08 09:01:57 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2024-10-08 09:01:58 [NOTICE] [checks] System checks passed
2024-10-08 09:01:58 [NOTICE] [configure] Starting system configuration.
2024-10-08 09:04:28 [NOTICE] [configure] 250 configuration steps out of 1256 steps complete.
2024-10-08 09:04:48 [NOTICE] [configure] 500 configuration steps out of 1259 steps complete.
2024-10-08 09:04:56 [NOTICE] [configure] 750 configuration steps out of 1387 steps complete.
2024-10-08 09:05:09 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-08 09:05:09 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-08 09:05:18 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-08 09:05:18 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-08 09:05:22 [NOTICE] [configure] 1000 configuration steps out of 1413 steps complete.
2024-10-08 09:05:35 [NOTICE] [configure] 1250 configuration steps out of 1413 steps complete.
2024-10-08 09:05:39 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Exec resource 'foreman-rake-db:migrate' failed. Logs:
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]
    Adding autorequire relationship with User[foreman]
    Starting to evaluate the resource (973 of 1413)
    Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    Evaluated in 17.99 seconds
  Exec[foreman-rake-db:migrate](provider=posix)
    Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
    Executing '/usr/sbin/foreman-rake db:migrate'
    Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
    Executing '/usr/sbin/foreman-rake db:migrate'
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless
    rake aborted!
    ActiveRecord::NoDatabaseError: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:318:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `flat_map'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
        Caused by:
    PG::ConnectionBad: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:711:in `async_connect_or_reset'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:846:in `connect_to_hosts'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:774:in `new'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg.rb:63:in `connect'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:318:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `flat_map'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
    Tasks: TOP => db:abort_if_pending_migrations
    (See full trace by running task with --trace)
    rake aborted!
    ActiveRecord::NoDatabaseError: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:318:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `flat_map'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
        Caused by:
    PG::ConnectionBad: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:711:in `async_connect_or_reset'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:846:in `connect_to_hosts'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:774:in `new'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg.rb:63:in `connect'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:318:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `flat_map'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:315:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
    Tasks: TOP => db:abort_if_pending_migrations
    (See full trace by running task with --trace)
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns
    rake aborted!
    ActiveRecord::NoDatabaseError: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
        Caused by:
    PG::ConnectionBad: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:711:in `async_connect_or_reset'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:846:in `connect_to_hosts'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:774:in `new'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg.rb:63:in `connect'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)
    change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    rake aborted!
    ActiveRecord::NoDatabaseError: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
        Caused by:
    PG::ConnectionBad: FATAL:  database "foreman" does not exist
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:711:in `async_connect_or_reset'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:846:in `connect_to_hosts'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg/connection.rb:774:in `new'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/pg-1.5.8/lib/pg.rb:63:in `connect'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
    /usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)

1 error was detected during installation.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

Yes, the installer will install PostgreSQL and create databases when you don’t tell it not to :slight_smile:

What parameters did you pass when trying to install this?
Anything DB related?

I’ve passed no parameters, only foreman-installer for testing and the above was the result.
postgresql is installed after the run but the errors from above occurred every time.
The installation was made on an Ubuntu 22.04 and with the commands from Quick start guide for Foreman on Debian/Ubuntu and puppet 8.

In the meantime i’ve managed to accomplish the installation with installing postgresql from the repositories and configure the database (create user and database with password and channge pg_hba.conf from peer authentication to scram-sha-256 for the foreman user) before the foreman-installer run. And now it works and the postgresql configuration is also changed.

So maybe there is some problem with the configuration of the installer and the base configuration of postgresql in ubuntu.

I can live with this solution so my problem is gone by now :slight_smile:

I am having the same problem when installing on RHEL 9.4.