Cannot deploy with any channel release of the snap, install from a PPA or source

Bug #1870439 reported by Casey Marshall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju
Expired
Undecided
Unassigned

Bug Description

If I use the stable snap on bionic, mojo workspace-new and run fail with an error in codetree:

+ mojo project-new -c lxd --series bionic ua-event-bus
2020-04-02 21:48:00 [INFO] Checking ua-event-bus project path at /home/ubuntu/.local/share/mojo/ua-event-bus ...
2020-04-02 21:48:00 [INFO] Checking ua-event-bus project container at /home/ubuntu/.local/share/mojo/ua-event-bus/bionic ...
2020-04-02 21:48:00 [INFO] Not found, creating container
2020-04-02 21:48:00 [INFO] Using mojo container image mojo-ubuntu-bionic-amd64.
2020-04-02 21:48:00 [INFO] Launching container 'ua-event-bus-bionic'
2020-04-02 21:48:07 [INFO] Adding device mojo-project-series-root to LXC container ua-event-bus-bionic
2020-04-02 21:48:07 [INFO] Setting acls inside container: setfacl -Rdmu:100000:rwX /home/ubuntu/.local/share/mojo/ua-event-bus/bionic
2020-04-02 21:48:07 [INFO] Checking ua-event-bus project container is setup ...
+ mojo workspace-new --project ua-event-bus --series bionic --stage cdo/ua-event-bus/devel /home/ubuntu/mojo/ua-event-bus-vault cdo/ua-event-bus/devel
2020-04-02 21:48:09 [INFO] Using pre-existing container class lxd
2020-04-02 21:48:09 [INFO] Rsyncing /home/ubuntu/mojo/ua-event-bus-vault to /home/ubuntu/.local/share/mojo/ua-event-bus/bionic/cdo-ua-event-bus-devel/spec
2020-04-02 21:48:11 [ERROR] Unknown error
Traceback (most recent call last):
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/cli.py", line 633, in run_with_args
    args.func(args)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/utils.py", line 305, in wrapped
    return method(*args, **kwargs)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/cli.py", line 266, in create_workspace
    project.create_workspace(spec_url, workspace, stage=args.stage, logfile=args.logfile)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/project.py", line 324, in create_workspace
    ws.prepare()
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/workspace.py", line 58, in prepare
    self.spec # Initializes spec
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/workspace.py", line 35, in spec
    self._spec = Spec(self.spec_dir, self.spec_url, stage=self.stage, manifest_file=self.manifest_file)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/spec.py", line 29, in __init__
    self.update_from_source()
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/spec.py", line 113, in update_from_source
    self.ct.run()
  File "/snap/mojo/90/lib/python2.7/site-packages/codetree/config.py", line 90, in run
    f.write(yaml.dump(collect_info, default_flow_style=False))
TypeError: write() argument 1 must be unicode, not str

If I use edge, it gets further but errors when trying to log a message during the bundle phase:

2020-04-02 21:59:05 [INFO] Running bundle phase
2020-04-02 21:59:05 [INFO] Pulling secrets from /home/ubuntu/.local/share/mojo/LOCAL/ua-event-bus/cdo/ua-event-bus/devel to /home/ubuntu/.local/share/mojo/ua-event-bus/bionic/cdo-ua-event-bus-devel/local
2020-04-02 21:59:05 [ERROR] Unknown error
Traceback (most recent call last):
  File "/snap/mojo/99/lib/python3.6/site-packages/mojo/cli.py", line 688, in run_with_args
    args.func(args)
  File "/snap/mojo/99/lib/python3.6/site-packages/mojo/utils.py", line 395, in wrapped
    return method(*args, **kwargs)
  File "/snap/mojo/99/lib/python3.6/site-packages/mojo/cli.py", line 364, in run_from_manifest
    manifest.run(project, workspace, args.stage, args.interactive)
  File "/snap/mojo/99/lib/python3.6/site-packages/mojo/manifest.py", line 130, in run
    phase_name.run(project, workspace, stage)
  File "/snap/mojo/99/lib/python3.6/site-packages/mojo/phase.py", line 863, in run
    logging.info("Running: {}".format(" ".join(cmd)))
TypeError: sequence item 0: expected str instance, list found
ubuntu@chthonic:~/mojo$

Any ideas for a workaround?

I tried installing from a PPA, but that depends on a juju-deployer package not in the archives. It also appears to be the same version as the stable snap -- but I was thinking I could at least edit the python files installed as root to debug or fix it if I installed a deb.

