You are not logged in.

#1 2020-06-22 01:17:42

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

[SOLVED] gitlab-puma UndefinedTable error while installation

Hi,

I'm having troubles while installing GitLab. After following the steps of the tutorial in the ArchWiki until "Initialize Gitlab database" the error occures if i start gitaly.
Gitaly will start puma and puma throws the following error:

Jun 22 01:46:10 server gitlab-puma[28205]: {"timestamp":"2020-06-21T23:46:10.707Z","pid":28205,"message":"! Unable to load application: ActiveRecord::StatementInvalid: PG::UndefinedTable: FEHLER:  Relation »application_settings« existiert nicht\nLINE 1: SELECT \"application_settings\".* FROM \"application_settings\" ...\n                                             ^\n"}
Jun 22 01:46:10 server gitlab-puma[28205]: bundler: failed to load command: puma (/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/bin/puma)
Jun 22 01:46:10 server gitlab-puma[28205]: ActiveRecord::StatementInvalid: PG::UndefinedTable: FEHLER:  Relation »application_settings« existiert nicht
Jun 22 01:46:10 server gitlab-puma[28205]: LINE 1: SELECT "application_settings".* FROM "application_settings" ...

What does this error mean and how to fix it?
Are additional informations required to answer the question?

I first tried the Gitlab forum, but I couldn't get any hints there.
Click here

Thanks for your attention, greetings Kokos Bot.

