TheLastGimbus / GooglePhotosTakeoutHelper

Script that organizes the Google Takeout archive into one big chronological folder
https://aur.archlinux.org/packages/gpth-bin
Apache License 2.0
3.46k stars 176 forks source link

Unhandled exception: (OS Error: Cross-device link, errno = 18) #314

Open jwilleke opened 1 month ago

jwilleke commented 1 month ago

Crashed


Do you want your photos in one big chronological folder, or divided to folders by year/month?
[1] (default) - one big folder
[2] - year/month folders
(Type 1 or 2 or press enter for default):
2
Okay, will divide to folders!

What should be done with albums?
[0] shortcut: [Recommended] Album folders with shortcuts/symlinks to original photos. Recommended as it will take the least space, but may not be portable when moving across systems/computes/phones etc
[1] duplicate-copy: Album folders with photos copied into them. This will work across all systems, but may take wayyy more space!!
[2] json: Put ALL photos (including Archive and Trash) in one folder and make a .json file with info about albums. Use if you're a programmer, or just want to get everything, ignoring lack of year-folders etc.
[3] nothing: Just ignore them and put year-photos into one folder. WARNING: This ignores Archive/Trash !!!
3
Okay, doing: nothing

Okay, running... searching for everything in input folder...
Finding duplicates...
...
...
Finding albums (this may take some time, dont worry :) ...
Moving photos to output folder : ........................................ 0/51950  Unhandled exception:
FileSystemException: Cannot rename file to '/Volumes/hd3/google-photos-out/ALL_PHOTOS/1890/01/1575217472468-fc189425-88ba-4932-b97d-198aadadb(1).jpg', path = '/Volumes/hd4/tower-google-takeput/Photos from 1890/1575217472468-fc189425-88ba-4932-b97d-198aadadb(1).jpg' (OS Error: Cross-device link, errno = 18)
#0      _checkForErrorResponse (dart:io/common.dart:55)
#1      _File.rename.<anonymous closure> (dart:io/file_impl.dart:335)
<asynchronous suspension>
#2      moveFiles.moveFile (package:gpth/moving.dart:135)
<asynchronous suspension>
#3      moveFiles (package:gpth/moving.dart:140)
<asynchronous suspension>
#4      main.<anonymous closure> (file:///Users/runner/work/GooglePhotosTakeoutHelper/GooglePhotosTakeoutHelper/bin/gpth.dart:373)
<asynchronous suspension>

Let me know how I can help!

TheriomGit commented 4 weeks ago

I have a similar issue with Windows. The program crashes during the Finding albums step without progress. I found in the output folder an empty year folder that was created.

I first tried having monthly folders and symlinks created for albums. Then I tried to neglect the albums. All without success.

Its around 140Gb with 30K files.

jwilleke commented 4 weeks ago

I believe that due to the method used to "Rename" files, that this is because moving from one file system namespace to another.

os.rename only works if source and destination are on the same file system. You should use shutil.move instead.

Regardless, the application SHOULD catch these type of errors and perform some type of handler.