Skip to content
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

Problem with authentication #14

Closed
HydrelioxGitHub opened this issue Jan 22, 2020 · 20 comments
Closed

Problem with authentication #14

HydrelioxGitHub opened this issue Jan 22, 2020 · 20 comments
Labels
bug Something isn't working

Comments

@HydrelioxGitHub
Copy link

HydrelioxGitHub commented Jan 22, 2020

Describe the bug
I've a problem with authenticating in docker. I've the message in my browser ( "You are authenticated, you can now return to the program. This will auto-close" ). But in the shell, I have the message : "

root@nas:~#` docker exec -it gphoto run                                                                                                                                                                             
[info]   Opening browser to complete authorization.

[warn]   Browser was not detected. Complete the authorization browsing to: http://localhost:29070

[error]  error while authorization: error while exchanging authorization code and token: Post 
https://oauth2.googleapis.com/token: x509: certificate signed by unknown authority

[fatal]  could not get a token: error while exchanging authorization code and token: Post https://oauth2.googleapis.com/token: x509: certificate signed by unknown authority

Desktop & Client versions (please complete the following information):

  • Docker

Precision : I'm running the container on a headless server. So I've got to authenticate through a browser on another machine. In the browse I get the success page but if I log the container I've got what I mentioned above.

@rfgamaral
Copy link
Owner

Please run this:

docker exec -it gphoto update-ca-certificates

And once it's finished try again with:

docker exec -it gphoto run 

@HydrelioxGitHub
Copy link
Author

I've got an error on the first command :

root@nas:~# docker exec -it gphoto update-ca-certificates OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"update-ca-certificates\": executable file not found in $PATH": unknown

@rfgamaral
Copy link
Owner

That's weird...

Please login to your container shell:

docker exec -it gphoto /bin/sh

And call update-ca-certificates directly inside the shell. If that doesn't work, while still in the shell do this:

apk add ca-certificates

And then call update-ca-certificates again and then try again:

docker exec -it gphoto run 

Also, which device are you installing docker-gphotos-uploader?

@HydrelioxGitHub
Copy link
Author

HydrelioxGitHub commented Jan 22, 2020

There is a warning, but it seems something has been done.

/ 
# apk add ca-certificates                                               
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armv7/APKINDEX.tar.g
z                                                                         
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armv7/APKINDEX.
tar.gz                                                                    
(1/1) Installing ca-certificates (20190108-r0)                            
Executing busybox-1.30.1-r2.trigger                                       
Executing ca-certificates-20190108-r0.trigger
OK: 4 MiB in 15 packages
/ # update-ca-certificates                                                
WARNING: ca-certificates.crt does not contain exactly one certificate or C
RL: skipping                                                              
/ # exit

But there is permission error then

[info]   Found item to upload: /photos/Voici Gohan/2015-03-17.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104822.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104829.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104831.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104840.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104841.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104844.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104849.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_104909.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_105556.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_105613.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_110417.jpg
[info]   Found item to upload: /photos/Voici Gohan/IMG_20150315_110445.jpg
[info]   Found item to upload: /photos/Voici Gohan/VID_20150315_110420.mp4
[info]   15 files pending to be uploaded in folder '/photos'.
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/2015-03-17.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/2015-03-17.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104822.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104822.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104829.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104829.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/.picasa.ini, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/.picasa.ini
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104849.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104849.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104831.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104831.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104840.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104840.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104841.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104841.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_105613.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_105613.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/VID_20150315_110420.mp4, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/VID_20150315_110420.mp4
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104909.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104909.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_105556.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_105556.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_110417.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_110417.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_110445.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_110445.jpg
[error]  error while trying to create this media item, err=unexpected error response: file=/photos/Voici Gohan/IMG_20150315_104844.jpg, err=googleapi: Error 400: No permission to add media items to this album., badRequest
[fail] X Error processing /photos/Voici Gohan/IMG_20150315_104844.jpg
[info]   15 processed files: 0 successfully, 15 with errors

