Cannot authorize Google Cloud SQL Commandline Tool

105 views
Skip to first unread message

Dominik Peuscher

unread,
Aug 7, 2013, 10:15:13 AM8/7/13
to google-cloud...@googlegroups.com
Hi,

I have a problem with the oAuth2 authorization of the command line tool as described at https://developers.google.com/cloud-sql/docs/commandline?hl=de. In the setup process at 3. I run the command as described ./google_sql.sh instance and get:

Please authorize Google SQL Service for your Google Account at:
[authorizationURL]
Enter Authorization Code:
 
When I follow the authorizationURL I get an oAuth2 Request that asks me if I would like to allow "Google Cloud SQL Tool" to access my could sql instances. If I click "allow" I get an input-field with a code that I enter into the command line (as request). It then exits immediatly with this output:

Exiting; Unable to open connection.
Unable to fetch OAuth2 tokens.

What am I doing wrong? Is there anything I could do to test the connection? It looks like the tool could not connect to the google servers but there is no such iptables-rule or other firewall installed.

Thanks,
Dominik

Rob Clevenger

unread,
Aug 7, 2013, 12:11:37 PM8/7/13
to google-cloud...@googlegroups.com

On Wed, Aug 7, 2013 at 7:15 AM, Dominik Peuscher <dpeu...@gmail.com> wrote:

Which version of the command line tool are you using?  Which cloud SDK or AppEngine SDK version included it?

Rob

Dominik Peuscher

unread,
Aug 7, 2013, 12:14:40 PM8/7/13
to google-cloud...@googlegroups.com
I got it from here (today): http://dl.google.com/cloudsql/tools/google_sql_tool.zip and it seems to be Release 10:
./google_sql.sh --version
Google SQL Service tool. Release 10

Dominik


2013/8/7 Rob Clevenger <rcle...@google.com>

On Wed, Aug 7, 2013 at 7:15 AM, Dominik Peuscher <dpeu...@gmail.com> wrote:

Which version of the command line tool are you using?  Which cloud SDK or AppEngine SDK version included it?

Rob

--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/b5x9YGd4Ovg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CA%2BbE6i0KWj-6-mZHBY2XB2kUifnYP3o2BF9%3Dvk%3D6-3-e2q7%3Dyg%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rob Clevenger

unread,
Aug 7, 2013, 12:20:45 PM8/7/13
to google-cloud...@googlegroups.com
Thanks. What page linked to that version, that version is out dated.

Please download the cloud SDK from https://developers.google.com/cloud/sdk/
This includes a newer version of the tool.

Rob



--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CAEt%3DLbkj-9Ura4mmCUP8hDHvwFMe7FReK69if8WHachTn0KUFg%40mail.gmail.com.

Dominik Peuscher

unread,
Aug 7, 2013, 12:33:34 PM8/7/13
to google-cloud...@googlegroups.com

Dominik Peuscher

unread,
Aug 7, 2013, 12:42:45 PM8/7/13
to google-cloud...@googlegroups.com
It looks like the java version for "Linux / Other Platforms" (https://dl.google.com/dl/cloudsdk/google-cloud-sdk-0.9.7-linux-java.zip) is not java but python. Also in this package the commandline tool (platform/google_sql_tool/google_sql.sh) is the same as the one I downloaded first (Release 10).


2013/8/7 Dominik Peuscher <dpeu...@gmail.com>

Dominik Peuscher

unread,
Aug 7, 2013, 12:49:34 PM8/7/13
to google-cloud...@googlegroups.com
OK looks like this is an outdated way to connect. One should keep in mind, that the java-version requires python 2.7 as well. Also don't use the google_sql.sh-Script in platform/google_sql_tool/google_sql.sh but in bin. After that (and using the right param for remote-oauth2-link generation, it's "--no-launch-browser" not "--noauth_local_webserver" as the script suggests), I have my credentials, but a similar output:

./google_sql.sh instance
Exiting; Unable to open connection.
java.security.ProviderException: Could not initialize NSS


2013/8/7 Dominik Peuscher <dpeu...@gmail.com>

Rob Clevenger

unread,
Aug 7, 2013, 1:01:30 PM8/7/13
to google-cloud...@googlegroups.com

On Wed, Aug 7, 2013 at 9:49 AM, Dominik Peuscher <dpeu...@gmail.com> wrote:
Could not initialize NSS

Make sure your java you are using is the official JDK or IcedTea (not GCJ)

Rob

Dominik Peuscher

unread,
Aug 7, 2013, 4:40:28 PM8/7/13
to google-cloud...@googlegroups.com
My jdk and jre are based on OpenJDK 6 and IcedTea 6

Dominik


2013/8/7 Rob Clevenger <rcle...@google.com>


Rob

--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/b5x9YGd4Ovg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.

Rob Clevenger

unread,
Aug 7, 2013, 4:50:21 PM8/7/13
to google-cloud...@googlegroups.com
Please try open-jdk-7 then, there's lots of occurrences of this bug according to a google search. One such example: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637337


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CAEt%3DLbkkS4Z7nVTBb%3D_uSMz3ouNBqd_7s%3D%3DM4KQ2rBujULL2ZQ%40mail.gmail.com.

Dominik Peuscher

unread,
Aug 8, 2013, 9:34:13 AM8/8/13
to google-cloud...@googlegroups.com
OpenJDK7 did the job, thanks


2013/8/7 Rob Clevenger <rcle...@google.com>
Reply all
Reply to author
Forward
0 new messages