Can not reinstall without letsencrypt

Hi,
I wanted to install gitlab to serve locally but accidentally enabled letsencrypt when was asked for the first time.
Now I every time I want to install it fails with:

Configuring letsencrypt…
Stopping nginx for letsencrypt…
Requested domain localhost is not a FQDN
letsencrypt auto configuration failed…
Stop your webserver and try running letsencrypt manually…
letsencrypt -d localhost certonly
Registering /etc/gitlab/gitlab.yml via ucf

Creating config file /etc/gitlab/gitlab.yml with new version
Registering /etc/gitlab/gitlab-debian.conf via ucf

Creating config file /etc/gitlab/gitlab-debian.conf with new version

Creating config file /etc/nginx/sites-available/localhost with new version
Reloading nginx configuration…
nginx.service is not active, cannot reload.
invoke-rc.d: initscript nginx, action “reload” failed.
dpkg: error processing package gitlab (–configure):
subprocess installed post-installation script returned error exit status 1

I apt-get purged gitlab and even removed gitlab directories in /opt, /usr and /var. but the configuration page during apt-get wont show up again and above error always shows.
Is it related to letsencrypt ?

I am using ubuntun 16.04 amd64.

Thanks

1 Like

Similar issue on Debian 9 “Stretch”, even if I agree to the installer’s prompts to use LetsEncrypt:

# apt install gitlab
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  gitlab
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/26.4 MB of archives.
After this operation, 44.2 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package gitlab.
(Reading database ... 75218 files and directories currently installed.)
Preparing to unpack .../gitlab_8.13.11+dfsg1-8_all.deb ...
Unpacking gitlab (8.13.11+dfsg1-8) ...
Setting up gitlab (8.13.11+dfsg1-8) ...
Creating/updating gitlab user account...
adduser: Warning: The home directory `/var/lib/gitlab' does not belong to the user you are currently creating.
Making gitlab owner of /var/lib/gitlab...
Creating runtime directories for gitlab...
Updating file permissions...
Configuring hostname and email...
Configuring nginx with HTTPS...
Configuring gitlab with HTTPS...
Updating gitlab_url in gitlab-shell configuration...
Configuring letsencrypt...
Let's encrypt certificate already present.
Registering /usr/lib/tmpfiles.d/gitlab.conf via ucf

Creating config file /usr/lib/tmpfiles.d/gitlab.conf with new version
Registering /etc/gitlab-shell/config.yml via ucf

Creating config file /etc/gitlab-shell/config.yml with new version
Registering /etc/gitlab/gitlab.yml via ucf

Creating config file /etc/gitlab/gitlab.yml with new version
Registering /etc/gitlab/gitlab-debian.conf via ucf

Creating config file /etc/gitlab/gitlab-debian.conf with new version

Creating config file /etc/nginx/sites-available/<my-servers-fqdn> with new version
Reloading nginx configuration...
nginx.service is not active, cannot reload.
invoke-rc.d: initscript nginx, action "reload" failed.
dpkg: error processing package gitlab (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (232-25+deb9u1) ...
Errors were encountered while processing:
 gitlab
E: Sub-process /usr/bin/dpkg returned an error code (1)

… and also on Ubuntu 16.04:

# sudo apt install gitlab
[...]
Registering /etc/gitlab/gitlab.yml via ucf

Creating config file /etc/gitlab/gitlab.yml with new version
Registering /etc/gitlab/gitlab-debian.conf via ucf

Creating config file /etc/gitlab/gitlab-debian.conf with new version

Creating config file /etc/nginx/sites-available/<my-servers-fqdn> with new version
Reloading nginx configuration...
nginx.service is not active, cannot reload.
invoke-rc.d: initscript nginx, action "reload" failed.
dpkg: error processing package gitlab (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up ruby-debug-inspector (0.0.2-1.1build3) ...
Setting up ruby-binding-of-caller (0.7.2+debian1-3) ...
Setting up ruby-bson (1.10.0-2) ...
Setting up ruby-bson-ext (1.10.0-2build5) ...
Setting up ruby-columnize (0.9.0-1) ...
Setting up ruby-byebug (5.0.0-1build3) ...
Setting up ruby2.3-dev:amd64 (2.3.1-2~16.04.2) ...
Setting up ruby-dev:amd64 (1:2.3.0+1) ...
Setting up ruby-ffi (1.9.10debian-1build2) ...
Setting up ruby-jbuilder (2.3.1-1) ...
Setting up ruby-libvirt (0.5.1-3build5) ...
Setting up ruby-rb-inotify (0.9.7-1) ...
Setting up ruby-listen (3.0.3-3) ...
Setting up ruby-msgpack (0.6.2-1build4) ...
Setting up ruby-rabl (0.11.4-2) ...
Setting up ruby-rabl-rails (0.4.1-1) ...
Setting up ruby-sdoc (0.4.1-1) ...
Setting up ruby-spring (1.3.6-2) ...
Setting up ruby-sqlite3 (1.3.11-2build1) ...
Setting up ruby-web-console (2.2.1-2) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
 gitlab
E: Sub-process /usr/bin/dpkg returned an error code (1)

Are there any other topics about this error?

I think that letsencrypt tried to change something that made the nginx reload script doesn’t work properly. When I tried the commands:
“invoke-rc.d nginx restart” or
“nginx -t; service nginx restart; nginx reload”
Nginx worked normally again but when tried install letsencrypt along with gitlab, the error appears again.