Messed up installation from gitlab-ee and gitlab-ce with database authentication error

Hello community :slight_smile: !

I want to host a private GitLab server in my local network just for private projects/learning/fun purpose.
And somehow I already messed up my fresh installation a bit.

What I did:
I accidentially installed the gitlab-ee version on my ubuntu-server (because this is what is documented on gitlab Download and install GitLab | GitLab) and noticed that when I entered the web-interface. So I learned that I have to use the “-ce” and deinstalled gitlab-ee (apt purge, and removing gitlab folders in /var, /etc …). And started from the beginning. Basically with the same instructions but with community edition.

First, the process looked fine but, when I tried to reconfigure gitlab it failed and also the gitlab:env:info showed errors that basically mean “authentication for database failed, due to invalid user name gitlab which should be root”. (That was already some days back and I unforunately didn’t keep the records)
So, based on some research, I tried to change the user name in the gitlab.rb file by replacing the line

# postgresql['sql_user'] = "gitlab"

by

postgresql['sql_user'] = "root"

Reconfiguration and restarting worked without errors (I had some before but unfortunately don’t have the records, sorry) and my gitlab:env:info also looks quite clean:

** Invoke gitlab:env:info (first_time)
** Invoke gitlab_environment (first_time)
** Execute gitlab_environment
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:env:info

System information
System:         Ubuntu 22.04
Current User:   git
Using RVM:      no
Ruby Version:   3.0.6p216
Gem Version:    3.4.14
Bundler Version:2.4.16
Rake Version:   13.0.6
Redis Version:  7.0.12
Sidekiq Version:6.5.7
Go Version:     unknown

GitLab information
Version:        16.2.2
Revision:       9a102b1b08b
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     13.11
URL:            http://192.168.178.40
HTTP Clone URL: http://192.168.178.40/some-group/some-project.git
SSH Clone URL:  git@192.168.178.40:some-group/some-project.git
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        14.23.0
Repository storages:
- default:      unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell

I was not able to access the web-page somehow… as the “puma” service looked to have trouble (timeout) I assumed this was the problem. However after restarting the “gitlab-runsvdir” ad “gitlab-ctl” processes puma recovered. But still no start page showed up with “Gitlab takes to long to respond”… a bit strange.

Just out of curiosity, I switched back my changes in the gitlab.rb file to the original version and the following happened (of course after reconfigure, restart):

reconfiguration looked successful.
restart was successfull

When I executed gitlab:env:info I got this (even a longer list of processes with the same error):

sudo gitlab-rake gitlab:env:info --trace
** Invoke gitlab:env:info (first_time)
** Invoke gitlab_environment (first_time)
** Execute gitlab_environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR:  permission denied for table application_settings

So, because I like playing around and don’t have anything better to do :sweat_smile:, I went back to “root” user in the gitlab.rb file and now… it looks like it’s working. And I can access the start page.

So, if anyone has the ambition and knowledge to think about it I’d be happy to get some information if there is a reason why that happened, if this is somehow related to the fact, that I might not have removed the gitlab-ee completely before installing the gitlab-ce and this mixed up the database and if this can cause future problems, when I try to use it for to manage projects. And maybe someone can tell me what kind of magic might be caused by toggeling this line in the gitlab.rb file from above :slight_smile:

Thanks a lot and happy riddle! :grin:

PS: If I did something wrong with the topic generation, sry for that and pls some admin feel free to move it to a better fitting space