Installation on a fresh Jessie VPS fails

hey there,

i try to install yunohost on a fresh installation of debian jessie (vps with 1024mb ram).

the installation script stops at

Success! LDAP has been initialized domainname.eu Success! The local certification authority has been created.

and stands there forever. I have to cancel the installation process with ctr-c to be able to use the console again.

The tailed log provides me only with this information:

root@mail:/tmp/install_script# tail -f /var/log/yunohost-installation.log 
yunohost-admin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[ 2017-11-26 06:56:29+00:00 ] ----- [ entering restart_services               ]
[ 2017-11-26 06:56:51+00:00 ] ----- [ entering post_install                   ]

Failure !
The following error was caught during Yunohost installation :

Post-installation failed

[ 2017-11-26 11:22:16+00:00 ] ----- [ entering ensure_root                    ]
[ 2017-11-26 11:22:16+00:00 ] ----- [ entering upgrade_system                 ]
Hit http://security.debian.org jessie/updates InRelease
Ign http://ftp.debian.org jessie InRelease
Hit http://ftp.debian.org jessie-updates InRelease
Hit http://ftp.debian.org jessie Release.gpg
Hit http://ftp.debian.org jessie Release
Hit http://repo.yunohost.org jessie InRelease
Hit http://security.debian.org jessie/updates/main amd64 Packages
Hit http://security.debian.org jessie/updates/contrib amd64 Packages
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/main Translation-en
Get:1 http://ftp.debian.org jessie-updates/main amd64 Packages/DiffIndex [9376 B]
Hit http://ftp.debian.org jessie-updates/contrib amd64 Packages
Hit http://ftp.debian.org jessie-updates/contrib Translation-en
Get:2 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [3688 B]
Hit http://ftp.debian.org jessie/main amd64 Packages
Hit http://ftp.debian.org jessie/contrib amd64 Packages
Hit http://ftp.debian.org jessie/contrib Translation-en
Hit http://repo.yunohost.org jessie/stable amd64 Packages
Hit http://ftp.debian.org jessie/main Translation-en
Ign http://repo.yunohost.org jessie/stable Translation-en
Fetched 13.1 kB in 1s (7926 B/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[ 2017-11-26 11:22:53+00:00 ] ----- [ entering installscript_dependencies     ]
Reading package lists...
Building dependency tree...
Reading state information...
apt-transport-https is already the newest version.
dialog is already the newest version.
lsb-release is already the newest version.
whiptail is already the newest version.
wget is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[ 2017-11-26 11:22:53+00:00 ] ----- [ entering create_custom_config           ]
[ 2017-11-26 11:22:53+00:00 ] ----- [ entering confirm_installation           ]
[ 2017-11-26 11:36:58+00:00 ] ----- [ entering setup_package_source           ]
[ 2017-11-26 11:37:04+00:00 ] ----- [ entering apt_update                     ]
Ign http://ftp.debian.org jessie InRelease
Hit http://repo.yunohost.org jessie InRelease
Hit http://ftp.debian.org jessie-updates InRelease
Hit http://security.debian.org jessie/updates InRelease
Hit http://ftp.debian.org jessie Release.gpg
Hit http://ftp.debian.org jessie Release
Hit http://repo.yunohost.org jessie/stable amd64 Packages
Get:1 http://ftp.debian.org jessie-updates/main amd64 Packages/DiffIndex [9376 B]
Hit http://ftp.debian.org jessie-updates/contrib amd64 Packages
Hit http://ftp.debian.org jessie-updates/contrib Translation-en
Get:2 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [3688 B]
Hit http://security.debian.org jessie/updates/main amd64 Packages
Hit http://ftp.debian.org jessie/main amd64 Packages
Hit http://ftp.debian.org jessie/contrib amd64 Packages
Hit http://ftp.debian.org jessie/contrib Translation-en
Ign http://repo.yunohost.org jessie/stable Translation-en
Hit http://security.debian.org jessie/updates/contrib amd64 Packages
Hit http://ftp.debian.org jessie/main Translation-en
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/main Translation-en
Fetched 13.1 kB in 1s (9006 B/s)
Reading package lists...
[ 2017-11-26 11:37:35+00:00 ] ----- [ entering register_debconf               ]
[ 2017-11-26 11:37:37+00:00 ] ----- [ entering workaround_avahi_installation  ]
User avahi already exists (with uid uid=814(avahi) gid=814(avahi) groups=814(avahi)), skipping avahi workaround
[ 2017-11-26 11:37:37+00:00 ] ----- [ entering install_yunohost_packages      ]
Reading package lists...
Building dependency tree...
Reading state information...
postfix is already the newest version.
yunohost is already the newest version.
yunohost-admin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[ 2017-11-26 11:37:39+00:00 ] ----- [ entering restart_services               ]
[ 2017-11-26 11:38:02+00:00 ] ----- [ entering post_install                   ]

Is there any way to verbose the installation script in more detail?

Thx in adavance for your help

Greets

I have faced apache and nginx interfering with each other and failing of installation lot of times.
Have you tried sudo apt-get autoremove apache2.2 before the Yunohost installation script?
Once bind9 also the cause for failing of the installation for me.

hey kanhu,

thx for your reply.

The fresh installation of jessie is without any webserver, so also without apache2. To be sure I did a apt remove apache2 and was getting a

Package ‘apache2’ is not installed, so not removed

As well as bind9:

Package ‘bind9’ is not installed, so not removed

Any more hints on that?

thx again

Over to core developers :slight_smile:

Eh to me it’s not clear where the issue is … Is it during the install script, or during the postinstall ?

If you haven’t tried running the postinstall yet, what happens if you run yunohost tools postinstall ?

sorry aleks, you are right.

the error appears when i run the postinstall-scrpit where i have to set the domain and the password.

Okay, so I think you get more info on what’s going on by running the postinstall with --debug.

However, you can’t run the postinstall several time easily at the moment … But I have a quick-and-dirty script to “reset” the system such that you can re-run the postinstall.

To run it :

curl https://raw.githubusercontent.com/alexAubin/yunoScripts/master/resetPostinstall.sh | bash

Then :

yunohost tools postinstall --debug

Thx Aleks. I used your script and did a postinstall --debug.

The script hangs at

33368 SUCCESS The configuration has been updated for service 'nsswitch'
33368 DEBUG updating conf hashes for 'nsswitch' with: {'/etc/nsswitch.conf': 'b3866c593dca88380ce1fe10d660298f'}
33381 DEBUG custom hook folder not found for action 'conf_regen' in /etc/yunohost/hooks.d/
33381 INFO Executing command 'sh -c YNH_CWD=/usr/share/yunohost/hooks/conf_regen BASH_XTRACEFD=7 /bin/bash -x "./46-nsswitch" post 1 0 /etc/nsswitch.conf 7>&1'...
33394 INFO + set -e
33394 INFO + FORCE=1
33394 INFO + DRY_RUN=0
33394 INFO + case "$1" in
33394 INFO + do_post_regen /etc/nsswitch.conf
33395 INFO + regen_conf_files=/etc/nsswitch.conf
33395 INFO + [[ -z /etc/nsswitch.conf ]]
33395 INFO + sudo service nscd restart
33429 INFO Restarting Name Service Cache Daemon: nscd.
33430 INFO + exit 0
33517 INFO Generating a 2048 bit RSA private key
.....+++
......+++
writing new private key to '/etc/yunohost/certs//konjunktion.eu-history/20171126.140805-selfsigned/key.pem'
-----

33526 INFO Using configuration from /etc/yunohost/certs//konjunktion.eu-history/20171126.140805-selfsigned/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 8 (0x8)
        Validity
            Not Before: Nov 26 14:08:05 2017 GMT
            Not After : Nov 24 14:08:05 2027 GMT
        Subject:
            commonName                = konjunktion.eu
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                32:9E:CF:0F:9D:77:75:BF:02:DA:6F:F4:A7:99:23:BE:BE:BF:A6:2E
            X509v3 Authority Key Identifier: 
                keyid:58:03:F9:B0:0E:83:9B:B2:70:8C:85:FD:9D:37:9A:09:6B:8D:26:16

            X509v3 Key Usage: 
                Digital Signature, Non Repudiation, Key Encipherment
            X509v3 Subject Alternative Name: 
                DNS:konjunktion.eu, DNS:www.konjunktion.eu, DNS:ns.konjunktion.eu
Certificate is to be certified until Nov 24 14:08:05 2027 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated

33528 INFO Enabling the certificate for domain konjunktion.eu ...
33528 INFO Restarting services...

Hm so, not sure why it’s doing that :confused:

Sounds like it’s hanging at a step where it’s supposed to restart postfix, dovecot, metronome, and reload nginx…

If you do these manually, do you have one of these hanging ?

service postfix restart
service dovecot restart
service metronome restart
service nginx reload

When I do the restarts in another shell, the postinstall process shows me this error:

root@mail:~# service metronome restart
[....] Restarting Metronome XMPP Server: metronomecertmanager         error	SSL/TLS: Failed to load '/etc/metronome/certs/localhost.key': Check that the path is correct, and the file exists. (for *)
general             info	Hello and welcome to Metronome version 3.7.9
general             info	Metronome is using the epoll backend for connection handling
certmanager         error	SSL/TLS: Failed to load '/etc/metronome/certs/example.com.key': Previous error (see logs), or other system error. (for conference.example.com)
certmanager         error	SSL/TLS: Failed to load '/etc/metronome/certs/example.com.key': Previous error (see logs), or other system error. (for conference.example.com)
portmanager         error	Failed to open server port 5269 on *, check that Metronome or another XMPP server is not already running and using this port
portmanager         info	Activated service 's2s'
mod_s2s             warn	s2s not listening on any ports, outgoing connections may fail
certmanager         error	SSL/TLS: Failed to load '/etc/metronome/certs/localhost.key': Check that the path is correct, and the file exists. (for localhost)
certmanager         error	SSL/TLS: Failed to load '/etc/metronome/certs/localhost.key': Previous error (see logs), or other system error. (for localhost)
. ok 

After a while the process hangs again at

1422129 INFO + sudo service dovecot restart
1422197 INFO Restarting IMAP/POP3 mail server: dovecot.
1422198 INFO + exit 0

When I do another restarts, I get this

2410590 ERROR Script execution failed: /usr/share/yunohost/hooks/conf_regen/40-glances
Traceback (most recent call last):
  File "/usr/lib/moulinette/yunohost/hook.py", line 283, in hook_callback
    no_trace=no_trace, raise_on_error=True, user="root")
  File "/usr/lib/moulinette/yunohost/hook.py", line 381, in hook_exec
    errno.EIO, m18n.n('hook_exec_failed', path=path))
