Downloaded subtitles are not saved 'Next to video' anymore

Clearly we had a serious miscomunication. You wrote:

and I assumed that this was when viewed from within OSMC. So scratch everything I wrote about user ftp - it was a false lead. That said, you didn’t demonstrate that you can create a file on the NFS mount (/mnt/NAS). You created the file in /home/osmc.

The duplicates are undestandable. Are you saying that it successfully saved the subtitles to /mnt/NAS?

Hi @dillthedog,

demonstrate that you can create a file on the NFS mount (/mnt/NAS)

osmc@osmc:~$ sudo -s
root@osmc:/home/osmc# sudo -u osmc touch /mnt/NAS/_magweg/osmc-test.txt
root@osmc:/home/osmc# cd /mnt/NAS/_magweg/
root@osmc:/mnt/NAS/_magweg# ls -l
total 4
-rw-r--r-- 1 nobody nogroup    0 Jun 26 07:21 osmc-test.txt 

Existing files and directories on my NAS have u/g 98:osmc (they were written there via my FTP client):

drwxrwxr-x 2 98 osmc 4096 Mar 11 07:45 Season 02
drwxrwxr-x 2 98 osmc 4096 Oct 10  2018 Season 03
drwxrwxr-x 2 98 osmc 4096 Dec  4  2018 Season 04

Are you saying that it successfully saved the subtitles to /mnt/NAS?

No, I meant I did the ‘download subtitles’-process, but I didn’t actually see them saved next to the video.

