simonedegiacomi / gphotosuploader

Unofficial Google Photos uploader and Go library
GNU General Public License v3.0
99 stars 29 forks source link

panic: interface conversion: interface {} is nil, not map[string]interface {} #16

Open NoLooseEnds opened 6 years ago

NoLooseEnds commented 6 years ago

Not sure what caused this and if this is any help, but here is the last bits of the output.

This is running on a Macbook Pro Retina with macOS 10.13.3. Images are located on an external drive.

2018/04/06 02:57:55 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0715.JPG' completed
2018/04/06 02:57:58 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0716.JPG' completed
2018/04/06 02:59:51 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0718.JPG' completed
2018/04/06 03:00:00 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0717.JPG' completed
2018/04/06 03:01:34 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0719.JPG' completed
2018/04/06 03:01:40 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0720.JPG' completed
2018/04/06 03:03:21 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0722.JPG' completed
2018/04/06 03:03:46 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0721.JPG' completed
2018/04/06 03:04:45 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0724.JPG' completed
2018/04/06 03:05:57 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0723.JPG' completed
2018/04/06 03:06:23 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0725.JPG' completed
2018/04/06 03:06:28 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0726.JPG' completed
2018/04/06 03:07:11 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0727.JPG' completed
2018/04/06 03:08:40 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0728.JPG' completed
2018/04/06 03:09:14 Upload of '/Volumes/path/to/dir/Photos Library.photoslibrary/Masters/2016/08/03/20160803-164101/IMG_0730.JPG' completed
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 33 [running]:
github.com/simonedegiacomi/gphotosuploader/api.EnableImageResponse.getEnabledImageId(0xc420064640, 0x3, 0x4, 0x128a320, 0xc420144098)
    /Users/<removed>/go/src/github.com/simonedegiacomi/gphotosuploader/api/models.go:108 +0x27f
github.com/simonedegiacomi/gphotosuploader/api.(*Upload).enablePhoto(0xc420b94500, 0xc42069e120, 0x0, 0x0, 0x0)
    /Users/<removed>/go/src/github.com/simonedegiacomi/gphotosuploader/api/uploadSteps.go:238 +0xe3c
github.com/simonedegiacomi/gphotosuploader/api.(*Upload).Upload(0xc420b94500, 0xc420085410, 0xc42004acf0, 0xc42004ae50)
    /Users/<removed>/go/src/github.com/simonedegiacomi/gphotosuploader/api/upload.go:125 +0x151
github.com/simonedegiacomi/gphotosuploader/utils.(*ConcurrentUploader).uploadFile(0xc4201bc150, 0xc420614600, 0x79)
    /Users/<removed>/Downloads/gphotoupload/go/src/github.com/simonedegiacomi/gphotosuploader/utils/uploader.go:144 +0x16c
created by github.com/simonedegiacomi/gphotosuploader/utils.(*ConcurrentUploader).EnqueueUpload
    /Users/<removed>/Downloads/gphotoupload/go/src/github.com/simonedegiacomi/gphotosuploader/utils/uploader.go:107 +0x137
exit status 2
siongui commented 6 years ago

@NoLooseEnds I want to report this issue and it seems you open the issue a little bit earlier than me. I am trying to see if I can fix it. I usually got this panic when I try to upload many files at the same time.

NoLooseEnds commented 6 years ago

Yes, this happened when uploading from the "Masters" folder of an Apple Photos (i.e all images in the library). So yes, many files.

I can't program Go, so can't help you there, but let me know if you want me to test anything.

sledge1977 commented 6 years ago

I'm seeing a similar issue while trying to upload many files. This is the output I get:

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 33 [running]:
github.com/simonedegiacomi/gphotosuploader/api.EnableImageResponse.getEnabledImageId(0xc4200a0440, 0x3, 0x4, 0x6826c0, 0xc42081c010)
        /home/jens/go/src/github.com/simonedegiacomi/gphotosuploader/api/models.go:112 +0x1f0
github.com/simonedegiacomi/gphotosuploader/api.(*Upload).enablePhoto(0xc4202f2100, 0xc4201b43f0, 0x0, 0x0, 0x0)
        /home/jens/go/src/github.com/simonedegiacomi/gphotosuploader/api/uploadSteps.go:238 +0xdba
github.com/simonedegiacomi/gphotosuploader/api.(*Upload).Upload(0xc4202f2100, 0xc420089320, 0xc420086c60, 0xc420086dc0)
        /home/jens/go/src/github.com/simonedegiacomi/gphotosuploader/api/upload.go:126 +0x125
github.com/simonedegiacomi/gphotosuploader/utils.(*ConcurrentUploader).uploadFile(0xc420011d50, 0xc420656de0, 0x56)
        /home/jens/go/src/github.com/simonedegiacomi/gphotosuploader/utils/uploader.go:144 +0x16c
created by github.com/simonedegiacomi/gphotosuploader/utils.(*ConcurrentUploader).EnqueueUpload
        /home/jens/go/src/github.com/simonedegiacomi/gphotosuploader/utils/uploader.go:107 +0x133
simonedegiacomi commented 6 years ago

Are you sure you're running the latest version? because that file (model.go) is now smaller and it doesn't have the line 112. To simplify things i added a --version flag, so you can easily see if you're running the latest version.

sledge1977 commented 6 years ago

Hi Simon,

seems my Version was a few days old. I updated today and it seems to work now.

Thanks for this great tool. Saves me a lot of manual work.

Jens

Simone Degiacomi notifications@github.com schrieb am Do., 19. Apr. 2018, 22:05:

Are you sure you're running the latest version? because that file (model.go) is now smaller and it doesn't have the line 112. To simplify things i added a --version flag, so you can easily see if you're running the latest version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/simonedegiacomi/gphotosuploader/issues/16#issuecomment-382863999, or mute the thread https://github.com/notifications/unsubscribe-auth/AEI0sQ8FIZ7EZHBrWaq9-pnMFybDSXDmks5tqO4LgaJpZM4TJlF2 .