MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.9k stars 498 forks source link

DietPi-Software | Transmission: Reinstall can fail in cases #4244

Closed pioniere closed 3 years ago

pioniere commented 3 years ago

Creating a bug report/issue

Required Information

Additional Information (if applicable)

Steps to reproduce

  1. ...
  2. ...

Expected behaviour

Actual behaviour

Extra details

Joulinar commented 3 years ago

Hi,

many thanks for your message. Hmm DietPi is doing nothing else than installing transmission-daemon via apt package from global repository. I did a test installation on my RPi3B+ 32bit without issues. Can you try to setup again pls. Maybe do a reboot before.

pioniere commented 3 years ago

I did try rebooting and ran setup again, same result.

Joulinar commented 3 years ago

strange, usually debian-transmission user and group should be created by the Debian package. Can you check following to files if a user/group debian-transmission is existing

cat /etc/passwd
cat /etc/group

Found an older issue on reddit. But strange that it is working for me https://www.reddit.com/r/linuxquestions/comments/7zxtbm/chown_invalid_group/

MichaIng commented 3 years ago

I mark this as closed. Feel free to reopen if required.

LeVraiRoiDHyrule commented 3 years ago

Hi, I'm having the exact same issue

image

I found no way to correctly install transmission.

Joulinar commented 3 years ago

Hi,

There is no real error message shown on your screen print. Pls can you run following

apt update && apt upgrade
apt install transmission-daemon

Plus post the full output. If possible copy the output from SSH session and avoid doing screen prints

LeVraiRoiDHyrule commented 3 years ago

When running the apt upgrade, here is what I get:

 dietpi-launcher : All the DietPi programs in one place.
 dietpi-config   : Feature rich configuration tool for your device.
Atteint :3 https://download.docker.com/linux/raspbian buster InRelease
Atteint :4 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Atteint :5 https://apt.ombi.app/develop jessie InRelease
Atteint :6 https://archive.raspberrypi.org/debian buster InRelease
Atteint :7 https://apt.hrfee.dev trusty InRelease
Atteint :8 https://download.mono-project.com/repo/debian raspbianbuster InRelease
Atteint :9 https://repo.jellyfin.org/debian buster InRelease
Ign :10 https://download.webmin.com/download/repository sarge InRelease
Atteint :11 https://download.webmin.com/download/repository sarge Release
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Tous les paquets sont à jour.
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Calcul de la mise à jour... Fait
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
1 partiellement installés ou enlevés.
Après cette opération, 0 o d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] O
Paramétrage de transmission-daemon (2.94-2+deb10u2) ...
chown: groupe incorrect: « debian-transmission:debian-transmission »
dpkg: erreur de traitement du paquet transmission-daemon (--configure) :
 installed transmission-daemon package post-installation script subprocess returned error exit status 1
Des erreurs ont été rencontrées pendant l'exécution :
 transmission-daemon
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@DietPi:~#

Apparently there is some rests of the transmission installation and the command doesn't succeed to remove them. Looks like an issue with groups/users. But it doesn't tell me which folders have a group issue. (Also maybe you want me to switch it to English temporatly ?)

Also, I just read your message on the dietpi forum, I'm very sorry for having post on both (I usually do that when I've got an issue for having more answer, but I forgot how quick you were and that it was just adding you more work. sorry again).

MichaIng commented 3 years ago

The postinst script fails. Can you please run the following:

dash -x /var/lib/dpkg/info/transmission-daemon.postinst configure
LeVraiRoiDHyrule commented 3 years ago

Thanks for your answer. Here is what I get:

root@DietPi:~# dash -x /var/lib/dpkg/info/transmission-daemon.postinst configure
+ set -e
+ test
+ getent passwd debian-transmission
+ chperms debian-transmission debian-transmission 4750 /var/lib/transmission-daemon/.config/transmission-daemon
+ dpkg-statoverride --list /var/lib/transmission-daemon/.config/transmission-daemon
+ OVERRIDE=
+ [ -e /var/lib/transmission-daemon/.config/transmission-daemon ]
+ chown debian-transmission:debian-transmission /var/lib/transmission-daemon/.config/transmission-daemon
chown: groupe incorrect: « debian-transmission:debian-transmission »
root@DietPi:~#
Joulinar commented 3 years ago

In general there is no need to post the issue twice. This will not speed up things as the same people are on both platform.

MichaIng commented 3 years ago

Hmm, do we remove that group? Let me see. We don't use it anymore, but it shouldn't be removed. EDIT: We don't

Can you please paste:

getent group debian-transmission
LeVraiRoiDHyrule commented 3 years ago

Hmm, do we remove that group? Let me see. We don't use it anymore, but it shouldn't be removed.

I have no group called "debian-transmission". But I have a user named like that, do you want me to remove it and try again ?

LeVraiRoiDHyrule commented 3 years ago

In general there is no need to post the issue twice. This will not speed up things as the same people are on both platform.

I'm very sorry, I won't do that again next time

LeVraiRoiDHyrule commented 3 years ago

getent group debian-transmission

Done ! (it didn't return anything)

MichaIng commented 3 years ago

Nonono don't remove that user 😄. The opposite: Create the group.

groupadd -r debian-transmission
usermod -aG debian-transmission debian-transmission
LeVraiRoiDHyrule commented 3 years ago

It's done. I try again ? With dietpi-software or just with apt install ?

MichaIng commented 3 years ago

Just to be sure it's really solved, finish the install first:

apt -f install
LeVraiRoiDHyrule commented 3 years ago

The install completed without issues. But I can't access [localip]:9091, I've got a 403 forbidden error.

MichaIng commented 3 years ago

Did you rerun dietpi-software as well?

LeVraiRoiDHyrule commented 3 years ago

I didn't. But now I did, and it works ! Transmission seems to work perfectly, Thank you !

I think the problem came from my trial at creating a new group for permissions. I have my download folder where both transmission, radarr and sonarr should all be able to read and write, while others can only read. I created a new group called downloadaccess including debian-transmission, radarr and sonarr users. Is it the correct way ? I probably failed something

Joulinar commented 3 years ago

Usually we use user group dietpi for shared access between multiple apps

MichaIng commented 3 years ago

Usually we use user group dietpi for shared access between multiple apps

Exactly. I mean there is not issue to create a new group in general to further split permissions, but as in the apparent case, some package installs have issues when their system groups are removed. When the whole user is removed, it is re-created, but it is then often assumed, that when the user exists, that the group exists as well, and then chown commands can fail.

LeVraiRoiDHyrule commented 3 years ago

Usually we use user group dietpi for shared access between multiple apps

Exactly. I mean there is not issue to create a new group in general to further split permissions, but as in the apparent case, some package installs have issues when their system groups are removed. When the whole user is removed, it is re-created, but it is then often assumed, that when the user exists, that the group exists as well, and then chown commands can fail.

Ah I see. The thing is that I would like to have some custom groups, one for videoaccess (that will contain jellyfin, sonarr, radarr, ombi but without write rights) and one for download access only for transmission, sonarr and radarr with write access

Joulinar commented 3 years ago

another report on the forum https://dietpi.com/phpbb/viewtopic.php?t=9227

@MichaIng should we created the group in advance?

MichaIng commented 3 years ago

I guess it happens on reinstalls only as we removed the group once, and the postinst script checks for the user only, and then expects the group to exist. So this is something that we should add to update patches instead. I'll verify and open a PR then.

MichaIng commented 3 years ago

Done with: https://github.com/MichaIng/DietPi/commit/14998ff875b5e0dcd6981d4def8d73b7e1c861d1