3

I'm working on a fastlane lane using pink-room's fastlane firebase test lab plugin which needs a gcloud service account to connect to firebase and upload files to a bucket.

The service account is needed because the script runs in a docker container which must not be worked by humans.

Gcloud command seem to work, because the test are launched as intended, but the gsutil command which is use to upload raw results is failing.

When this service account is loaded, gsutil commands stop working because they throw a ConfigParser.ParsingError "File contains parsing errors".

Here is what I get when trying to execute gsutil version -l in order to gather more informations:

Exit status of command 'gsutil version -l' was 1 instead of 0.
Traceback (most recent call last):
  File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil", line 22, in <module>
    gsutil.RunMain()
  File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil.py", line 116, in RunMain
    import gslib.__main__
  File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 39, in <module>
    import boto
  File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/__init__.py", line 53, in <module>
    config = Config()
  File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/pyami/config.py", line 63, in __init__
    self.read(BotoConfigLocations)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
    raise e
ConfigParser.ParsingError: File contains parsing errors: /builds/project-0/gcloud
/legacy_credentials/<service account mail>/.boto
    [line  3]: '/legacy_credentials/<service account mail>/adc.json'

Here is my .boto file :

[Credentials]
gs_service_key_file = /builds/project-0/gcloud/legacy_credentials/<service account mail>/adc.json

Do someone knows where this error comes from, and how I can fix it ?

Sylvain GIROD
  • 836
  • 1
  • 11
  • 23

1 Answers1

2

You say your boto file only has 2 lines, but I don't think that's the case, based on your error message :) I'm guessing either there's whitespace in there that you're not seeing (some unicode character that might not render correctly in your editor, perhaps?), or you didn't copy/paste the contents exactly as they appear in your file.

After finding a similar issue in this blog post, I noticed that the error you're seeing will print out the entire content of each problematic line that it found. It says it's printing line 3 (that shouldn't be possible if the boto file has only 2 lines), but doesn't show the gs_service_key_file = text. I'm guessing there's some sort of line break between gs_service_key_file = and /build/project-0/... in your boto file.

mhouglum
  • 2,468
  • 13
  • 21