Update to yunohost 2.4 / debian jessie failed - [Update] Database migration not working


(I’m not sure if the installation category is a better place to post this, if yes, sorry for the inconvenience)

[English version]

Hello everyone :slight_smile:

On a raspberry 2, I recently tried to update from debian 7 weezy to debian 8 jessie, to install yunohost 2.4
The whole update process worked fine, but I tried to reboot, and the raspberry is blocked on boot screen (the one with a colored square). After some research it seems that the kernel.img is corrupted.
I have a full backup of the whole server files, done 1 week before this update, and also a system backup made a month before.

I have 2 questions here:

  • if I want to use my system backup, and to restore the file backup made a week ago, which files should I copy to restore the whole yunohost installation ?
    Or at least, if I reinstall yunohost, how can I restore users, domains, and apps installed ?
  • As I would like to update to Debian Jessie to get yunohost 2.4, do you know if it’s possible to install debian jessie minimal, and to copy the yunohost’s files backup, or to install yunohost on it and after that to use the backup files to restore everything ?

Thanks a lot for your help :slight_smile:

[French version]

Bonjour à tous :slight_smile:

Sur un raspberry 2, j’ai essayé de mettre à jour de debian 7 weezy à debian 8 jessie, pour installer yunohost 2.4
Le processus de mise à jour à bien fonctionné, mais quand j’ai essayé de redémarrer, le raspberry était bloqué sur l’écran de démarrage (celui avec le carré coloré).
Après quelque recherche j’ai constaté que le fichier kernel.img est corrompu.
J’ai une sauvegarde complète des fichiers du serveur réalisée une semaine avant le crash, et aussi une sauvegarde du système réalisée un mois plus tôt.

J’ai deux questions:

  • si je souhaite utiliser ma sauvegarde du système, et restaurer les fichiers copiés une semaine avant, quelques fichiers devrais-je copier pour restorer mon installation de yunohost complète ?
    Ou au moins si je réinstalle yunohost, comment puis-je restaurer les utilisateurs, domaines et applications installées ?
  • comme je souhaiterai mettre à jour vers Debian Jessie pour avoir yunohost 2.4, savez-vous s’il est possible d’installer une debian jessie minimal, et d’y copier ma sauvegarde des fichiers de yunohost, ou d’installer yunohost et d’utiliser ensuite les sauvegardes pour restorer l’ensemble ?

Merci beaucoup pour votre aide :slight_smile:

edit: thanks for the edit @Moul )

Did you try to set an old kernel ?

Did you put debian testing repository ? If it is, you can check this documentation , may be it could help: https://wiki.labriqueinter.net/doku.php/howto:kernel-4-5-debug-fr

Restore 2.2 data, user and apps on a 2.4 system is a complex operation. That’s why we created the backup/restore features.
You could check which operations are done to restore a yunohost system :https://github.com/YunoHost/yunohost/tree/unstable/data/hooks/restore

Concerning apps, it is different for each app. A lot of web apps, can works by reinstall and replace database and some uploads. files

Hi @ljf :slight_smile:

In fact I found that there is no kernel. I tried to copy the kernel from another Raspberry 2. It’s working.
But ssh is not activated :frowning: (or at least the ssh port is closed on the RPi)

No I took the main repository, not testing.

An restoring on 2.2, and updating after that ?

I will do it, thanks :wink:
edit: are their doing a backup only for yunohost, or for all the apps ?

Well I will try to reinstall them and to replace configuration files, we’ll see what happens.

edit: and what if I try to use those backup script on yunohost 2.2 ?

You can try to chroot, and enter in the system like that to understand why there is no ssh.
If you have web admin access, you can use it to try to reactivate ssh and open port.

It seems difficult to do that directly. You could read it to understand how backup/restore, but those script are done to backup on 2.4 (especially slapd).

Ok I have ssh connection.

Yunohost is still there, v2.2.
But LDAP server is not loaded.

So what should I do ? Can I try an update right now ?
Is it possible to update, and transfer a backup to another 2.4 yunohost install ?

I think you should read this post : Problem with LDAP after upgrade to Yunohost 2.4

Well, I tried to use this command:
yunohost service regen-conf slapd --verbose

And it just says that regen-conf is not valid argument :confused:

And when I read the post with the solution:

To check if it’s your case, execute: slapcat. If it doesn’t return anything and if the folder /var/lib/ldap/ contains some files named __db.001, you seem to be concerned. The fact is that the LDAP backend changed from hdb to mdb in Debian Jessie but no database migration was done in YunoHost v2.2.

I have this __db.001 file, but slapcat return this:

5756a2ac bdb(dc=yunohost,dc=org): BDB0126 mmap: Invalid argument
5756a2ac hdb_db_open: database “dc=yunohost,dc=org” cannot be opened, err 22. Restore from backup!
5756a2ac backend_startup_one (type=hdb, suffix=“dc=yunohost,dc=org”): bi_db_open failed! (22)
slap_startup failed

Should I follow the rest of the process ?

Did you try with regenconf ?

The same, I don’t have this argument. Like if yunohost was not installed fully.

What is your version now ?

yunohost --version

moulinette-yunohost: 2.2.6
yunohost-admin: 2.2.1

Regenconf command is a 2.4 command.

And you are in 2.2 with ldap broken, did you try this ?

service nscd restart
service nslcd restart
service slapd restart 

service slapd status ?

Have you an error message with service slapd restart (or in slapd log) ?

For nscd:

Failed to restart nscd.service: Unit nscd.service failed to load: No such file or directory.

nslcd is fine.

For slapd:

● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
Loaded: loaded (/etc/init.d/slapd)
Active: failed (Result: exit-code) since Tue 2016-06-07 19:29:35 CEST; 1h 40min ago
Process: 399 ExecStart=/etc/init.d/slapd start (code=exited, status=1/FAILURE)
slapd[573]: bdb(dc=yunohost,dc=org): BDB1566 txn_checkpoint interface r…stem
raspi2YunohostHS slapd[573]: bdb_db_close: database “dc=yunohost,dc=org”: txn_checkpoint…22).
slapd[573]: backend_startup_one (type=hdb, suffix=“dc=yunohost,dc=org”)…(22)
slapd[573]: bdb_db_close: database “dc=yunohost,dc=org”: alock_close failed
slapd[573]: DIGEST-MD5 common mech free
slapd[573]: slapd stopped. slapd[399]: Starting OpenLDAP: slapd failed!
systemd[1]: slapd.service: control process exited, code=exited status=1
systemd[1]: Failed to start LSB: OpenLDAP standalone server (Lightweigh…ol).
systemd[1]: Unit slapd.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

And no new log since the day I made the upgrade to Debian 8.

edit: with service slapd start and journalctl -xn

slapd[1589]: bdb(dc=yunohost,dc=org): BDB1566 txn_checkpoint interface requires an environment configured for the transaction subsystem
slapd[1589]: bdb_db_close: database “dc=yunohost,dc=org”: txn_checkpoint failed: Invalid argument (22).
slapd[1589]: backend_startup_one (type=hdb, suffix=“dc=yunohost,dc=org”): bi_db_open failed! (22)
slapd[1589]: bdb_db_close: database “dc=yunohost,dc=org”: alock_close failed
slapd[1589]: DIGEST-MD5 common mech free
slapd[1589]: slapd stopped.
slapd[1584]: Starting OpenLDAP: slapd failed!
systemd[1]: slapd.service: control process exited, code=exited status=1
systemd[1]: Failed to start LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).

– Subject: Unit slapd.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit slapd.service has failed.

– The result is failed.
systemd[1]: Unit slapd.service entered failed state.

edit 2: also I can’t update any (yunohost) package, as LDAP server is missing

Do you think an update to 2.4 is a good idea ?

It is strange that you have no nscd service !!! Maybe you should try to reinstall it.

You can try to update to 2.4 but don’t be surpize if you have a dpkg-error during the process. You should do that by the manual method and not with --v24 option (too dangerous with your current setup).

If there is an error, I suggest you to reload nsdc and nscld and next rerun apt-get upgrade.

apt-get install nscd ?
Done, no issue.

You’re totally right.

apt-get upgrade:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,056 kB of archives.
After this operation, 419 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 57973 files and directories currently installed.)
Preparing to unpack …/tahoe-lafs_1.10.0-2_all.deb …
Unpacking tahoe-lafs (1.10.0-2) over (1.9.2-1) …
dpkg: error processing archive /var/cache/apt/archives/tahoe-lafs_1.10.0-2_all.deb (–unpack):
trying to overwrite ‘/etc/init.d/tahoe-lafs’, which is also in package yunohost-config-tahoe 2.0-rc1~megusta1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for systemd (215-17+deb8u4) …
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tahoe lafs is not in yunohost since a long time.

Did you try to modify /etc/apt/sources.list.d/yunohost.list before to update and upgrade ?

The manuel process to upgrade to --v24 is at the end of this post.

Tahoe lafs is not in yunohost since a long time.

Should I remove it ?

Empty file :confused:

If you have no yunohost.list file try the sources list directly:

I’m doing it with the manual install process.
(Thanks for your help ;))