The full journalctl log for the gitlab-puma service:

 
Jun 22 01:46:10 server gitlab-puma[28205]: {"timestamp":"2020-06-21T23:46:10.707Z","pid":28205,"message":"! Unable to load application: ActiveRecord::StatementInvalid: PG::UndefinedTable: FEHLER:  Relation »application_settings« existiert nicht\nLINE 1: SELECT \"application_settings\".* FROM \"application_settings\" ...\n                                             ^\n"}
Jun 22 01:46:10 server gitlab-puma[28205]: bundler: failed to load command: puma (/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/bin/puma)
Jun 22 01:46:10 server gitlab-puma[28205]: ActiveRecord::StatementInvalid: PG::UndefinedTable: FEHLER:  Relation »application_settings« existiert nicht
Jun 22 01:46:10 server gitlab-puma[28205]: LINE 1: SELECT "application_settings".* FROM "application_settings" ...
Jun 22 01:46:10 server gitlab-puma[28205]:                                              ^
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:744:in `prepare'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:744:in `block in prepare_statement'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:739:in `prepare_statement'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:684:in `exec_cache'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:658:in `execute_and_clear'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/marginalia-1.8.0/lib/marginalia.rb:94:in `execute_and_clear_with_marginalia'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in `exec_query'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:493:in `select_prepared'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:68:in `select_all'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:107:in `select_all'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/querying.rb:46:in `find_by_sql'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:821:in `block in exec_queries'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:808:in `exec_queries'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:626:in `load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:250:in `records'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation.rb:245:in `to_ary'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation/finder_methods.rb:527:in `find_nth_with_limit'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation/finder_methods.rb:512:in `find_nth'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation/finder_methods.rb:120:in `first'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/relation/finder_methods.rb:151:in `last'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3/lib/active_record/querying.rb:21:in `last'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/app/models/concerns/cacheable_attributes.rb:63:in `rescue in current'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/app/models/concerns/cacheable_attributes.rb:51:in `current'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/current_settings.rb:48:in `uncached_application_settings'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/current_settings.rb:30:in `ensure_application_settings!'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/current_settings.rb:7:in `block in current_application_settings'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/null_request_store.rb:34:in `fetch'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/safe_request_store.rb:12:in `fetch'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/gitlab/current_settings.rb:7:in `current_application_settings'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/lib/banzai/filter/asset_proxy_filter.rb:40:in `initialize_settings'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/config/initializers/asset_proxy_settings.rb:5:in `block in <top (required)>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/config/initializers/asset_proxy_settings.rb:4:in `<top (required)>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:318:in `load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:318:in `block in load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:318:in `load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/engine.rb:666:in `block in load_config_initializer'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3/lib/active_support/notifications.rb:182:in `instrument'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/engine.rb:665:in `load_config_initializer'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/engine.rb:625:in `block (2 levels) in <class:Engine>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/engine.rb:624:in `each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/engine.rb:624:in `block in <class:Engine>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:32:in `instance_exec'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:32:in `run'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:61:in `block in run_initializers'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:50:in `each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:50:in `tsort_each_child'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:415:in `call'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:347:in `each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:347:in `call'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/initializable.rb:60:in `run_initializers'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3/lib/rails/application.rb:363:in `initialize!'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/config/environment.rb:5:in `<top (required)>'
Jun 22 01:46:10 server gitlab-puma[28205]:   config.ru:18:in `require'
Jun 22 01:46:10 server gitlab-puma[28205]:   config.ru:18:in `block in <main>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.0.9/lib/rack/builder.rb:55:in `instance_eval'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.0.9/lib/rack/builder.rb:55:in `initialize'
Jun 22 01:46:10 server gitlab-puma[28205]:   config.ru:in `new'
Jun 22 01:46:10 server gitlab-puma[28205]:   config.ru:in `<main>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.0.9/lib/rack/builder.rb:49:in `eval'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.0.9/lib/rack/builder.rb:49:in `new_from_string'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.0.9/lib/rack/builder.rb:40:in `parse_file'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/configuration.rb:321:in `load_rackup'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/configuration.rb:246:in `app'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/runner.rb:155:in `load_and_bind'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/cluster.rb:413:in `run'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/launcher.rb:172:in `run'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/cli.rb:80:in `run'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/gitlab-puma-4.3.3.gitlab.2/bin/puma:10:in `<top (required)>'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/bin/puma:23:in `load'
Jun 22 01:46:10 server gitlab-puma[28205]:   /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/bin/puma:23:in `<top (required)>'
Jun 22 01:46:10 server systemd[1]: gitlab-puma.service: Main process exited, code=exited, status=1/FAILURE
Jun 22 01:46:10 server systemd[1]: gitlab-puma.service: Failed with result 'exit-code'.

Last edited by Kokos Bot (2020-06-28 14:31:05)

Offline

#2 2020-06-22 06:59:11

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

It looks like puma cannot find table "application_settings" in the gitlab database. I would guess that the database was not correctly initialized.

Try to drop the database and recreate it from the beginning (I assume you dont have any data so it OK to do it). Please provide all the logs for the database setup operation.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#3 2020-06-24 22:12:44

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

I'm not sure what exactly I should log, the creation of the DB in PostgresSQL or the step "Initialize the database and activate advanced features: " from the tutorial. I dropped the old DB and created a new one.

So I started logging the creation of the DB.
I used the following settings in PostgresSQL to create the log:

  • log_min_messages = info

  • log_min_error_statement = info

  • log_min_duration_statement = 0

  • log_statement = 'all'

Maybe the log setting for PostgresSQL is not sufficient yet.
The log gives me this information when I create a DB in PostgresSQL:

2020-06-24 02:54:45.702 CEST [40108] LOG:  Dauer: 1.738 ms
2020-06-24 02:58:21.742 CEST [40108] LOG:  Anweisung: CREATE USER gitlab_user WITH PASSWORD '1234';
2020-06-24 02:58:21.743 CEST [40108] LOG:  Dauer: 1.033 ms
2020-06-24 02:59:37.300 CEST [40108] LOG:  Anweisung: ALTER USER gitlab_user SUPERUSER ;
2020-06-24 02:59:37.301 CEST [40108] LOG:  Dauer: 1.151 ms
2020-06-24 03:00:46.130 CEST [40108] LOG:  Anweisung: CREATE DATABASE gitlab_db OWNER gitlab_user ;
2020-06-24 03:00:46.259 CEST [40108] LOG:  Dauer: 129.023 ms

Then I tried to check if the user and the table are displayed.

postgres=# \l
                                  Liste der Datenbanken
   Name    | Eigentümer  | Kodierung | Sortierfolge | Zeichentyp  |  Zugriffsprivilegien  
-----------+-------------+-----------+--------------+-------------+-----------------------
 gitlab_db | gitlab_user | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | 
 postgres  | postgres    | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | 
 template0 | postgres    | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
           |             |           |              |             | postgres=CTc/postgres
 template1 | postgres    | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
           |             |           |              |             | postgres=CTc/postgres
postgres=# \du
                                       Liste der Rollen
 Rollenname  |                            Attribute                            | Mitglied von 
-------------+-----------------------------------------------------------------+--------------
 gitlab_user | Superuser                                                       | {}
 postgres    | Superuser, Rolle erzeugen, DB erzeugen, Replikation, Bypass RLS | {}

I also did the step from the tutorial (with my DB gitlab_db):

Try connecting to the new DB with the new user to verify it works:
# psql -d gitlabhq_production

This runs like the first installation attempt without problems. Now I came to the part "Initialize the database and activate advanced features: ". Before I can use the command

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

I must, according to the tutorial, start Redis and then gitlab-gitaly.service.
This is where the error happens.

As far as I understand the tutorial, I have to install the dependencies first. Then the settings are set and afterwards the DB is created. Finally, during the step "Initialize Gitlab database", the DB is filled with content. Why does an error occur when starting gitaly (puma), although I have to start these programs to fill the DB with content?

If wanted, I can provide an exact log of the interaction of puma with PostgresSQL. But I'm not sure if this is exactly what I was asked to do, considering the question I asked in the previous paragraph.

Last edited by Kokos Bot (2020-06-24 22:42:42)

Offline

#4 2020-06-24 22:35:08

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

Please edit your posts and use [ code ] tags (not quote tags) when posting output.

https://wiki.archlinux.org/index.php/Co … s_and_code
https://bbs.archlinux.org/help.php#bbcode

Offline

#5 2020-06-25 04:57:19

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

Kokos Bot wrote:

I must, according to the tutorial, start Redis and then gitlab-gitaly.service.
This is where the error happens.

gitlab-gitaly service depends on gitlab-puma. But gitlab-puma server cannot be run because db is not initialized yet. The documentation is not correct here.

Could you please try to run

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

without starting gitlab-gitaly service?

If it does not help then try to run

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:db:configure

. This command suppose to initialize the database and does not have any dependency to redis or gitaly.

Last edited by anatolik (2020-06-25 05:03:24)


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#6 2020-06-26 03:29:20

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

anatolik wrote:

Could you please try to run

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

This gives the following output to the console:

/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_1' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_2' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_3' is reserved for numbered parameter; consider another name
Failed to connect to Gitaly...
Error: 14:failed to connect to all addresses

The log file "production.log" contains these lines:

Raven 2.9.0 configured not to capture errors: DSN not set
Creating scope :of_projects. Overwriting existing method MergeRequest.of_projects.
Creating scope :join_project. Overwriting existing method MergeRequest.join_project.
Creating scope :references_project. Overwriting existing method MergeRequest.references_project.
Creating scope :system. Overwriting existing method Note.system.
Creating scope :without_statuses. Overwriting existing method CommitStatus.without_statuses.
An enum element in Ci::Runner uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.

anatolik wrote:

If it does not help then try to run

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:db:configure

This results in this console output:

/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_1' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_2' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_3' is reserved for numbered parameter; consider another name
== Seed from /usr/share/webapps/gitlab/db/fixtures/production/001_application_settings.rb
Creating the default ApplicationSetting record.
== Seed from /usr/share/webapps/gitlab/db/fixtures/production/002_admin.rb
Administrator account created:
login:    root
password: You'll be prompted to create one on your first visit.
== Seed from /usr/share/webapps/gitlab/db/fixtures/production/010_settings.rb
== Seed from /usr/share/webapps/gitlab/db/fixtures/production/999_common_metrics.rb

After I ran this command I could start gitaly without puma throwing an error.

Notes: If I run the first command again, it still results in the same error. Can I conclude that the whole section Initialize Gitlab database is useless?
In the original documentation describes that the admin account is created while running:

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

Why it is different here?

Last edited by Kokos Bot (2020-06-26 03:30:28)

Offline

#7 2020-06-26 04:08:07

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

Thanks or confirming it. I think we should follow the upstream documentation and use gitlab:setup to setup the instance. Looking at the upstream doc I see that gitaly service starts without starting Puma server first. And it differs from the Arch configuration where gitaly depends on gitla-puma service. I wonder if we should drop this dependency.

Kokos, if you have some time to debug this problem could you please drop the database again, then open

/usr/lib/systemd/system/gitlab-gitaly.service

file and remove lines

Requires=gitlab-puma.service
Wants=gitlab-puma.service
After=gitlab-puma.service

Then follow the current Arch Linux documentation you pointed. Does it allow to initialize the instance with gitlab:setup?


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#8 2020-06-26 12:09:11

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

I changed the gitlab-gitaly.service unti as you suggested:

anatolik wrote:

file and remove lines

Requires=gitlab-puma.service
Wants=gitlab-puma.service
After=gitlab-puma.service

If i start gitaly after this changes it results in a new error.
It is logged in the journalctl:

Jun 26 13:59:47 server systemd[1]: Started Gitaly is a Git RPC service for handling all the git calls made by GitLab..
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="Starting Gitaly" version="Gitaly, version 13.1.0"
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=warning msg="git path not configured. Using default path resolution" resolvedPath=/usr/bin/git
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="clearing disk cache object folder" path=/var/lib/gitlab/repositories
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="moving disk cache object folder to /var/lib/gitlab/repositories/+gitaly/tmp/diskcache948299561" path=/var/lib/gitlab/repositories
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="disk cache object folder doesn't exist, no need to remove" path=/var/lib/gitlab/repositories
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="Starting file walker for /var/lib/gitlab/repositories/+gitaly/cache" path=/var/lib/gitlab/repositories/+gitaly/cache
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="Starting file walker for /var/lib/gitlab/repositories/+gitaly/state" path=/var/lib/gitlab/repositories/+gitaly/state
Jun 26 13:59:47 server gitlab-gitaly[69068]: time="2020-06-26T13:59:47+02:00" level=info msg="cleared all cache object files in /var/lib/gitlab/repositories/+gitaly/tmp/diskcache948299561 after 77.003µs" path=/var/lib/gitlab/repositories
Jun 26 13:59:48 server gitlab-gitaly[69068]: time="2020-06-26T13:59:48+02:00" level=info msg="finished tempdir cleaner walk" storage=default time_ms=0
Jun 26 13:59:48 server gitlab-gitaly[69068]: time="2020-06-26T13:59:48+02:00" level=error msg="shutting down" error="unable to start the bootstrap: can't create new listener: listen unix /run/gitlab/gitlab-gitaly.socket: bind: no such file or directory"
Jun 26 13:59:48 server systemd[1]: gitlab-gitaly.service: Succeeded.

I was wondering, if gitlab does not create the unix socket, it is created by puma?.
So I started puma isolated from gitaly and at least the folder /run/gitlab is created by puma.

Last edited by Kokos Bot (2020-06-26 12:09:42)

Offline

#9 2020-06-26 18:34:21

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

File

/run/gitlab/gitlab-gitaly.socket

is created by gitaly service. The error message

can't create new listener: listen unix /run/gitlab/gitlab-gitaly.socket: bind: no such file or directory

most likely comes from the fact that /run/gitlab folder is not writable to the gitaly service.

Please create /run/gitlab and make sure it is owned by gitlab user:

mkdir /run/gitlab
chown gitlab:gitlab /run/gitlab
chmod 755 /run/gitlab

and then restart the gitaly service.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#10 2020-06-26 19:47:34

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

Also note that /run/gitlab is already defined in the tmpfiles.d for gitlab package https://git.archlinux.org/svntogit/comm … ges/gitlab

If you installed 'gitlab' package then it should have that /run/gitlab directory with proper permissions (0775)


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#11 2020-06-27 01:05:59

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

I created the folder manually and set the permissions. ( I could observe that the folder disappeared as soon as puma crashed. So I assume that it was there after the installation.)  After I started gitaly the unix socket was created as expected and gitaly was running.

However, at first I could not execute the command:

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

Again with the same error:

/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_1' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_2' is reserved for numbered parameter; consider another name
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/mime-types-3.2.2/lib/mime/types/logger.rb:30: warning: `_3' is reserved for numbered parameter; consider another name
Failed to connect to Gitaly...
Error: 14:failed to connect to all addresses

Now I wondered why the socket was not found. I searched for the rake task "setup".

/usr/share/webapps/gitlab/lib/tasks/gitlab/setup.rake 

I found this lines:

  def check_gitaly_connection
    Gitlab.config.repositories.storages.each do |name, _details|
      Gitlab::GitalyClient::ServerService.new(name).info
    end
  rescue GRPC::Unavailable => ex
    puts "Failed to connect to Gitaly...".color(:red)
    puts "Error: #{ex}"
    exit 1
  end

Through this source code I became aware of the following setting in

/etc/webapps/gitlab/gitlab.yml
  ## Repositories settings
  repositories:
    storages: # You must have at least a `default` storage path.
      default:
        path: /var/lib/gitlab/repositories/
        gitaly_address: unix:/var/lib/gitlab/sockets/gitlab-gitaly.socket 

After changing the gitaly_address to

        gitaly_address: unix:/run/gitlab/gitlab-gitaly.socket 

the rake gitlab:setup task could be executed successfully.

Last edited by Kokos Bot (2020-06-27 01:38:48)

Offline

#12 2020-06-27 04:56:28

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

After changing the gitaly_address to
        gitaly_address: unix:/run/gitlab/gitlab-gitaly.socket

yes, the path needs to specify the correct socket file. I checked the default configuration from gitlab-13.1.1 and I see that it contains the correct path (/run/gitlab/gitlab-gitaly.socket). I wonder if this it is something that you modified in your config earlier.


