[Résolu] Migration 0034_fix_missing_admins_aliases a échoué

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.1.15.1

Describe your issue

Bonjour à tous,
La mise à jour s’est plutôt bien passée sauf une erreur 34 de migration qui ne passe pas et évidemment je ne vois pas comment la corriger !

Voilà le log :

La migration 0034_fix_missing_admins_aliases a échoué, abandon. Erreur : La mise à jour du groupe ‘admins’ a échoué : L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1343, in user_group_update
ldap.validate_uniqueness({“mail”: mail})
File “/usr/lib/python3/dist-packages/yunohost/utils/ldap.py”, line 389, in validate_uniqueness
raise YunohostError(
yunohost.utils.error.YunohostError: L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/tools.py”, line 895, in tools_migrations_run
migration.run()
File “/usr/lib/python3/dist-packages/yunohost/migrations/0034_fix_missing_admins_aliases.py”, line 11, in run
_update_admins_group_aliases(
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1675, in _update_admins_group_aliases
user_group_update(
File “/usr/lib/python3/dist-packages/yunohost/log.py”, line 532, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1345, in user_group_update
raise YunohostError(“group_update_failed”, group=groupname, error=e)
yunohost.utils.error.YunohostError: La mise à jour du groupe ‘admins’ a échoué : L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’

J’ai bien vu une référence à ce problème ici :

réponse 61 :
<< Bonjour,

J’ai eu le même souci. C’est sans doute lié à des installations “anciennes” de YunoHost du temps où la gestion des alias n’était pas la même qu’aujourd’hui.

J’ai résolu en supprimant les aliases de l’administrateur du domaine via la webadmin.
root@ton_domaine.tld et admin@ton_domaine.tld.

La migration 0034 a pu se faire et ça a lancé automatiquement la migration 35. >>

Mais je ne sais pas comment l’utiliser :frowning:

Merci de votre aide par avance.

Share relevant logs or error messages

La migration 0034_fix_missing_admins_aliases a échoué, abandon. Erreur : La mise à jour du groupe ‘admins’ a échoué : L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1343, in user_group_update
ldap.validate_uniqueness({“mail”: mail})
File “/usr/lib/python3/dist-packages/yunohost/utils/ldap.py”, line 389, in validate_uniqueness
raise YunohostError(
yunohost.utils.error.YunohostError: L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/tools.py”, line 895, in tools_migrations_run
migration.run()
File “/usr/lib/python3/dist-packages/yunohost/migrations/0034_fix_missing_admins_aliases.py”, line 11, in run
_update_admins_group_aliases(
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1675, in _update_admins_group_aliases
user_group_update(
File “/usr/lib/python3/dist-packages/yunohost/log.py”, line 532, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/user.py”, line 1345, in user_group_update
raise YunohostError(“group_update_failed”, group=groupname, error=e)
yunohost.utils.error.YunohostError: La mise à jour du groupe ‘admins’ a échoué : L’attribut LDAP ‘mail’ existe déjà avec la valeur ‘root@mondomaine.fr’

Bonjour,

Il faut aller dans Comptes, et généralement les allias étaient affectés à l’utilisateur premier qui a des droits administrateur.

ppr

Ah ok, donc dans mon compte1 je supprime root@.. et admin@.. ?
Il y a admins@ aussi je supprime aussi ?
Merci pour la réponse rapide.

En fait dans le retour du log, tu peux voir que ça coince à cause de l’adresse root@ton_domaine.tld.
Pour ma part j’avais commencé par supprimer cette adresse root@..., puis , relancé la migration 34.
Cette fois ci, c’était l’adresse admin@... qui coinçait. Après sa suppression j’ai relancé la migration 34 qui s’est enchaîné avec la migration 35.
Fait les suppression de ces adresses les une après les autres bien qu’a priori il faudra sans doute au final toutes les supprimer.

ppr

1 Like

Super, merci.

Pour info il a fallu que je supprime tous les alias : admins, root, webmaster, admin, abuse et postmaster.

Thank you for your information. I’ve had just the same problem and needed to delete the mail alias for admin, root and postmaster too.

Now the migration 0034 was successful!

Update: Now I receive all root info mails as “Undelivered Mails returned to Sender” errors.

Does anybody know how to get rid of these error mails?

I have this same problem. Migration 34 fails.
I don’t understand where to go to delete those aliases in the administration web login.
Or is there a postfix file I can just edit as root and restart postfix? I’m lost with LDAP; never had to use it.
Additionally, I now have SMTP error 451 and roundcube is unable to send emails. I hope these two are related to the same solution described above as successful.

Go into accounts, then your main account/admin account and search for the aliases

  1. root@
  2. postmaster@
  3. admin@

and delete them (at least temporary).

After that, go to tools, maintenance and re-run the failed 0034 migration

In the main menu of the web gui, I have ‘Users’, but no ‘Accounts’. Then I have a user named Admin - Legacy Admin with no aliases.
I must be in the very wrong place!

Users was the right place.
Check your own user and his email aliases. I’ve found them for my account.

If you won’t find them, check all existing users for these mail aliases.

Good luck

You should remove it after you have checked that your username is in the admins group.
Then check yunohost tools regen-conf --dry-run --with-diff for modified configs. Run yunohost tools regen-conf --force to regenerate the configs.
Rerun the migration and report back

1 Like

Thank you both so much!
Just found out I have to leave town in the morning, so it could be a day or so before I get to thank you properly and close this thread…

1 Like

“No pending migrations” :grinning_face:
Happy, happy! Thank you so much!
I didn’t find a root@ or postmaster@, but I did have an admin@ alias.
As I said, I never used LDAP in my life. I typed ‘groups’ in a shell, saw ‘admins’ and just hoped :wink:

1 Like

May I ask what procedure you’ve done to solve your problem?
Just identified and deleted the admin alias or the “tools regen-conf --force” procedure?