gphotos-uploader-cli
gphotos-uploader-cli copied to clipboard
"[fatal] unable to get token" Error (Bug? User Error?)
Describe the bug After setting up the GCP project and configuring OAuth, I'm getting an "[fatal] unable to get token" error after I enter the authorization code.
To Reproduce Steps to reproduce the behavior:
- Install via homebrew
- Run
gphotos-uploader-cli init
- Follow APIAppCrendentials steps
- Edit
config.hjson
(I used SecretsBackend = auto) - Run
gphotos-uploader-cli push
- Visit the URL provided, complete steps and copy/paste the resulting authorization code
- Get error "[fatal] unable to get token: Post "https://oauth2.googleapis.com/token": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
Expected behavior I expected the jpg files in the specified directory to be uploaded to an album named after the folder, per CreateAlbums setting.
Screenshots none
Desktop & Client versions (please complete the following information):
- Operating System: Mac OS Monterey (12.3)
- Version v3.3.0
Additional context I've reviewed my actions against the documentation several times. I'm fairly confident that this is not caused by user error, but this is the first time using this tool and I'm not an OAuth expert. Apologies in advance if this is user error.
Hi @blakenan-bellese
Unfortunately I don't have a Mac system to test it, **would you mind to run gphotos-uploader-cli --debug push
?
@pacoorozco Thanks for the reply. I ran the command with the debug flag, see below for my terminal contents. Note: I replaced some potentially sensitive info with a bunch of Xs.
bill@bills-mbp ~ % gphotos-uploader-cli push --debug [04/1/22| 9:15AM] [info] Reading configuration from '/Users/bill/.gphotos-uploader-cli/config.hjson' [debug] Current configuration: {"APIAppCredentials":{"ClientID":"XXXXXXXXX.apps.googleusercontent.com","ClientSecret":"REMOVED"},"Account":"[email protected]","SecretsBackendType":"auto","Jobs":[{"SourceFolder":"/Users/bill/Pictures/auto-upload","CreateAlbums":"folderName","DeleteAfterUpload":false,"IncludePatterns":[],"ExcludePatterns":[]}]} [info] Getting OAuth token for '[email protected]' [debug] Unable to retrieve token from token manager: token was not found [debug] Getting OAuth2 token from prompt...
Visit the following URL in your browser: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fphotoslibrary&state=state
After completing the authorization flow, enter the authorization code here: XXXXXXXXXXXXXXXXXXX [fatal] unable to get token: Post "https://oauth2.googleapis.com/token": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
It's very strange but it's not the first time that I've seen this kind of failures in Mac.
It seem that your terminal cannot reach the Google endpoint 😪 are you using a VPN or outbound firewall?
How have you installed the CLI? Homebrew or tar file?
@pacoorozco I'm not using a VPN or outbound firewall. I used homebrew to install. When I get a few minutes I'll try to connect manually to that Google endpoint using Postman. Maybe I can determine the cause. Appreciate the feedback/
Any update @blakenan-bellese , otherwise I will close the issue assuming that it worked at the end 😅
@pacoorozco I haven't looked at this in a while. I'll try to reproduce the error in the next week. If you don't hear from me, feel free to close the issue. Thanks for the follow-up.