Yunohost api dead


my yunhost is brokn since I tried to update Nextcloud. The API does not respond any more. The command yunohost returns yunohost: command not found

and this systemctl status yunohost-api gives

   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

Finally I get this in the api logs if I run tail -n 300 /var/log/yunohost/yunohost-api.log:

2021-01-18 09:20:03,915 DEBUG    yunohost.hook <lambda> - [3831.6] 41976 + cp /tmp/nextcloud-ynh-deps.control /tmp/tmp.hCHsFu5JIb/control
2021-01-18 09:20:03,915 DEBUG    yunohost.hook <lambda> - [3831.6] 41976 + cd /tmp/tmp.hCHsFu5JIb
2021-01-18 09:20:03,915 DEBUG    yunohost.hook <lambda> - [3831.6] 41976 + LC_ALL=C
2021-01-18 09:20:03,915 DEBUG    yunohost.hook <lambda> - [3831.6] 41976 + equivs-build ./control
2021-01-18 09:20:05,027 DEBUG    yunohost.hook <lambda> - [3831.6] 43090 + dpkg --force-depends --install ./nextcloud-ynh-deps_15.0.5~ynh3_all.deb
2021-01-18 09:20:05,027 DEBUG    yunohost.hook <lambda> - [3831.6] 43091 dpkg: error: dpkg status database is locked by another process
2021-01-18 09:20:05,028 DEBUG    yunohost.hook <lambda> - [3831.6] 43091 + ynh_package_install --fix-broken
2021-01-18 09:20:05,028 DEBUG    yunohost.hook <lambda> - [3831.6] 43092 + ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
2021-01-18 09:20:05,028 DEBUG    yunohost.hook <lambda> - [3831.6] 43092 + ynh_wait_dpkg_free
2021-01-18 09:20:05,028 DEBUG    yunohost.hook <lambda> - [3831.6] 43092 + local try
2021-01-18 09:20:05,028 DEBUG    yunohost.hook <lambda> - [3831.6] 43092 + set +o xtrace
2021-01-18 09:20:05,229 DEBUG    yunohost.hook <lambda> - [3831.6] 43293 apt is already in use...
2021-01-18 09:20:06,334 DEBUG    yunohost.hook <lambda> - [3831.6] 44399 apt is already in use...
2021-01-18 09:20:10,558 DEBUG    yunohost.hook <lambda> - [3831.6] 48617 apt is already in use...
2021-01-18 09:20:19,688 DEBUG    yunohost.hook <lambda> - [3831.6] 57753 apt is already in use...

I don’t know how to fix this !
Thanks in advance !

Uuuuuh wokay so let’s maybe have a look first at

dpkg --list | grep yunohost

Thanks for the quick answer. I get this:

ii  python-toml                           0.10.0-1+yunohost                                              all          library for Tom's Obvious, Minimal Language - Python 2.7
ii  rspamd                                                                     amd64        Rapid spam filtering system
ii  unscd                                 0.53-1+yunohost                                                amd64        Micro Name Service Caching Daemon
rc  yunohost                                                                            all          manageable and configured self-hosting server

Sooo are you doing this as root (or admin) …?

