Mojo collect fails on charmstore URLs when 'charm' is installed from a snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mojo: Continuous Delivery for Juju |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I'm not sure if this is a bug in mojo, snappy, or the charm tool tbh, but in my experience, it uniquely affects mojo, so here goes...
If I 'apt install charm' from the Juju PPA, collect works fine.
If I collect from the charmstore, and I've gotten the charm tool from 'snap install charm', I get an error during the collect phase (I modified codetree out of /usr/lib/python2.7 to print the exception to check_output).
c@zeugmatic:
2017-09-13 17:55:09 [INFO] Using pre-existing container class lxc
2017-09-13 17:55:09 [WARNING] Project doesn't seem properly set up, please fix as project will break in future releases. /var/lib/
2017-09-13 17:55:18 [INFO] Pulling /srv/mojo/
2017-09-13 17:55:26 [INFO] /srv/mojo/
2017-09-13 17:55:26 [INFO] Retrieve the spec's manifest
2017-09-13 17:55:26 [INFO] Manifest comment:
#######
Deploy omnibus environment
#######
2017-09-13 17:55:26 [INFO] Manifest comment:
#######
manifest-deploy
Deploying new omnibus environment
#######
2017-09-13 17:55:26 [INFO] Manifest comment:
#######
Predeploy checks
#######
2017-09-13 17:55:26 [INFO] Checking Juju status
2017-09-13 17:55:28 [INFO] Environment has reached steady state
2017-09-13 17:55:28 [DEBUG] ### Running phase collect with options {'config': 'collect'} ###
2017-09-13 17:55:28 [INFO] Building resource tree
2017-09-13 17:55:30 [INFO] Downloading cs:nrpe from charm store to nrpe
2017-09-13 17:55:30 [INFO] Downloading cs:~prometheus-
2017-09-13 17:55:30 [INFO] Downloading cs:haproxy-41 from charm store to haproxy
2017-09-13 17:55:30 [INFO] Downloading cs:~cmars/kpidev from charm store to kpidev
2017-09-13 17:55:30 [INFO] Downloading cs:postgresql from charm store to postgresql
2017-09-13 17:55:30 [INFO] Downloading cs:telegraf from charm store to telegraf
ERROR cannot expand cs:nrpe archive: cannot extract "revision": mkdir /var/lib/
ERROR cannot expand cs:haproxy-41 archive: cannot extract "revision": mkdir /var/lib/
ERROR cannot expand cs:~cmars/kpidev archive: cannot extract "revision": mkdir /var/lib/
ERROR cannot expand cs:postgresql archive: cannot extract "revision": mkdir /var/lib/
ERROR cannot expand cs:telegraf archive: cannot extract "revision": mkdir /var/lib/
ERROR cannot expand cs:~prometheus-
2017-09-13 17:58:45 [ERROR] Error calling external process
Traceback (most recent call last):
File "/usr/lib/
args.func(args)
File "/usr/lib/
return method(*args, **kwargs)
File "/usr/lib/
manifest.
File "/usr/lib/
auto_
File "/usr/lib/
collect_success = collect_
File "/usr/lib/
results.
File "/usr/lib/
return self.__get_result()
File "/usr/lib/
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/
return self.run()
File "/usr/lib/
return self.source.
File "/usr/lib/
self.
File "/usr/lib/
out = subprocess.
File "/usr/lib/
raise CalledProcessEr
CalledProcessError: Command '('charm', 'show', '--format=json', '--channel', 'beta', 'cs:~yellow/
This is related to the latest charm tools snap. I'm also seeing the same when trying to build charms:
[hloeung@dharkan nrpe-charm]$ charm build snapd/void/ trusty/ void charm/17/ bin/charm- build", line 11, in <module> entry_point( 'charm- tools== 2.1.2', 'console_scripts', 'charm-build')() charm/17/ lib/python2. 7/site- packages/ charmtools/ build/builder. py", line 679, in main charm/17/ lib/python2. 7/site- packages/ charmtools/ build/builder. py", line 522, in __call__ charm/17/ lib/python2. 7/site- packages/ charmtools/ build/builder. py", line 473, in generate charm/17/ lib/python2. 7/site- packages/ charmtools/ build/builder. py", line 246, in fetch target_ dir.makedirs_ p() charm/17/ lib/python2. 7/site- packages/ path.py" , line 1222, in makedirs_p makedirs( mode) charm/17/ lib/python2. 7/site- packages/ path.py" , line 1215, in makedirs makedirs( self, mode) charm/17/ usr/lib/ python2. 7/os.py" , line 150, in makedirs charm/17/ usr/lib/ python2. 7/os.py" , line 157, in makedirs snapd/void/ trusty'
build: Composing into /var/lib/snapd/void
build: Destination charm directory: /var/lib/
build: Please add a `repo` key to your layer.yaml, with a url from which your layer can be cloned.
Traceback (most recent call last):
File "/snap/
load_
File "/snap/
build()
File "/snap/
self.generate()
File "/snap/
layers = self.fetch()
File "/snap/
self.
File "/snap/
self.
File "/snap/
os.
File "/snap/
makedirs(head, mode)
File "/snap/
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/