2

I was trying to run a telemetry test case in google chrome, which requires some test files to be downloaded from google-cloud-storage. When I run the test case, I get the following error. The error says I have to configure gsutil before accessing but even after configuring gsutil with the given steps I end up with the same error. There is a ".boto" file created after configuring gsutil. So I am clueless why I am getting the same error.

PermissionError: Attempted to access a file from Cloud Storage but you don't have permission. To configure your credentials:
  1. Run "tools/telemetry/third_party/gsutil/gsutil config" and follow its instructions.
  2. If you have a @google.com account, use that account.
  3. For the project-id, just enter 0.

Locals:
  args        : ['cp', 'gs://chrome-partner-telemetry/da1c09dd48dcd2eb76449d97c4fa38460d3a1e8d', '/home/sriram/android/chromeopensource/androidbuild/src/tools/perf/page_sets/tough_video_cases/crowd1080.mp4']
  gsutil      : <subprocess.Popen object at 0x30807d0>
  gsutil_env  : None
  gsutil_path : 'tools/telemetry/third_party/gsutil/gsutil'
  stderr      : 'AccessDeniedException: 403 Forbidden\n'
  stdout      : ''

2 Answers 2

4

gsutil will use the ~/.boto file. By default, gsutil will look for the configuration file in /etc/boto.cfg and ~/.boto.

If these files do not exist, it will use the legacy_credentials instead.

You can change all of this behavior by modifying the the BOTO_PATH and BOTO_CONFIG environment parameters.

Here is the documentation on how to use those environment variables.

BOTO_PATH: gsutil will load each configuration file found in the path in order. You may want to use this environment variable if you want to share a boto config amongst users. An example would be something like this :

BOTO_PATH=/etc/group/.boto.cfg:/home/user/.boto 

BOTO_CONFIG: Use this variable to set the preference order. An example would be something like this :

BOTO_CONFIG=~/testa/.boto:~/testb/.boto . 

This would put the preference on testa's boto file. If that is not there then gsutil would load the testb boto.

3
  • 1
    I am getting the below error now. I have configured proxy in the boto file as i am behind a proxy. When i ping "www.googleapis.com" directly from my terminal i am getting the response. CloudStorageError: Failure: Unable to find the server at www.googleapis.com. stderr : 'Failure: Unable to find the server at www.googleapis.com.\n' stdout : '' [ PASSED ] 0 tests.
    – sriram
    Mar 31, 2015 at 7:14
  • @sriram did you figure it out? I am having the same issue
    – kilianc
    Nov 13, 2016 at 19:55
  • Looks like the description of the environment variables has moved here: cloud.google.com/storage/docs/boto-gsutil
    – Ziyuan
    Apr 26, 2021 at 14:15
1

Your third party tool is not asking a specific project id :

For the project-id, just enter 0

I do not know this tool, but using Google Cloud command “gsutil config” a /home/<user>/.boto file is created (you can edit this file). you will be asked for a project id as well as a “gcloud auth login” for registering a “gs_oauth2_refresh_token”.

Even if you are using a third party tool, it must be more or less the same way it is built. when lauching gsutil config have a look at the output, it should say where your boto file is created.

i created one to check with Google Cloud “gsutil config” :

Boto config file "/home/eric/.boto" created. If you need to use a
proxy to access the Internet please see the instructions in that file.

my /.boto file :

# This file contains credentials and other configuration information needed
# by the boto library, used by gsutil. You can edit this file (e.g., to add
# credentials) but be careful not to mis-edit any of the variable names (like
# "gs_access_key_id") or remove important markers (like the "[Credentials]" and
# "[Boto]" section delimiters).
#
# This file was created by gsutil version 4.10 at 2015-03-16 19:48:14.

....
gs_oauth2_refresh_token=xxxxxxxxxxxxxxxxxxxxxxxx
....

feel free to delete or update this file, you will always be able to recreate it with “gsutil config” when needed.

1
  • Thanks for the reply. yes, there is a .boto file generated, but i don't know why i keep getting the same error even after configuring gsutil.
    – sriram
    Mar 23, 2015 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .