Bug Copying exported library fails: "colons" in directory names conflicts with SMB
#1
Hi,

I wanted to make a bug/Issue report on kodi guthub, but there is suprisingly no "Issues" section :/.

I'm not sure whether this is a kodi related or a LibreELEC related issue, but as KODI is responsible for creating the library it might likely be a KODI issue rather than LibreELEC:

When I export the video library (single file) to SD Card (ext 4) on my Odroid C2 everything is fine at first. If you then try to copy this directory - which contains fanart, coverart and so on of tv shows and movies - this fails. It fails via SMB, but I'm not sure if this affects also NFS or so. The same happens if I export the Library to my external NTFS USB drive.

The issue is that some library directories have names like:

TRON:_Der_Aufstand

This is only one of at least 10 directories which have colons in its filenames, thus I cannot copy the Backup off the system to another system.
As filenames containing a colon are not allowed on NTFS and in windows (are they allowed on ext4 drives?), this behavior damages the filesystem on my NTFS HDD (connected to Odroid C2 running LibreELEC). At first I didn't notice it, because the directories were build during library export process on my SD-Card. But when I connected to the drive via SMB and tried to copy the backup before formatting the SD-Card, it was not possible. And it is also not possible to rename these directories :/. Also I can only get rid of this directories if I format the drive (NTFS drive with 3TB of data).

Image

Later I noticed this:
The faulty directories are there directly after exporting... I can see them in Kodi file manager and via SMB. But I get an error if I try to access them via SMB. But then suddenly when I connect this usb-device again to my windows Laptop afterwards, these directories are missing, I'm not sure what happens to them. Also a lot of other directories were not there anymore. I assume that all directories, which were written after the faulty one (containing this colon), are broken then and not visible or corrupted. I'm not sure if they occupy space on the disk, but I think they do, even though they cannot be accessed or found anymore, but they could be seen at first before reconnect.

The result of this is: The library backup (export) is broken immediately after doing the export because those colon-library entries are gone and some other folders which were written afterwards are also gone.

All this sounds a bit confusing (colon directories there at first, but not accessable and not deletable; then gone completely and taking other folders with them), but something strange is happening because of these colons in filenames, which should be avoided during creation of library (and backup) in the first place.
Reply
#2
My guess is we are using Unicode to access the filesystem, and haven't implemented the correct list of unallowed characters.

Kodi should adhere to these limitations
Code:
The following characters are invalid as file or folder names on Windows using NTFS:
/ ? < > \ : * | " and any character you can type with the Ctrl key

In addition to the above illegal characters the caret ^ is also not permitted under Windows Operating Systems using the FAT file system.

Under Windows using the FAT file system file and folder names may be up to 255 characters long
Under Windows using the NTFS file system file and folder names may be up to 256 characters long
Under Windows the length of a full path under both systems is 260 characters

In addition to these characters, the following conventions are also illegal:
Placing a space at the end of the name
Placing a period at the end of the name

The following file names are also reserved under Windows:
com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9, con, nul, and prn
Reply
#3
Thank you very much for your reply Kib. Meanwhile I've issued a ticket @trac.kodi.tv regarding this issue: http://trac.kodi.tv/ticket/16961#ticket
Haven't seen any feedback since then, but I hope it will be considered somewhen.
Reply

Logout Mark Read Team Forum Stats Members Help
Copying exported library fails: "colons" in directory names conflicts with SMB0