@rfgamaral
Copy link
Owner

But how did you got those errors? Were you able to authenticate?

@HydrelioxGitHub
Copy link
Author

I just tried your command lines ( apk add certificate etc... ) then docker exec -it gphoto run and do the same thing than explained above (Opening Browser .... etc ) and got on my browser the same message on authentication.

I've just try to re-run and got this : https://pastebin.com/4K6qTasg

@rfgamaral
Copy link
Owner

So, you were able to authenticate, correct? I really need you to answer me this with a yes or no, I need to understand what's happening and what fixed your authentication problem.

@HydrelioxGitHub
Copy link
Author

I think it's a yes. Through the browser I was able to authenticate.

@rfgamaral
Copy link
Owner

If the authentication problem is fixed, that's great, I might need to fix something on my Docker image, can you please just let me know which device are you using for this? A Raspberry Pi or something?

As for your uploading issue, that looks like an upstream issue and I recommend you open a new issue in the gphotos-uploader-cli repository, they should be able to help you better. But based on the error, there seems to be some problem with the album you're uploading to. Try to rename the folder name and try to upload again and see if that works.

@scadylan
Copy link

scadylan commented Feb 24, 2020

Hi rfgamaral, I met the same problem. My device is Synology DS918+ with docker. I used you method and it success to run. Thanks! But it finally got some error just like this:
[info] 179169 files pending to be uploaded in folder '/photos'.
[error] error while trying to create this media item, err=Failed: There was an error while trying to create this media item.
[fail] X Error processing /photos/@eaDir/SYNOPHOTO_MUSIC_CONFIG
[error] error while trying to create this media item, err=unexpected error response: file=/photos/@eaDir/IMG_20200222_172150.JPG@SynoEAStream, err=googleapi: Error 400: Request must contain a valid upload token., badRequest

@rfgamaral
Copy link
Owner

Hi rfgamaral, I met the same problem. My device is Synology DS918+ with docker. I used you method and it success to run.

Just clarify something for me... You had the same authentication problem and you fixed with my suggestion above? Yes?

@scadylan
Copy link

Yes , it is fixed with you suggestion and it runs well. Thanks!

@rfgamaral
Copy link
Owner

Yes , it is fixed with you suggestion and it runs well. Thanks!

Thank you, I'll need to provide a fix for that.

As for the other issue, I believe that's an upstream issue (maybe, not sure yet) and that's being tracked here: gphotosuploader/gphotos-uploader-cli#49

@HydrelioxGitHub
Copy link
Author

Maybe this issue can be closed as the error 400 problem is not really related to it ?

@rfgamaral
Copy link
Owner

Well, the original issue is not yet fixed in master, you guys only used a workaround to temporarily solve the problem on your end. I'll close this once I fix the authentication issue in master and release a new version with it :)

@HydrelioxGitHub
Copy link
Author

I've made one test with some pictures and deleted them on Google Photo. Now these photo are not detected again as uploadable. How do I reset to re-upload them ?

@rfgamaral
Copy link
Owner

I've made one test with some pictures and deleted them on Google Photo. Now these photo are not detected again as uploadable. How do I reset to re-upload them ?

I have no idea. You need to ask that in the gphotos-uploader-cli repository.

@suprimex
Copy link

suprimex commented Mar 2, 2020

Raspberry Pi3, Raspbian GNU/Linux 9.11 (stretch),
just want to confirm that I had the same issue as the topic starter ( error about certificate signed by unknown authority) and "apk add ca-certificates" with "update-ca-certificates" in container shell helped in this case. Thank you.

@rfgamaral
Copy link
Owner

Thank you for that @suprimex.

I'm going to publish a fixed version in a couple of minutes and close this once it's published.

@rfgamaral
Copy link
Owner

I just published a fixed version to the preview tag (and bumped the tool to the latest version), could any of you guys please test it out before I publish this to latest?

@rfgamaral rfgamaral added the bug Something isn't working label Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants