NZBGet - Error reading diskstate - after migration

Creating a bug report/issue

Required Information

  • DietPi version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=15
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’

  • Distro version
    bullseye

  • Kernel version
    Linux DietPi 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

  • SBC model
    Native PC (x86_64)

  • Power supply used
    OEM

  • SD card used
    USB/eMMC
    NZBGet

  • Was the software title installed freshly or updated/migrated?
    migrated from buster (clean install on new drive and copy across userdata folder as per migration blog post)

  • Can this issue be replicated on a fresh installation of DietPi?
    uncertain

  • Bug report ID
    24d8fd46-ac19-46a3-9458-e9f119c5ac84

Steps to reproduce

  1. clean install dietpi
  2. copy old install /mnt/dietpi_userdata and /var/www folders onto new install
  3. install required software (NZBGet Sonarr, Radarr, Vaultwarden)
  4. launch web UI for NZBGet and attempt to add download or reload history
    This appears to be an issue where the nzbget user does not have read write access to the download folder

Expected behaviour

NZBGet should be able to add downloads and read log files

Actual behaviour

NZBGet is unable to add downloads and read log files

Extra details

the following errors are given by the NZB client:

Kind Time Text
ERROR Sun Mar 19 2023 00:03:55 Could not create file /mnt/dietpi_userdata/downloads/tmp/nzb-1.tmp
ERROR Sat Mar 18 2023 23:48:21 Error reading diskstate: could not open file /mnt/dietpi_userdata/downloads/queue/history:
ERROR Sat Mar 18 2023 23:48:21 Error reading diskstate: could not open file /mnt/dietpi_userdata/downloads/queue/stats:
INFO Sat Mar 18 2023 23:48:21 nzbget 21.1 daemon-mode

I think I may have had this issue previously and I needed to chmod to add access to the folder but I tried adding the nzbget user to the dietpi group so that it could access the /mnt/dietpi_userdata/downloads folder and i didn’t have any luck using the following:
usermod -a -G dietpi nzbget

the permissions appear as follows:
drwxrwxr-x 9 dietpi dietpi 4.0K Mar 18 23:12 downloads

I am probably missing something obvious here, please help.

Can you share

ls -la /mnt/dietpi_userdata/downloads/

Thanks @Joulinar

I see the problem, I copied the old data across as root so all the folders are now owned by the root user…

I think that I should have use the - p option to preserve ownership, is there an easy way to retrospectively fix the permissions? I assume that this will be a problem for my other apps too.

root@DietPi:~# ls -la /mnt/dietpi_userdata/downloads/
total 340
drwxrwxr-x  9 dietpi dietpi   4096 Mar 18 23:12 .
drwxrwxr-x 24 dietpi dietpi   4096 Mar 18 22:32 ..
drwxr-xr-x  2 root   root     4096 Mar 18 22:14 abook
drwxr-x---  5 root   root     4096 Mar 18 22:13 complete
drwxr-xr-x  4 root   root     4096 Mar 18 22:14 ebook
drwxr-x--- 12 root   root     4096 Mar 18 22:13 intermediate
drwxr-xr-x  2 root   root   294912 Mar 18 22:14 nzb
-rw-r-----  1 nzbget dietpi      4 Mar 18 23:48 nzbget.lock
drwxr-xr-x  2 root   root     4096 Mar 18 22:14 queue
drwxr-xr-x  2 root   root     4096 Mar 18 22:14 tmp
-rw-r--r--  1 root   root     8632 Mar 18 22:11 weewx-mqtt.zip

Beste would be to copy folders again is still available. All other options would be guessing on what permission/ownership it was before.

Thanks @Joulinar I didn’t have a lot of services on my installation so it was quite easy to fix it up (just needed to chown the right dirs in the download directory) with the respective chown commands. Jellyfin didn’t like the migration so I deleted its userdata and started fresh.

Thanks for the help :+1:

ok great, I mark your post as solved.

1 Like