I also took a look (seen from within OSMC) at the user:group of the files that were written to the custom folder (as done above in Downloaded subtitles are not saved 'Next to video' anymore - #10 by Jarown):

root@osmc:/mnt/NAS_public/subtitles# ls -l
total 124
-rw-r--r-- 1 nobody nogroup 49211 Jun 15 11:05 1411.nl.srt
-rw-r--r-- 1 nobody nogroup 61878 Jun 17 23:01 727.en.ssa

If looks like the NAS is creating files with anonuid / anongid, which is generlly fine but here the permission of the Season 02/03/04 directories is 775, meaning that only UID 98 and GID osmc can write to the directory. What happens if you try to create a file inside Season 02?

Hi @dillthedog,

I did a couple of tests, all with the same outcome.

  1. Writing the file to Season 02:

.

root@osmc:/home/osmc# sudo -u osmc touch /mnt/NAS/Gold\ Rush/Season\ 02/osmc-test.txt
root@osmc:/home/osmc# ls -l /mnt/NAS/Gold\ Rush/Season\ 02/o*
-rw-r--r-- 1 nobody nogroup 0 Jun 27 07:09 /mnt/NAS/Gold Rush/Season 02/osmc-test.txt 
  1. Writing the file to Season 01:

Season 01 has 777 permissions and gives the same result:

drwxrwxrwx 2 98 osmc 4096 Jun 26 07:29 Season 01

root@osmc:/home/osmc# sudo -u osmc touch /mnt/NAS/Gold\ Rush/Season\ 01/osmc-test.txt
root@osmc:/home/osmc# ls -l /mnt/NAS/Gold\ Rush/Season\ 01/o*
-rw-r--r-- 1 nobody nogroup 0 Jun 27 07:10 /mnt/NAS/Gold Rush/Season 01/osmc-test.txt
  1. Writing the file to NAS/public:

Same result when writing to the NAS/public mount:

192.168.11.14:/DataVolume/public on /mnt/NAS_public type nfs (rw,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.11.14,mountvers=3,mountport

Rights on this dir:

drwxrwxr-x 2 98 osmc 4096 Jun 27 07:13 subtitles

Writing the file:

root@osmc:/home/osmc# sudo -u osmc touch /mnt/NAS_public/subtitles/osmc-test.txt
root@osmc:/home/osmc# ls -l /mnt/NAS_public/subtitles/o*
-rw-r--r-- 1 nobody nogroup 0 Jun 27 07:13 /mnt/NAS_public/subtitles/osmc-test.txt

Then I’m out of ideas for now. I’ll see if I can reproduce the behaviour this weekend. Which subtitle downloader are you using?

I did my tests using the official service.subtitles.opensubtitles addon. I also use service.subtitles.addic7ed sometimes (install from zip), which has the same problem btw.

I’m curious if you can reproduce it. Only thing I could think of is looking into the logs again when saving a subtitle to the mounted NAS (a Seagate BlackArmor NAS 110).

Speaking of which. In my posted logs I saw (when testing save location ‘Next to the video’):

2019-06-18 21:09:58.956 T:1765061344 DEBUG: OnDownloadComplete - Saved subtitle /home/osmc/.kodi/userdata/addon_data/service.subtitles.opensubtitles/temp/f7750c76-fdd0-4cb8-b32c-6122c17de5fe.ssa to special://temp/727.en.ssa

What does special: mean? I would’ve expected so see the nfs: path over there.

https://kodi.wiki/view/Special_protocol

Hi @nabsltd,

Thanks for the info. So we have the following 2 situations.

  1. Subtitle save-target is set to ‘Custom location’

Subtitle is saved to the specified nfs: location (file is indeed saved at that location):

2019-06-15 11:05:03.261 T:1378869984 DEBUG: OnDownloadComplete - Saved subtitle /home/osmc/.kodi/userdata/addon_data/service.subtitles.opensubtitles/temp/bd71830c-aade-47a1-a4b5-c7b7bb40edf7.srt to nfs://192.168.11.14/DataVolume/public/subtitles/1411.nl.srt

  1. Subtitle save-target is set to ‘Next to the video’:

Subtitle is saved to special://temp/ path (file is not saved next to the video):

2019-06-18 21:09:58.956 T:1765061344 DEBUG: OnDownloadComplete - Saved subtitle /home/osmc/.kodi/userdata/addon_data/service.subtitles.opensubtitles/temp/f7750c76-fdd0-4cb8-b32c-6122c17de5fe.ssa to special://temp/727.en.ssa

So, trying to get the facts straight: is 2. expected behaviour (‘next to video’-setting always writes the subtitle-file to special://temp/), or do we expect to see an nfs:// path there as well?

My guess is that something has changed in v18 that caused these subtitle add-ons to change behavior.

Asking in the Kodi forum for the add-on is probably the best bet, since if anybody has the same issue and isn’t running OSMC, then it’s almost certainly a problem with the add-on.

Haven’t had a lot of time this evening but I just tried to save some subtitles to a locally-mounted pendrive. It works:

2019-06-28 22:36:33.821 T:3360445152 DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes Fire And Rescue.en.srt to /media/ADATA UFD/Kids/Planes Fire And Rescue.en.srt

Since /media/ADATA UFD could equally have been an NFS mount, I’ll try with an NFS mount next. In case it makes a difference, the file was accessed via Videos > Files, rather than Movies.

Works with an NFS mount:

2019-06-30 16:33:03.933 T:3409986272   DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes Fire And Rescue.en.srt to /mnt/kids/Planes Fire And Rescue.en.srt
osmc@osmc-4k:~/.kodi/temp$ ls -l /mnt/kids
total 832508
-rw-r--r-- 1 osmc osmc     97501 Jun 30 16:33 Planes Fire And Rescue.en.srt
-rw-r--r-- 1 osmc osmc 852385098 Jun 30 16:24 Planes Fire And Rescue.m4v

I copied the file across to an NFS server, added thie source, /mnt/kids, via Videos > Files and allowed Kodi to scan it.

So far, I can’t reproduce the error. Any suggestions what to try next?

Update: Removed the kernel-based mount (/mnt/kids) from Kodi and added the Kodi-based NFS source. It still works:

osmc@osmc-4k:~/.kodi/temp$ grep -i ondownloadcomplete kodi.log
2019-06-30 18:01:42.922 T:3710976736   DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes Fire And Rescue.en.srt to nfs://192.168.8.3/mnt/usbdrive/Other/kids/Planes Fire And Rescue.en.srt
osmc@osmc-4k:~/.kodi/temp$ ls -l /mnt/kids
total 832508
-rw-r--r-- 1 osmc osmc     97501 Jun 30 18:01 Planes Fire And Rescue.en.srt
-rw-r--r-- 1 osmc osmc 852385098 Jun 30 16:24 Planes Fire And Rescue.m4v

Hi @dillthedog,

Thanks for testing! Somehow writing to a NFS mount seems to work for me all of a sudden. I don’t know why it didn’t the previous time I checked.

One question about your configuration: do you have the problem with the ‘Save location’-setting as well? Or is your chosen setting actually stored and used? If it’s only the case for me, maybe something is corrupt and is reinstalling osmc worth trying.

For completeness, here the tests scenarios I performed (with log excerpts):

  1. writing to a read-only HDD mount

Mount info:

/dev/sdb1 on /media/BUFFALO type hfsplus (ro,nosuid,nodev,relatime,umask=22,uid=0,gid=0,nls=utf8,uhelper=udisks)

Logs show that saving fails and fallback is used:

2019-06-30 12:59:34.098 T:1423950560 DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes 2 - Fire & Rescue (2014).nl.srt to /media/BUFFALO/kids/Planes 2 - Redden en Blussen [2014]/Planes 2 - Fire & Rescue (2014).nl.srt
2019-06-30 12:59:34.099 T:1423950560 WARNING: OnDownloadComplete - Saving of subtitle special://temp/Planes 2 - Fire & Rescue (2014).nl.srt to /media/BUFFALO/kids/Planes 2 - Redden en Blussen [2014]/Planes 2 - Fire & Rescue (2014).nl.srt failed. Falling back to special://temp

  1. writing to a read-write HDD mount

Log show succesful save:

2019-06-30 13:04:36.801 T:1538245344 DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes 2 - Fire & Rescue (2014).nl.srt to /media/BUFFALO/kids/Planes 2 - Redden en Blussen [2014]/Planes 2 - Fire & Rescue (2014).nl.srt

  1. writing to a read-write NAS mount

Mount info:

192.168.11.14:/DataVolume/Series on /mnt/NAS type nfs (rw,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.11.14,mountvers=3,mountport=656,mo

Logs show succesful save:

2019-07-01 07:23:01.958 T:1392505568 DEBUG: OnDownloadComplete - Saving subtitle special://temp/Knight.Rider.S01E01.Knight.of.the.Phoenix.1.SD.TV-SiCKBEARD.nl.srt to /mnt/NAS/Knight Rider/Season 01/Knight.Rider.S01E01.Knight.of.the.Phoenix.1.SD.TV-SiCKBEARD.nl.srt

The only problem I found is that I couldn’t remove the custom location via the GUI. It required an edit of guisettings.xml.

With a custom location set but the subtitle storage location set to “next to video”, I found that the subtitles were temporarily saved in the custom location (as opposed to in special://temp) but then correctly moved next to the video. All in all, it appears to work just fine for me.

What I noticed from your log snippets is that when it wasn’t working correctlly, we saw:

2019-06-18 21:09:58.956 T:1765061344 DEBUG: OnDownloadComplete - Saved subtitle /home/osmc/.kodi/userdata/addon_data/service.subtitles.opensubtitles/temp/f7750c76-fdd0-4cb8-b32c-6122c17de5fe.ssa to special://temp/727.en.ssa

ie a temporary file name in a temporary add-on directory is copied to special://temp, but when it was working, it goes from special://temp to the correct location and with the correct file name:

2019-06-30 13:04:36.801 T:1538245344 DEBUG: OnDownloadComplete - Saving subtitle special://temp/Planes 2 - Fire & Rescue (2014).nl.srt to /media/BUFFALO/kids/Planes 2 - Redden en Blussen [2014]/Planes 2 - Fire & Rescue (2014).nl.srt

Notice how the first message says “Saved” and the second one says “Saving”.

I’ve not experienced any significant problems so either you’re doing something wrong or there’s something slightly misconfigured (or corrupted) on your system. At this point, I’d be inclined to reinstall.

So removing the custom location via the GUI is actually a bug (what’s the correct place to report that, Issues · xbmc/xbmc · GitHub ?).

At this point, I’d be inclined to reinstall.

I will give that a try! I also found that ‘solution’ here :slight_smile: Subtitles not downloading/saving properly

I have no idea what the issue was but it was REALLY annoying me that it wasn’t working and I was REALLY bored so I just formatted my box and started over from scratch

Thanks for the time and support!

The main problem is not being able to remove the custom location via the GUI. I’ll mark that workaround (edit guisettings.xml) als solution.

Solution for not being able to write subtitle-files is (in my case): using the kernel-based mount instead of the Kodi-based NFS source.

This tutorial was helpful for auto-mounting at boot:

2 Likes

I have the same problem with Kodi 18.4. In my case, I am running Kodi on PC and Android all connected to a Synology NAS.

The nas folder structure and permissions hasn’t changed and all boxes are configured the same way over nfs.

This setup always worked in the past but I just recently noticed that subs are no longer stored next to video.

Have you guys found a solution?

Have you tried any of the suggestions in this thread?

I thought i had solved the issue by deleting guisettings.xml. It worked once, then after restarting Kodi it stopped saving them next to video. By the way, I’m running Kodi on PC now and have the same issue.

In guisettings.xml setting id=“subtitles.custompath” default=“true”>
/setting> is always empty. I tried changing interfaces, putting 0 and false in this field but it is always overwritten. What other file could be overwriting guisettings?

In order to edit that file you must stop Kodi first. When it loads the file on startup it will remove any path it doesn’t like. I had this issue with it not wanting to let me set an artist information folder. I went round and round till I found the way to set a custom media source and then I was able to get it to go. More specifically, I could get it to take if I included credentials, but I really didn’t want to do that. If you wanted to you would add the source as smb://username:password@ipaddress/yada/yada/. If you want it to do it a better way try what I outlined in this other thread and then just browse to it from the gui in the normal way.

Or you should be able to use system mounts to work around the issue as well.

I might have another angle of approach for analyzing/solving this issue.

Yesterday, I navigated to an episode of a television series. Since the episode wasn’t added to my Series library yet, I navigated via menu ‘Files > SMB-share > NAS > …’. I started the episode, downloaded subtitles and they were saved Next to the video (on my NAS)!

When I navigate to the episode via the ‘Series’ menu item, they still aren’t saved ‘Next to the video’.