Closed Bug 1232982 Opened 7 years ago Closed 7 years ago

Can't run ./create-test-environment successfully


(Developer Services :: Mercurial:, defect)

Not set


(Not tracked)



(Reporter: Gijs, Unassigned)




(1 file)

$ ./create-test-environment
<snip spam>

Building Docker images.
This could take a while and may consume a lot of internet bandwidth.
If you don't want Docker images, it is safe to hit CTRL+c to abort this.
Error running mach:


The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

Please consider filing a bug against mach by going to the URL:

If filing a bug, please include the full output of mach, including this error

The details of the failure are as follows:

AttributeError: 'NoneType' object has no attribute 'base_url'

  File "/Users/gkruitbosch/dev/version-control-tools/venv/lib/python2.7/site-packages/mach/", line 344, in run
    return self._run(argv)
  File "/Users/gkruitbosch/dev/version-control-tools/venv/lib/python2.7/site-packages/mach/", line 432, in _run
    instance = cls(context)
  File "/Users/gkruitbosch/dev/version-control-tools/testing/vcttesting/", line 39, in __init__
    d = Docker(state_file, docker_url, tls=tls)
  File "/Users/gkruitbosch/dev/version-control-tools/testing/vcttesting/", line 165, in __init__
    docker_url = urlparse.urlparse(self.client.base_url)
You will not be able to run tests that require Docker.
Please see for how to install Docker.
When Docker is installed, re-run this script
finished creating test environment
Note: this patch is probably terrible python or whatever, but it let me at least use ./run-tests with the --no-docker option, and made the build not crash and burn when docker wasn't available. It does now print this all the time:

Exception trying to create Docker client: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))

which is the same error it was printing earlier... so this might not be the right "Fix" for the core issue, but arguably the exception here should return early because we *know* that we just set self.client to None, and so the next few lines are always going to throw the exception in comment #0.
Comment on attachment 8698984 [details]
MozReview Request: Bug 1232982 - don't break the build when docker's initialization fails, r?gps

I landed this without the print.

::: testing/vcttesting/
(Diff revision 1)
> +            print "Exception trying to create Docker client:", ex

Please don't print from library code.
Attachment #8698984 - Flags: review?(gps) → review+
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.