Boto GCS authentication setup failure: no such file

1.1k views Asked by At

I am trying to set Boto to work with GCS with Oauth2 authentication. Gsutil config -e begins the authentication process, but when it asks "What is the full path to your private key file?" I get OSError: No such file or directory. Why would this happen? It doesn't work with the .json version of the private key file either. I wish Boto for GCS didn't need a path to the private key file.

1

There are 1 answers

0
ian-campbell On BEST ANSWER

I made it work by skipping gsutil config -e . I went to my Windows computer where Boto was authenticated, and copied the .boto file to my home directory in Ubuntu. In the .boto file under [Credentials] the un-commented lines with authentication keys had to be updated for this machine. Everything works now. The relevant part of the .boto file:

[Credentials]

# Google OAuth2 service account credentials (for "gs://" URIs):
gs_service_client_id = [email protected]
gs_service_key_file = /home/edmund_spenser/Downloads/myproj-14002ffcc31.p12
gs_service_key_file_password = notasecret

If you are having trouble getting Boto set up with service account credentials you can paste the above into your .boto file and change the values to your credentials. There were four other lines in the file that were un-commented:

https_validate_certificates = True
default_api_version = 2
content_language = en
default_project_id = myproject

I include them here just in case. Hopefully your terminal works and you can just use gsutil config -e to set up Boto.