Could you please confirm that you used modified /usr/lib/systemd/system/gitlab-gitaly.service without dependency to puma service and it allows you to compete the initialization successfully?


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#13 2020-06-28 02:39:39

Kokos Bot
Member
Registered: 2020-06-20
Posts: 9

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

I have started the whole installation from scratch to avoid any manual contamination.
If i remove this three lines

Requires=gitlab-puma.service
Wants=gitlab-puma.service
After=gitlab-puma.service

from

/usr/lib/systemd/system/gitlab-gitaly.service

I can start gitaly without an error.
After this I can execute:

$ sudo -u gitlab $(cat environment | xargs) bundle exec rake gitlab:setup

I think this solves my question, thank you for your support! (Before I mark this thread as solved I will wait for a reaction.)

Note 1:
I read the config.patch file and I found out that I probably used an old gitlab.yml from my first installation attempt. In my attempt now, the gitaly_address is correct.

Note 2:
The rake gitlab:setup task need access to the file: /etc/webapps/gitlab/secrets.yml to create two more keys.
If I executed it needed to give writing permission to the gitlab user for this file.
I don't know if this is important, but it is not in the tutorial section.

Last edited by Kokos Bot (2020-06-28 02:58:10)

Offline

#14 2020-06-28 04:16:04

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] gitlab-puma UndefinedTable error while installation

Great to hear that your problem is resolved.

The dependency to gitlab-puma will be removed in the next gitaly package build. It will save time for those who plans to set up gitlab in the future.

If I executed it needed to give writing permission to the gitlab user for this file.

I think this is valuable information and it needs to be added to the wiki.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

Board footer

Powered by FluxBB