Files don't get moved: Log shows "exiftool FAILED..."
I noticed files weren’t being moved. I checked the log at /var/packages/Medio/target/medio.log and saw a bunch of logs like this:
[Tue Jan 4 19:48:05 2022] exiftool FAILED for /var/services/photo/Unorganized/IMG_4530.HEIC: Warning: Error creating '/var/services/photo/2021/12_Dec/20211230_203046.HEIC' - /var/services/photo/Unorganized/IMG_4530.HEIC
Comments (3)
-
reporter -
reporter - changed status to closed
Issue must be resolved manually and won't be an issue going forward.
-
Hi Jonathan.
I've been spending some time solving this issue. I have no UNIX/LINUX experience, so I had to run a crash course to get familiar with SSH and its commands. After figuring out how the chown works and running the command, it did not solve the problem. I found out from the log that I had this error
PermissionError: [Errno 13] Permission denied: '/var/services/photo/Unorganized'
After changing the chmod to 755 for my folders (and files are 644), it finally works. With the exception of /Unorganized (777).
My upgrade to DSM 7.0 reset all my permissions. Maybe you can update your instructions for others. Also, add it to your wiki. It took me months before I finally found and tried this solution.
To summarize, what helped me is:
sudo -i
sudo chown Medio:Medio /var/services/photo/Unorganized
chmod 777 /var/services/photo/Unorganized
sudo chown Medio:Medio /var/services/photo/2021
chmod 755 /var/services/photo/2021
sudo chown Medio:Medio /var/services/photo/2021/01_Jan
chmod 755 /var/services/photo/2021/01_Jan
etc …
All the best,
Remco - Log in to comment
Explanation
This is caused by a change in how package permissions work between DSM 7 and previous DSM versions. In previous versions, packages typically ran as root. In DSM 7, third-party packages can’t run as root. They typically run as a new user with the same name as package.
So this issue happens when you have a directory that was created by Medio running on an older DSM as root and then after you update to DSM7 and the new Medio, it can’t modify anything in the directory owned by root.
Fix
You’ll need to change the permissions on the destination directory to be owned by Medio instead of root.
You have to do this in the shell, as the Medio user is not listed in the UI file manager.
You only need to do this for directories where Medio will be writing into. It probably won’t be placing new photos into old directories, so no need to change all the old directories.
Once you’ve done this, simply stop and start Medio to get it to try to move those files again and it should work.