Gdrive: Failed getting oauth client

Created on 12 Jun 2016  路  9Comments  路  Source: prasmussen/gdrive

root@leightont:~# gdrive list
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-7n0removed for privacypps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code: 4/MlOlRt84yH56removed for privacyr8tfeLptvqdU
Failed getting oauth client: Failed to exchange auth code for token: Post https://accounts.google.com/o/oauth2/token: x509: failed to load system roots and no roots provided

Most helpful comment

You are missing CA certificates in your system. Install them using following command:

apt-get install ca-certificates

All 9 comments

You are missing CA certificates in your system. Install them using following command:

apt-get install ca-certificates

Thank you, I am really struggling with this minimal install ;)

I'm facing the same issue, and I have 'ca-certificates' installed.
Any other ideas?

@diman82 Is your ca-certificates.crt installed/located in /etc/ssl/certs? Perhaps the https handler looks for ca-certificates.crt only in this folder.

Upload a file to my Google Drive via CLI, it works well but when doing it via crontab, I get this error:

Failed getting oauth client: Failed to exchange auth code for token: oauth2: cannot fetch token: 400 Bad Request Response: { "error" : "invalid_request", "error_description" : "Missing required parameter: code" }

OS: CentOS release 6.8 (Final)

Any ideas what could be wrong and how can it be fixed?
Thanks

Hi all,

I have finally gotten gdrive-linux-386 to work on my old microcore linux server, and got the following message when trying to enter the key

Enter verification code: 4/wlxxxxxxxxxxxx removed for privacy xxxxxxxxxDg4
Failed getting oauth client: Failed to exchange auth code for token: Post https://accounts.google.com/o/oauth2/token: x509: failed to load system roots and no roots provided

A suggestion above says that I need to installer missing CA certificates in my system.

But my distro of linux does not support apt-get, and I could not find any mession of CA certificates in tinycore 3.8.4's repository's.

Can anyone suggest how I would go about setting this up from scratch ?


UPDATE
I found a ca-certificates.tcz installer for my distro and have installed the latest one available.

I've created a soft link to /etc/ssl/certs, mine was /usr/local/etc/ssl/certs

I've run "sudo gdrive about"
And I still get the following error
`$ sudo gdrive about
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code: 4/sAgXXXXXXXXXXXXXXXXXXXXXXXXXXXXdodw
Failed getting oauth client: Failed to exchange auth code for token: Post https://accounts.google.com/o/oauth2/token: x509: failed to load system roots and no roots provided
`

Date and time of your computer is right ?
If that is wrong , it may fail.

I ran into the same problem I was able to solve this by authenticating as yourself once you are logged in which creates the token then using a bash script to run the drive command (in my case i was trying to run a crontab and it kept failing but worked in console). update the script to have both your current users PATH and HOME environment variables that seemed to do the trick

How can i install ca-certificates in FreeBSD?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dominion66 picture dominion66  路  4Comments

nvsoares picture nvsoares  路  5Comments

mikeyfev1 picture mikeyfev1  路  4Comments

skyuuka picture skyuuka  路  4Comments

msnoon picture msnoon  路  6Comments