ubuntu@chthonic:~/mojo$ sudo apt install mojo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mojo : Depends: juju-deployer (>= 0.6.4) but it is not going to be installed
        Depends: python-juju-deployer but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ubuntu@chthonic:~/mojo$ apt-cache madison mojo
      mojo | 0.5.2-2 | http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu bionic/main amd64 Packages

I tried installing from source into a python2 virtualenv, thinking I could at least nop out the problems or contribute a patch, but that fails with:

(env) ubuntu@chthonic:~/mojo/mojo$ python setup.py develop
running develop
running egg_info
writing requirements to mojo.egg-info/requires.txt
writing mojo.egg-info/PKG-INFO
writing top-level names to mojo.egg-info/top_level.txt
writing dependency_links to mojo.egg-info/dependency_links.txt
writing entry points to mojo.egg-info/entry_points.txt
reading manifest file 'mojo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.txt' under directory 'mojo'
warning: no files found matching '*.py' under directory 'tests'
warning: no files found matching '*.txt' under directory 'tests'
warning: no files found matching '*.yaml' under directory 'tests'
no previously-included directories found matching 'debian'
no previously-included directories found matching '.bzr'
writing manifest file 'mojo.egg-info/SOURCES.txt'
running build_ext
Creating /home/ubuntu/mojo/env/lib/python2.7/site-packages/mojo.egg-link (link to .)
Adding mojo 0.6.0 to easy-install.pth file
Installing juju-parse-status script to /home/ubuntu/mojo/env/bin
Installing mojo-project-destroy script to /home/ubuntu/mojo/env/bin
Installing mojo-project-new script to /home/ubuntu/mojo/env/bin
Installing juju-check script to /home/ubuntu/mojo/env/bin
Installing mojo-vol script to /home/ubuntu/mojo/env/bin
Installing mojo-admin script to /home/ubuntu/mojo/env/bin
Installing mojo-info script to /home/ubuntu/mojo/env/bin
Installing mojo script to /home/ubuntu/mojo/env/bin

Installed /home/ubuntu/mojo/mojo
Processing dependencies for mojo==0.6.0
Searching for jinja2
Reading https://pypi.org/simple/jinja2/
Downloading https://files.pythonhosted.org/packages/36/cc/5cd404a00f1b93bc830505c7a78553d9f49f7152c336466fc206790cc26c/Jinja2-3.0.0a1.tar.gz#sha256=c922560ac46888d47384de1dbdc3daaa2ea993af4b26a436dec31fa2c19ec668
Best match: Jinja2 3.0.0a1
Processing Jinja2-3.0.0a1.tar.gz
Writing /tmp/easy_install-bSmiZu/Jinja2-3.0.0a1/setup.cfg
Running Jinja2-3.0.0a1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-bSmiZu/Jinja2-3.0.0a1/egg-dist-tmp-Y0nJph
Traceback (most recent call last):
  File "setup.py", line 75, in <module>
    include_package_data=True,
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 38, in run
    self.install_for_development()
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 156, in install_for_development
    self.process_distribution(None, self.dist, not self.no_deps)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 758, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 774, in resolve
    replace_conflicting=replace_conflicting
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1057, in best_match
    return self.obtain(req, installer)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1069, in obtain
    return installer(requirement)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 685, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 711, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 896, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1164, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1150, in run_setup
    run_setup(setup_script, args)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-bSmiZu/Jinja2-3.0.0a1/setup.py", line 6, in <module>

  File "/home/ubuntu/mojo/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 419, in _open
    return _open(path, mode, *args, **kw)
TypeError: 'encoding' is an invalid keyword argument for this function

Revision history for this message
Laurent Sesquès (sajoupa) wrote :

Hi,

I couldn't reproduce in a fresh bionic machine:

ubuntu@juju-14d617-default-27:~$ mojo project-new -c lxd --series bionic test-lp1870439
2020-04-14 13:22:42 [INFO] Checking test-lp1870439 project path at /home/ubuntu/.local/share/mojo/test-lp1870439 ...
2020-04-14 13:22:42 [INFO] Checking test-lp1870439 project container at /home/ubuntu/.local/share/mojo/test-lp1870439/bionic ...
2020-04-14 13:22:42 [INFO] Not found, creating container
2020-04-14 13:22:42 [INFO] Retrieving image from ubuntu:bionic.
2020-04-14 13:22:45 [INFO] Launching container 'test-lp1870439-bionic'
2020-04-14 13:22:48 [INFO] Adding device mojo-project-series-root to LXC container test-lp1870439-bionic
2020-04-14 13:22:48 [INFO] Setting acls inside container: setfacl -Rdmu:100000:rwX /home/ubuntu/.local/share/mojo/test-lp1870439/bionic
2020-04-14 13:22:48 [INFO] Checking test-lp1870439 project container is setup ...
ubuntu@juju-14d617-default-27:~$

From your logs, I think that you have MOJO_* variables set, can you share them ?

Changed in mojo:
status: New → Incomplete
Revision history for this message
Casey Marshall (cmars) wrote :
Download full text (3.6 KiB)

project-new succeeds for me as well. It's workspace-new where I get the error, see below.

I tried reinstalling a new bionic VM, since I think I'd distro-upgraded my mojo VM from xenial a long time ago. Same result with fresh lxd, juju, mojo installed.

My wrapper script for mojo (https://pastebin.canonical.com/p/4yXnRqMswv/) sets MOJO_LOG and MOJO_SPEC but these are not exported.

ubuntu@chthonic:~$ ./deploy-bus.sh ./ua-event-bus-vault/
++ dirname ./deploy-bus.sh
+ cd .
++ pwd
+ LOG_DIR=/home/ubuntu/mojo-logs/
+ mkdir -p /home/ubuntu/mojo-logs/
++ date +%Y-%m-%d-%H-%M-%s.%N
+ LOG_ID=2020-04-15-20-01-1586980864.043235556
++ date
+ echo Wed Apr 15 20:01:04 UTC 2020 ./deploy-bus.sh ./ua-event-bus-vault/
+ MOJO_LOG=/home/ubuntu/mojo-logs/2020-04-15-20-01-1586980864.043235556.log
+ STAGE_NAME=devel
+ STAGE=cdo/ua-event-bus/devel
+ SERIES=bionic
+ PROJECT=mojo-prod-ua-event-bus
++ cat /dev/urandom
++ head -c 32
++ tr -cd a-f0-9
+ WORKSPACE=fd7cab2db0961d866245b4cda6a00a70
+ MOJO_SPEC=./ua-event-bus-vault/
+ mojo project-new -s bionic -c lxd mojo-prod-ua-event-bus
2020-04-15 20:01:07 [INFO] Using pre-existing container class lxd
2020-04-15 20:01:07 [INFO] Checking mojo-prod-ua-event-bus project path at /home/ubuntu/.local/share/mojo/mojo-prod-ua-event-bus ...
2020-04-15 20:01:07 [WARNING] Project mojo-prod-ua-event-bus already exists at /home/ubuntu/.local/share/mojo/mojo-prod-ua-event-bus. Using existing project
2020-04-15 20:01:07 [WARNING] Project mojo-prod-ua-event-bus project_series already exists at /home/ubuntu/.local/share/mojo/mojo-prod-ua-event-bus/bionic, using it.
2020-04-15 20:01:07 [INFO] Checking mojo-prod-ua-event-bus project container at /home/ubuntu/.local/share/mojo/mojo-prod-ua-event-bus/bionic ...
2020-04-15 20:01:07 [INFO] Checking mojo-prod-ua-event-bus project container is setup ...
+ echo 'Creating new workspace fd7cab2db0961d866245b4cda6a00a70'
Creating new workspace fd7cab2db0961d866245b4cda6a00a70
+ mojo workspace-new --project mojo-prod-ua-event-bus --series bionic --stage cdo/ua-event-bus/devel ./ua-event-bus-vault/ fd7cab2db0961d866245b4cda6a00a70
2020-04-15 20:01:09 [INFO] Using pre-existing container class lxd
2020-04-15 20:01:09 [INFO] Rsyncing ./ua-event-bus-vault/ to /home/ubuntu/.local/share/mojo/mojo-prod-ua-event-bus/bionic/fd7cab2db0961d866245b4cda6a00a70/spec
2020-04-15 20:01:11 [ERROR] Unknown error
Traceback (most recent call last):
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/cli.py", line 633, in run_with_args
    args.func(args)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/utils.py", line 305, in wrapped
    return method(*args, **kwargs)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/cli.py", line 266, in create_workspace
    project.create_workspace(spec_url, workspace, stage=args.stage, logfile=args.logfile)
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/project.py", line 324, in create_workspace
    ws.prepare()
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/workspace.py", line 58, in prepare
    self.spec # Initializes spec
  File "/snap/mojo/90/lib/python2.7/site-packages/mojo/workspace.py", line 35, in spec
    self._spec = Spec(self.spec_dir, self.spe...

Read more...

Revision history for this message
Casey Marshall (cmars) wrote :

I'm wondering if it's locale messing with python 2 utf-8 rules (or something strange?) at this point, but I don't see anything wrong there either:

LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mojo: Continuous Delivery for Juju because there has been no activity for 60 days.]

Changed in mojo:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.