-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.23.0-RC6 segfault during upload of Google Photos #613
Comments
which version of immich-go? |
Version was 0.23.0-RC6:
I re-ran against the Family & friends album and it fails shortly into the upload phase. Logs don't seem to have any errors. For some reason there are two metadata.json files:
I was able to complete successfully when targeting a different specific album that had two metadata files. |
i can't reproduce your error. |
Thanks; I will give that a try once the rest of the import completes and report back. |
I moved my "Family & friends" folder into a separate parent folder and targeted that parent folder directly:
It still fails when it completes metadata begins to upload. The final messages in the immich-go logs are:
I'm going to try to prune the contents to find the minimum reproducible case. |
The minimum case appears to be a single image in the "Family & friends" folder. |
I re-built on an x86 Mac and see the same behavior with a local Family & friends folder with a single image in it. |
Thanks for your help. The problem is triggered with one folder named "Family & friends" containing 2 metadata.json files and one photo. Have you tried to change the photo by another? |
I can trigger it with an album called Family & friends with a single, normal-lookng metadata.json and a single image. I've tried replacing the image; any image triggers the behavior. |
Digging in and debugging. It seems that a.FromApplication is being accessed when it is nil here: https://github.com/simulot/immich-go/blob/v0.23.0-RC6/adapters/googlePhotos/googlephotos.go#L471 However, I guess this is a little contrived when taking a folder that was part of a Takeout, removing the contents, and manually adding an image. I can see now that the expectation is that Google Takeout should always produce JSON metadata alongside the images? I'll have a look at the Takeout folders to see if there is an actual case of missing metadata. |
Think I sorted it out into two issues:
In my case, the warnings in the logs were showing the failure cases:
I wonder if the strange formatting is due to a maximum file length? |
Hi, bump here. As a workaround I executed the script excluding all $ ./immich-go upload from-google-photos --sync-albums --api-key XXX --server http://localhost:2283 --ban-file 'Photos from*' ${TAKEOUT_LOCATION} Then took care of the rest using a glob for the path: $ ./immich-go upload from-google-photos --sync-albums --api-key XXX --server http://localhost:2283 ${TAKEOUT_LOCATION}/Photos\ from* I believe this is also related to the number of files being processed since the conflicting files from the original upload with all Takeout files didn't throw any errors doing the upload with this slice-strategy. Just chimed in in case anyone was struggling with uploading everything even with the bug present. Cheers. P.S.: awesome project. Thanks a lot. |
Thank you for your deep analysis
yes, 46 chars... but UTF16 chars when the zip is encoded with UTF-8. I m documenting google takeout issues here: https://github.com/simulot/immich-go/blob/main/docs/google-takeout.md
I have also identified this line as a potential problem. I should understand when the FromApplication is nil, and at least not reference it when nil. Takeout folders:
This is a guru technique! It should work, but images files may be absent from the album folder. Immich-go searches them in the folder, then in the
There too many moving parts.... The content of the immich server and the flow of photos... I'm glad you overcome the problem. Anyway, I'd like to fix the initial bug, or at least prevent the segfault.
You're welcome. I have started it for fun 1.5 years ago for my personal takeout, and I'm still working on the project. I'm learning by doing. |
Hi @nickspacek
Could you share with me the minimal set of files that triggers the segfault?
Those cases should be handled properly. Could you share content of the 2 JSON files? |
I will attach shortly; however, when I added those cases to the matchers test there was no matcher found for them out of the box. Edit: tmp2.tgz reproduces with 0.23.0-RC6 with params Hope that helps @simulot |
@nickspacek : This helps!
Stay tuned |
I missed the |
* Fix filterOnMetadata to handle empty directory case * Add a test case to track #613 * split e2e tests * Add end-to-end test for uploading from Google Photos to address issue #613 * Fix nil pointer dereference by checking FromApplication before assigning Albums. * Refactor GP match functions for improved clarity and performance; add getFileIndex utility * Refactor matcher tests to improve clarity and update expected results for various cases * Refactor matchers in Google Photos adapter for improved clarity and organization * Update end-to-end tests for Google Photos upload to support wildcard zip files and add album name parameter * Merge branch 'next' into simulot/issue613
Getting this during upload of extracted Takeout from Google Photos:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x8cc92f]
goroutine 156 [running]:
github.com/simulot/immich-go/adapters/googlePhotos.(*Takeout).handleDir.func1()
github.com/simulot/immich-go/adapters/googlePhotos/googlephotos.go:471 +0x48f
created by github.com/simulot/immich-go/adapters/googlePhotos.(*Takeout).handleDir in goroutine
github.com/simulot/immich-go/adapters/googlePhotos/googlephotos.go:425 +0x48d
Seems to be happening consistently early in my upload. I'm not seeing any specific error in the immich logs that might indicate what's going on, but if there's anything on that end that might help let me know.
The text was updated successfully, but these errors were encountered: