[Errno 5] I/O error

Good evening,

I am getting io errors in a program called "Bazarr" ("GitHub - morpheus65535/bazarr: Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.") in a docker container in proxmox in lxc container.
"Traceback (most recent call last):  File "/app/bazarr/bin/bazarr/subtitles/uti - Pastebin.com"
After doing a ton of research and returning my drives with warranty I have a strong feeling something is not right with my rclone setup.

rclone v1.59.0
- os/version: debian 11.4 (64 bit)
- os/kernel: 5.15.35-3-pve (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.3
- go/linking: static
- go/tags: none

I am on the latest version of rclone. As you can see above.

I use google drive as my storage provider.

[Unit]
Description=Gmedia RClone Mount Service
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount \
  --config=/root/.config/rclone/rclone.conf \
  --log-level=INFO \
  --log-file=/pool/data/data/config/rclone/logs/rclone-mount.log \
  --user-agent=***** \
  --umask=007 \
  --gid=100000 \
  --uid=100000 \
  --allow-other \
  --timeout=1h \
  --poll-interval=15s \
  --tpslimit 10 \
  --buffer-size=512M \
  --dir-cache-time=1000h \
  --cache-dir=/pool/data/data/config/rclone/cache/gmedia \
  --vfs-cache-mode=full \
  --vfs-cache-max-size=150G \
  --vfs-cache-max-age=1000h \
  gdrive-media-crypt: /pool/data/data/gmedia-cloud
ExecStop=/bin/fusermount -uz /pool/data/data/gmedia-cloud
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
[Unit]
Description=Gmedia MergerFS Mount
Requires=gmedia.service
After=gmedia.service

[Service]
Type=forking
ExecStart=/usr/bin/mergerfs /pool/data/data/gmedia-local:/pool/data/data/gmedia-cloud /pool/data/data/gmedia -o rw,nonempty,use_ino,allow_other,func.getattr=newest,category.action=all,category.create=ff,cache.files=auto-full
ExecStop=/bin/fusermount -uz /pool/data/data/gmedia
KillMode=none
Restart=on-failure

[Install]
WantedBy=multi-user.target
[gdrive-media]
type = drive
client_id =
client_secret =
scope = drive
root_folder_id =
service_account_file = ~/.config/rclone/service.json
team_drive = ****

[gdrive-media-crypt]
type = crypt
remote = gdrive-media:/media
password = ***
password2 = ***

My media files are owned by user 100000 inside the lxc container and all of my docker container use that user and group with chmod 660 on files and 770 on folders (umask 007). So I don't think it's a permission issue either.

Thanks in advance.

Night

The IO error will have a corresponding ERROR log from rclone. Find that and it shouldn't explain what is happening.

The only thing I see in the rclone-mount.log is "vfs cache removednotinuse. Like a million times

Use grep or similar tool to look for the string ERROR

Sorry for the late response. I have changed my entire setup. Different distro and everything is set up a lot simpler. However I am still getting the io errors. the rclone-mount.log file doesn't give any debug information for errors like this. Only thing it says is when it's clearing the cache. It has to be something with the cloud files. Newly imported files are getting new subtitles. Cloud files from rclone are getting the io errors. I think the software can't access certain information of the files it needs to get the right subtitles.

Do you have any idea how to fix this and otherwise someone who can help me. The developer of the software "Bazarr" says he can't help me because io errors mean that there's something wrong with my drives. Well, that's definitely not it because I've recently replaced my drives with warranty.

It's a permission / local issue.

You'd have to step through what the software runs as that user and do some troubleshooting.

Should be related to your docker setup.

But local files aren't getting any errors. How is there a difference?

Local meaning not a rclone issue and something to do with your docker / container setup.

I don't use docker for rclone but I do use docker for plex/sonarr/radarr/bazarr/etc. It all runs as the same ID/GID.

So in my world, permissions are fine as I use the same PUID/GUID for everything:

  bazarr:
   image: lscr.io/linuxserver/bazarr:latest
   container_name: bazarr
   environment:
     - PUID=1000
     - PGID=1000

So do I. I run rclone bare metal and bazarr and other docker containers as the same user.

You can do a test and see what you can see.

So my test looks good as an example:

felix@gemini:~$ docker exec --user abc -it bazarr bash
bash: /root/.bashrc: Permission denied
abc@361822c7647b:/$ cd /media
abc@361822c7647b:/media$ cd TV
abc@361822c7647b:/media/TV$ cd ..
abc@361822c7647b:/media$ ls -al
total 0
drwxr-xr-x 1 root root   44 Jul 31 04:48 .
drwxr-xr-x 1 root root  246 Jul 31 04:48 ..
drwxrwxr-x 1 abc  users   0 Jul 28 08:48 Movies
drwxrwxr-x 1 abc  users   0 Jul 28 08:48 TV
drwxr-xr-x 1 root root    0 Jul 26 12:37 cdrom
drwxr-xr-x 1 root root    0 Jul 26 12:37 floppy
drwxr-xr-x 1 root root    0 Jul 26 12:37 usb

Run through the user and see what the permissions errors are.

I run bazarr and the other containers as root

Okay. Found somehting maybe. I can't change the permissions of those files to 777. they always stay 666.

I think I know why local files work and cloud files don't. Local files have chmod 777 because that's what I tell sonarr/radarr to give them. However when uploaded to the cloud rclone is giving them chmod 666 and I can't change it manually with commands. In my systemd rclone mount I have umask 000. With umask it's usually the case that folders will get a higher chmod than files. Umask 000 for example is 777 for folders and 666 for files. I think bazarr needs to have executive permissions in order to obtain certain information about the files?

How can I configure rclone to also give chmod 777 to files?

Okay I added --dir-perms and --file-perms 777. Bazarr has litteraly every permission in the world right now but still getting the error.

You'd have to share the full command you are running and what the output looks like.

I already shared my rclone mount systemd's. Only they now have those perms commands as well.

It's just much easier to share the updated command and the output and what you want to happen as opposed to what you are seeing.

I can't see your server/session so ensuring you share what you are running just makes things smoother as no one is guessing what you may or may not have added.

If that's too much to add in, I'm not sure what else to offer.

[Unit]
Description=Gmedia RClone Mount Service
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount \
  --config=/root/.config/rclone/rclone.conf \
  --log-level=INFO \
  --log-file=/srv/mergerfs/pool/config/rclone/logs/rclone-mount.log \
  --user-agent=***** \
  --umask=000 \
  --dir-perms 0777 \
  --file-perms 0777 \
  --gid=0 \
  --uid=0 \
  --allow-other \
  --timeout=1h \
  --poll-interval=15s \
  --tpslimit 10 \
  --buffer-size=512M \
  --dir-cache-time=1000h \
  --cache-dir=/srv/mergerfs/pool/config/rclone/cache/gmedia \
  --vfs-cache-mode=full \
  --vfs-cache-max-size=150G \
  --vfs-cache-max-age=1000h \
  gdrive-media-crypt: /srv/mergerfs/pool/gmedia-cloud
ExecStop=/bin/fusermount -uz /srv/mergerfs/pool/gmedia-cloud
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
[Unit]
Description=Gmedia MergerFS Mount
Requires=gmedia.service
After=gmedia.service

[Service]
Type=forking
ExecStart=/usr/bin/mergerfs /srv/mergerfs/pool/gmedia-local:/srv/mergerfs/pool/gmedia-cloud /srv/mergerfs/pool/gmedia -o rw,nonempty,use_ino,allow_other,func.getattr=newest,category.action=all,category.create=ff,cache.files=auto-full,dropcacheonclose=true
ExecStop=/bin/fusermount -uz /srv/mergerfs/pool/gmedia
KillMode=none
Restart=on-failure

[Install]
WantedBy=multi-user.target

I am not running any command. It's just bazarr that is giving the error whenever it's searching for subtitles.

BAZARR Error ([Errno 5] I/O error) trying to get video information for this file: /data/tvshows_shared/Game of Thrones/Season 06/Game of Thrones (2011) - S06E01 - The Red Woman [HDTV-1080p].mkv
Traceback (most recent call last):
  File "/app/bazarr/bin/bazarr/subtitles/utils.py", line 39, in get_video
    video = parse_video(path, hints=hints, providers=providers, dry_run=used_scene_name,
  File "/app/bazarr/bin/bazarr/../libs/subzero/video.py", line 61, in parse_video
    return scan_video(fn, hints=hints, dont_use_actual_file=dry_run, providers=providers,
  File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/core.py", line 799, in scan_video
    video.hashes[\'opensubtitles\'] = osub_hash = osub_hash or hash_opensubtitles(hash_path)
  File "/app/bazarr/bin/bazarr/../libs/subliminal/utils.py", line 32, in hash_opensubtitles
    filebuffer = f.read(bytesize)
OSError: [Errno 5] I/O error

From the bazarr docker, test out and share the permissions on the mergerfs mount and the rclone locations.

docker exec -it bazarr bash
ls -al /data/tvshows_shared/Game of Thrones/Season 06/Game of Thrones (2011) - S06E01 - The Red Woman [HDTV-1080p].mkv
head /data/tvshows_shared/Game of Thrones/Season 06/Game of Thrones (2011) - S06E01 - The Red Woman [HDTV-1080p].mkv

and on the rclone mount

ls -al /srv/mergerfs/pool/gmedia-cloud/tvshows_shared/Game of Thrones/Season 06/Game of Thrones (2011) - S06E01 - The Red Woman [HDTV-1080p].mkv
head /srv/mergerfs/pool/gmedia-cloud/tvshows_shared/Game of Thrones/Season 06/Game of Thrones (2011) - S06E01 - The Red Woman [HDTV-1080p].mkv

Share the output of those.