What if you run ls /usr/bin/yunohost ? Does it answers “/usr/bin/yunohost” ? (Otherwise it sounded like yunohost got uninstalled somehow but dpkg says it’s still there ?

If you werent logged as root/admin, can you retry sudo systemctl status yunohost-api

I logged as root. When I run sudo systemctl status yunohost-api, I get the same result:

● yunohost-api.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

Should I reinstall Yunohost ? If yes, can I do it without loosing my data ? How should I proceed ?
Note that the only thing I did is to try to update my Nextcloud.

No please don’t jump into reinstalling Yunohost … Yunohost is still there …

It looks like it’s only the webadmin api/client which ain’t there (which is not that much of a deal)

What happens if you try to apt install yunohost-admin

1 Like

It works, I get my yunohost back !

But, if I try to update system, I am asked to run the postinstall configuration. So I ran this:
sudo yunohost tools postinstall
and I get this error

Weelll … that should not have happened … ideally you should not have run the postinstall considering your server was already postinstalled … so not sure what happens now …

I don’t understand how this kind of issue can arise, I’ve seen this many times in the past and thought it was gone but apparently nope … Basically what tells yunohost that it’s already postinstalled is the existence of a file /etc/yunohost/installed and there’s no reason why this file should get deleted whatsoever …

So idk what state you server is in right now … Maybe try to

touch /etc/yunohost/installed

Then it would be really great to share the log of the nextcloud upgrade by going in the webadmin in Tools > Logs, find the upgrade log and share it with the corresponding button …

Well I did this because I visited the Administration part of the web interface, and I have been invited to run the post-installation online. As it failed, I ran it in the console to get logs. I ran the the command your recommended. And now my admin password is no more recognize through the web interface, so that I can’t check or test anything. How can I reset it ?

Just touch /etc/yunohost/installed

then yunohost tools adminpw should do the trick

1 Like

Excellent, It did the trick.

So now, I am stuck back to my nextcloud upgrade initial problem. I installed some missing php libs and my nextcloud is back. But now I get this when I try the upgrade:

Source path '/etc/logrotate.d/nextcloud' does not exist

Hmpf it just sounds like some random file disappeared on your system or something …

Naively you can try to

touch /etc/logrotate.d/nextcloud

and maybe that’ll fix it but it’s more and more “wtf is going on”

PLEASE share the log of the initial upgrade attempt so we may have a chance to understand what happened:

Same result.
Here is the Tools > Logs corresponding to the nextcloud upgrade:

… By initial upgrade i meant the upgrade you tried on January 18th …

Well, the oldest log from the interface is aged of 17 hours …

Then let’s run yunohost log list to find more

then once you have the proper 'name' for it, run yunohost log display <the_log_name> --share

This is what I get. I am not sure it is really helpfull unfortunately

Actually it is very much. There was a bug in the upgrade script and we were able to understand and fix it thanks to this … (well that doesn’t really help fixing all the weird stuff that happened on your server but at least that may prevent the upgrade failing for the same reason for other people)

I have other question regarding the mysterious removal of yunohost-admin … Can you share the output of

grep -C5 -nr "yunohost" /var/log/apt/

Excellent. Happy if it has helped !
What should I do then ? Try to upgrade again ?

And here is the result of the grep:

/var/log/apt/history.log-30-End-Date: 2021-01-18  09:17:45
/var/log/apt/history.log-32-Start-Date: 2021-01-18  09:20:34
/var/log/apt/history.log-33-Commandline: apt-get install apache2
/var/log/apt/history.log-34-Install: libaprutil1:amd64 (1.5.4-3, automatic), libaprutil1-dbd-sqlite3:amd64 (1.5.4-3, automatic), apache2-data:amd64 (2.4.25-3+deb9u9, automatic), libapr1:amd64 (1.5.2-5, automatic), libaprutil1-ldap:amd64 (1.5.4-3, automatic), liblua5.2-0:amd64 (5.2.4-1.1+b2, automatic), apache2-bin:amd64 (2.4.25-3+deb9u9, automatic), apache2:amd64 (2.4.25-3+deb9u9), apache2-utils:amd64 (2.4.25-3+deb9u9, automatic)
/var/log/apt/history.log:35:Remove: yunohost:amd64 (, yunohost-admin:amd64 (
/var/log/apt/history.log-36-End-Date: 2021-01-18  09:20:57
/var/log/apt/history.log-38-Start-Date: 2021-01-20  13:51:47
/var/log/apt/history.log-39-Commandline: apt install supervisor
/var/log/apt/history.log-40-Install: python-meld3:amd64 (1.0.2-2, automatic), supervisor:amd64 (3.3.1-1+deb9u1)
/var/log/apt/history.log-41-End-Date: 2021-01-20  13:51:54
/var/log/apt/history.log-43-Start-Date: 2021-01-20  19:15:11
/var/log/apt/history.log:44:Commandline: apt install yunohost-admin
/var/log/apt/history.log:45:Install: yunohost:amd64 (, automatic), yunohost-admin:amd64 (
/var/log/apt/history.log-46-Remove: apache2:amd64 (2.4.25-3+deb9u9)
/var/log/apt/history.log-47-End-Date: 2021-01-20  19:15:24
/var/log/apt/history.log-49-Start-Date: 2021-01-21  06:56:30
/var/log/apt/history.log-50-Commandline: apt autoremove
/var/log/apt/term.log-154-Log started: 2021-01-18  09:17:04
/var/log/apt/term.log-155-Log ended: 2021-01-18  09:17:45
/var/log/apt/term.log-157-Log started: 2021-01-18  09:20:34
(Reading database ... 52797 files and directories currently installed.)
/var/log/apt/term.log:159:Removing yunohost-admin ( ...
/var/log/apt/term.log:160:dpkg: warning: while removing yunohost-admin, directory '/usr/share/yunohost/admin' not empty so not removed
/var/log/apt/term.log-161-dpkg: warning: overriding problem because --force enabled:
/var/log/apt/term.log-162-dpkg: warning: this is an essential package; it should not be removed
/var/log/apt/term.log:163:Removing yunohost ( ...
/var/log/apt/term.log-164-Selecting previously unselected package libapr1:amd64.
(Reading database ... 52295 files and directories currently installed.)
/var/log/apt/term.log-166-Preparing to unpack .../0-libapr1_1.5.2-5_amd64.deb ...
/var/log/apt/term.log-167-Unpacking libapr1:amd64 (1.5.2-5) ...
/var/log/apt/term.log-168-Selecting previously unselected package libaprutil1:amd64.
/var/log/apt/term.log-269-Log ended: 2021-01-20  13:51:54
/var/log/apt/term.log-271-Log started: 2021-01-20  19:15:11
(Reading database ... 53130 files and directories currently installed.)
/var/log/apt/term.log-273-Removing apache2 (2.4.25-3+deb9u9) ...
/var/log/apt/term.log:274:Selecting previously unselected package yunohost.
(Reading database ... 53081 files and directories currently installed.)
/var/log/apt/term.log:276:Preparing to unpack .../yunohost_3.8.5.9_all.deb ...
/var/log/apt/term.log:277:Unpacking yunohost ( ...
/var/log/apt/term.log:278:Setting up yunohost ( ...
/var/log/apt/term.log-279-Initializing a local SSL certification authority ...
/var/log/apt/term.log:280:(logs available in /tmp/yunohost-ssl-init)
/var/log/apt/term.log-281-config file testing succeeded
/var/log/apt/term.log:282:Selecting previously unselected package yunohost-admin.
(Reading database ... 53357 files and directories currently installed.)
/var/log/apt/term.log:284:Preparing to unpack .../yunohost-admin_3.8.3.5_all.deb ...
/var/log/apt/term.log:285:Unpacking yunohost-admin ( ...
/var/log/apt/term.log-286-Processing triggers for systemd (232-25+deb9u12) ...
/var/log/apt/term.log:287:Setting up yunohost-admin ( ...
/var/log/apt/term.log-288-Processing triggers for man-db ( ...
/var/log/apt/term.log-289-Log ended: 2021-01-20  19:15:24
/var/log/apt/term.log-291-Log started: 2021-01-21  06:56:30
(Reading database ... 53583 files and directories currently installed.)