binbeobo / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 1 forks source link

'asn1 wrong tag, nested asn1 error' when authenticating service account in circleci #422

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create a gcloud service account for your project, and follow the 
service-account related instructions on this blog post: 
http://scottsmerchek.com/2015/07/24/pushing-to-google-container-registry-from-ci
rcleci/

What is the expected output? What do you see instead?
Summary:
I expect to see circleci authorized to ssh into my gce instance through the 
newly-created service account. Instead, I see the error: 

ERROR: gcloud crashed (Error): [('asn1 encoding routines', 'ASN1_CHECK_TLEN', 
'wrong tag'), ('asn1 encoding routines', 'ASN1_ITEM_EX_D2I', 'nested asn1 
error')]

Please provide any additional information below.

I've attached a full stacktrace of my non-interactive authentication script.

Installation information:

Google Cloud SDK [0.9.87]

Platform: [Linux, x86_64]
Python Version: [2.7.6 (default, Jun 22 2015, 17:58:13)  [GCC 4.8.2]]
Python Location: [/usr/bin/python2]
Site Packages: [Enabled]

Installation Root: [/home/ubuntu/google-cloud-sdk]
Installed Components:
  core: [2015.11.18]
  core-nix: [2015.11.16]
  gcloud: []
  gsutil-nix: [4.15]
  gsutil: [4.15]
  bq: [2.0.18]
  bq-nix: [2.0.18]
Cloud SDK on PATH: [True]

Installation Properties: [/home/ubuntu/google-cloud-sdk/properties]
User Config Directory: [/home/ubuntu/.config/gcloud]
User Properties: [/home/ubuntu/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Original issue reported on code.google.com by b...@savannahinformatics.com on 9 Dec 2015 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for the feedback.

This does not seem to be a Cloud SDK problem. 

The attached log shows the following line before the gcloud error: 

base64: invalid input

I suspect this happened while you were following this step in the instructions:

echo $GCLOUD_KEY | base64 --decode > gcloud.p12

This suggests that your GCLOUD_KEY environment variable does not have the 
proper base64 encoded version of your service account credentials.

Original comment by vil...@google.com on 9 Dec 2015 at 5:05

GoogleCodeExporter commented 8 years ago
The problem was newlines in the encoded key. I edited the key, and it worked. 
Thanks for your help.

Original comment by b...@savannahinformatics.com on 10 Dec 2015 at 7:23