MoulinetteError: [Errno 5] Script execution failed: /usr/share/yunohost/hooks/conf_regen/40-glances

Greets

Hm ok, so your postinstall is still running but hanging right ?

I think you could investigate what’s really blocking by running

ps -ef --forest

You should find a “tree” starting with “yunohost tools postinstall” at some point, and with a command hanging at the end of the tree :s

sorry there is no “tree”.

I will reinstall jessie on the server again and then come back. maybe I did to much “reinstall and retrys” that I broke something totaly different than Yunohost.

Hi Aleks,

same problem: script hangs when it is trying to restart the services after enabling the certifivate for the choosen domain.

Maybe it is a problem with systemd? I forgot to mention that I have to install systemd manually cause the provided jessie-rom of the vps ist installed without and yunohost stops installation due to the missing systemd. And i can only resume installation after systemd is installed.

maybe thats the problem?

greets

Hey,

uhm yea that’s probably related :confused: I don’t have much idea how to investigate it more though :confused:

Ok thx a lot so far.

I tried another reinstallation of the vps. between every step i did a reboot. installed systemd before yunohost. but still the same problem when i try to do “yunohost tools postinstall --debug”.

the process hangs on the certification restart.

any more hints onthat? thanks a lot!

Hi @virse ,

I guess it from your logs that you should try to install from the API at this URL https://konjunktion.eu/yunohost/admin/#/postinstall .
I hope the trick works in order to finalyze your post-installation.

ppr

Thx ppr,

I tried the API-Url and I can set my domain and the password (same as with the shell). But Pacman is running now for almost 20min. I guess it is the same problem:

root@mail:~# tail -f /var/log/yunohost/yunohost-api.log 
                Digital Signature, Non Repudiation, Key Encipherment
            X509v3 Subject Alternative Name: 
                DNS:konjunktion.eu, DNS:www.konjunktion.eu, DNS:ns.konjunktion.eu
Certificate is to be certified until Nov 24 20:32:13 2027 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated

2017-11-26 20:32:13,629 INFO     yunohost.certmanager _enable_certificate - [1148.1] Enabling the certificate for domain konjunktion.eu ...
2017-11-26 20:32:13,629 INFO     yunohost.certmanager _enable_certificate - [1148.1] Restarting services...

virse

@virse ,

I’ve wrote a turorial … in french … in order to install YunoHost based on Debian 8 Jessie on a VPS@pingfiles.com.
May it could helps you to review and adapt your installation process :
https://avignu.wiki.tuxfamily.org/doku.php?id=documentation:yunohost_vps_pingfiles

ppr