Database Issues and File Permission Weirdness

Sonarr version (exact version): 2.1

OS:
Open Media Vault 6.9.10-5 (Shaitan)
(Installed on top of Debian 11)

Debug logs:

Debug log
pass: N^rFVczBMHo!PNiMb&eUD2Yn!*4KMX$ra*Rn

Description of issue:
Sonarr runs fine for some period of time however eventually it crashes because it is unable to open it’s database file.

image

After restarting the container and checking the Events queue I usually see something along these lines:

This seems like it could be a simultaneous access issue OR a file permissions issue. I suspect file permissions because Sonarr is also unable to rename certain shows. I am having other similar issues with radarr and transmission that I suspect are the same problem. They are more explicitly file permission issues (ie. I have error messages that say as much) with radarr and transmission. I suspect these are all related but I am having trouble narrowing down what is causing them as in all cases the problem comes and goes.

But getting a shell into the Sonarr container to take a look at the permissions on the database file it does have r/w inside the container (not sure if x is necessary? seems like it could be).

Inside the container:

# ls -al config 
total 7980
drwx------ 5 abc  users    4096 Dec 18 17:59 .
drwxr-xr-x 1 root root     4096 Dec 18 16:55 ..
drwxr-xr-x 3 abc  users    4096 Dec 16 19:38 .config
-rw-r--r-- 1 abc  users     486 Dec 18 17:40 config.xml
drwxr-xr-x 2 abc  users    4096 Dec 18 16:59 logs
-rw-r--r-- 1 abc  users 2650112 Dec 18 17:40 logs.db
-rw-r--r-- 1 abc  users   32768 Dec 18 17:59 logs.db-shm
-rw-r--r-- 1 abc  users  490312 Dec 18 17:59 logs.db-wal
drwxr-xr-x 9 abc  users    4096 Dec 17 14:34 MediaCover
-rw-r--r-- 1 abc  users 4804608 Dec 18 17:59 sonarr.db
-rw-r--r-- 1 abc  users   32768 Dec 18 17:59 sonarr.db-shm
-rw-r--r-- 1 abc  users  103032 Dec 18 18:00 sonarr.db-wal
-rw------- 1 abc  users     178 Dec 16 20:22 sonarr.env
-rw-r--r-- 1 abc  users       3 Dec 18 17:40 sonarr.pid
-rw------- 1 abc  users     804 Dec 16 23:05 sonarr.yml

Outside the container:

/$ sudo ls -al appdata/sonarr/
total 8104
drwx------   5 dockeruser users    4096 Dec 18 17:59 .
drwxrwsr-x+ 10 dockeruser arr      4096 Dec 16 20:23 ..
drwxr-xr-x   3 dockeruser users    4096 Dec 16 19:38 .config
drwxr-xr-x   9 dockeruser users    4096 Dec 17 14:34 MediaCover
-rw-r--r--   1 dockeruser users     486 Dec 18 17:40 config.xml
drwxr-xr-x   2 dockeruser users    4096 Dec 18 16:59 logs
-rw-r--r--   1 dockeruser users 2650112 Dec 18 17:40 logs.db
-rw-r--r--   1 dockeruser users   32768 Dec 18 17:59 logs.db-shm
-rw-r--r--   1 dockeruser users  490312 Dec 18 17:59 logs.db-wal
-rw-r--r--   1 dockeruser users 4804608 Dec 18 17:59 sonarr.db
-rw-r--r--   1 dockeruser users   32768 Dec 18 18:03 sonarr.db-shm
-rw-r--r--   1 dockeruser users  226632 Dec 18 18:04 sonarr.db-wal
-rw-------   1 dockeruser users     178 Dec 16 20:22 sonarr.env
-rw-r--r--   1 dockeruser users       3 Dec 18 17:40 sonarr.pid
-rw-------   1 dockeruser users     804 Dec 16 23:05 sonarr.yml

All of the Docker containers are run under the dockeruser that has read/write permissions for all of the directories docker uses and the media directories I am trying to have Sonarr/Radarr manage. I also created a arr group that has read/write permissions to all the same directories.

I have verified:

  1. The Docker containers are being run as the dockeruser
  2. I have checked the file permissions in/outside of the container and they match dockeruser (via PUID/PGID).
  3. I have checked the file permissions in the OMV GUI as well.

This is the Docker compose file I am using:

version: "2.1"
services:
  sonarr:
    image: lscr.io/linuxserver/sonarr:latest
    container_name: sonarr
    network_mode: "container:gluetun-gluetun-1" # Use gluetun container's network
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - /appdata/sonarr:/config
      - ${TV}:/data/tv #optional
      - ${TV}:/downloads/complete/tv
      - ${INCOMPLETE}:/downloads/incomplete/tv
    #ports: # Mapped in gluetun container
      #- 8989:8989
    restart: unless-stopped

TV and INCOMPLETE are global variables of absolute paths set through OMV’s GUI.

TV=/srv/dev-disk-by-uuid-59566636-73e4-4914-9a37-489ad3a40e1a/media/video/tv
INCOMPLETE=/srv/dev-disk-by-uuid-59566636-73e4-4914-9a37-489ad3a40e1a/download/incomplete

Yes, I have mapped the complete folder to the same directory as TV. This is deliberate and worked without issue on the Pi but is maybe part of what is causing the problem.

It currently works for Sonarr - ie. Sonarr is able import once transmission gives it the go ahead. For whatever reason it does not work for Radarr even though the mapping is effective identical just to a /movies directory instead.

I also have a post on the OMV forum that has some additional details.

Instructions say to post a debug log as a .txt

Before that the instructions also say, Do not post them directly here. There’s also a link with more information - Sonarr Troubleshooting | Servarr Wiki.

Ahha! I am once more foisted upon my own inability to read! I have had added the log file.

What is the password?

N^rFVczBMHo!PNiMb&eUD2Yn!4KMX$raRn

N^rFVczBMHo!PNiMb&eUD2Yn!*4KMX$ra*Rn

^ fixed

:man_facepalming:
Oh my goodness. Apologies, but also that’s a neat trick? I’m not sure how I posted the wrong password twice or how you fixed it?

Click the preformatted text button </> or use Ctrl + E on a new line.

Ooooh I see now. Markdown is happening. Gotcha.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.