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.88k stars 191 forks source link

Unhandled exception: `FileSystemException: readInto` #162

Closed matt-boris closed 1 year ago

matt-boris commented 1 year ago

Hey there, I'm getting this error while trying to run your tool against my large (50GB) tgz takeout files. Please let me know if you need anything more from me regarding this error.

Unzipping takeout-20230122T143523Z-001.tgz...
Unhandled exception:
FileSystemException: readInto failed, path = '/var/folders/_c/z_r8csbn73j2dt50rsxg68hr0000gn/T/dart_archive9Hnqal/temp.tar' (OS Error: Invalid argument, errno = 22)
#0      _RandomAccessFile.readIntoSync (dart:io/file_impl.dart:799)
#1      FileHandle.readInto (package:archive/src/io/input_file_stream.dart:60)
#2      InputFileStream.toUint8List (package:archive/src/io/input_file_stream.dart:326)
#3      ArchiveFile.decompress (package:archive/src/archive_file.dart:169)
#4      ArchiveFile.content (package:archive/src/archive_file.dart:134)
#5      extractFileToDisk (package:archive/src/io/extract_archive_to_disk.dart:127)
<asynchronous suspension>
#6      unzip (package:gpth/interactive.dart:219)
<asynchronous suspension>
#7      main (file:///Users/runner/work/GooglePhotosTakeoutHelper/GooglePhotosTakeoutHelper/bin/gpth.dart:103)
<asynchronous suspension>

And is there anything that can be done about the speed of unpack these files? These 50GB tgz's are taking forever!

Thanks!

TheLastGimbus commented 1 year ago

Hi! Huh, best solution for you, to both fix the error and speed up the unpacking, is to just unpack yourself (with some external tool) and use gpth with cli arguments. Look them up with gpth --help, and you should figure it out, but text here if you need some help :+1:

matt-boris commented 1 year ago

Hey @TheLastGimbus! I think I may have figured out why this popped up for me.

I've got my tars on my NAS and downloaded your tool on my local Mac and was using SMB to connect into the file system on the NAS. My guess is that my SMB session timed out and tar could no longer stat the file.

I recently downloaded your linux binary to run directly on the NAS alongside the compressed files and have my fingers crossed 🤞🏻 this'll fix things for me!

Regardless, I think what could be done about this issue would be to at least catch the exception and handle it gracefully :)

Great tool, thanks a lot!

TheLastGimbus commented 1 year ago

Oh, another NAS-samba-to-mac guy 0_o why are you guys doing it :fearful: ?

Anyway, happy it works! I'll look at the pr in mean time :+1: