invalid cross-device link when downloading photos into folder symlinked from another device

Bug #1815546 reported by anarcat
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Rapid Photo Downloader
Triaged
Low
maruino2

Bug Description

I have recently moved my massive ~/Photos directory to a separate hard drive, so the setup is currently:

    lrwxrwxrwx 1 anarcat anarcat 11 2019-02-07 19:37 /home/anarcat/Photos -> /srv/Photos

I used to simply import pictures in that directory with RPD, but now it fails to import any picture with the following errors:

    Unable to create the photo DSCF8345.RAF in /home/anarcat/Photos/2019/02/09/sutton. The download file was DSCF8345.RAF in disk. It was not downloaded.
    Error: 18 Invalid cross-device link

Obviously, it’s simple to change the target directory in the GUI: just use /srv/Photos instead of ~/Photos but I feel it’s strange that such a mistake should occur - shouldn’t RPD be able to follow that symlink without such a glitch?

This was originally reported on the Pixls.us forum, where I was requested to file this as a bug:

https://discuss.pixls.us/t/invalid-cross-device-link-when-downloading-photos/11338

I also noticed this was previously mentioned as part of multiple bugs in https://bugs.launchpad.net/rapid/+bug/1320042.

Revision history for this message
Damon Lynch (dlynch3) wrote :

Please include in your bug report the log files, which are found in the log directory ~/.cache/rapid-photo-downloader/log. You can open this directory by clicking on the link in the "Report a Problem" dialog window. Please also include the configuration file found in the directory ~/.config/Rapid Photo Downloader/.

Revision history for this message
anarcat (anarcat) wrote :

logfile with the errors

Revision history for this message
anarcat (anarcat) wrote :

the config file, modified back to the original location (/home/anarcat/Photos) which triggered the failure. current location is /srv/Photos and works.

Revision history for this message
Damon Lynch (dlynch3) wrote :

I'm puzzled by this bug. When I use python to create a temporary directory within a directory pointed to by a symlink on my system, it first follows the symlink and then creates the temp dir, which is exactly the behavior I expect. In your case, for some reason it has not done that. Instead, it has created a temporary directory in your home directory. That is unexpected. Is there some kind of permission issue at play here, such as a mount folder being owned by root and not your user?

Revision history for this message
maruino2 (maruino2) wrote :

I ran into the same bug and resolved it (at least for myself) by replacing os.rename() with shutil.move() in line 753 of renameandmovefile.py (version 0.9.17). I got the idea from https://stackoverflow.com/questions/42392600/oserror-errno-18-invalid-cross-device-link

Revision history for this message
Damon Lynch (dlynch3) wrote :

I'm glad to hear you were able to resolve the problem @maruino2. A proper fix is still needed however, because doing a move of a file from location A to location B after having just copied it from location C is highly inefficient. Better to copy from C to B without the intermediary A. Please look at the code copyfiles.py and examine how to handle the situation that is arising with your file system setup.

Changed in rapid:
status: New → Triaged
assignee: nobody → maruino2 (maruino2)
importance: Undecided → Medium
Damon Lynch (dlynch3)
Changed in rapid:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.