project-new both should and should not be run as root

Bug #1833703 reported by Iain Lane on 2019-06-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mojo
Undecided
Iain Lane

Bug Description

This just happened:

laney@raleigh> mojo project-new $MOJO_PROJECT -s $MOJO_SERIES --container containerless
2019-06-21 11:43:43 [ERROR] This sub-command, project-new, must be run as root
laney@raleigh> sudo mojo project-new $MOJO_PROJECT -s $MOJO_SERIES --container containerless
[sudo] password for laney:
This should not be run as root, exiting.
Possibly use --break_everything option if you are really sure!

laney@raleigh> env | grep MOJO
MOJO_SERIES=bionic
MOJO_PROJECT=autopkgtest-cloud
MOJO_SPEC=/home/laney/dev/canonical/release/autopkgtest-cloud/mojo/
MOJO_STAGE=devel
MOJO_WORKSPACE=autopkgtest-cloud

laney@raleigh> snap info mojo
name: mojo
summary: Mojo - Continuous Delivery for Juju
publisher: Stuart Bishop (stub)
contact: https://launchpad.net/mojo
license: unset
description: |
  Mojo is a system of configuration and tools for verifying the success of Juju environment
  deployments. It's available as an open source project under the GPLv3 license on Launchpad.
commands:
  - mojo
snap-id: 8GZ3t2c3Ah0N6Ht1luBY351TLORtUL3d
tracking: stable
refresh-date: 22 days ago, at 16:55 BST
channels:
  stable: 0.5.1+492 2018-11-29 (61) 60MB classic
  candidate: 0.5.1+489 2018-07-13 (57) 61MB classic
  beta: 0.5.1+489 2018-07-13 (57) 61MB classic
  edge: 0.5.1+501 2019-05-20 (69) 61MB classic
installed: 0.5.1+492 (61) 60MB classic

Related branches

Iain Lane (laney) on 2019-06-21
description: updated
Iain Lane (laney) wrote :

It's because of the --container containerless. Should be fixed in the attached MP

Changed in mojo:
assignee: nobody → Iain Lane (laney)
status: New → In Progress
Iain Lane (laney) on 2019-06-24
Changed in mojo:
status: In Progress → Fix Committed
Stuart Bishop (stub) wrote :

This revision has been published to mojo's edge snap channel for testing.

Iain Lane (laney) wrote :

Seems to work for me:

laney@raleigh> snap refresh --amend --channel=edge mojo
mojo (edge) 0.5.1+504 from Stuart Bishop (stub) refreshed
laney@raleigh> env -i PATH=$PATH mojo project-new foobar -s bionic --container containerless
2019-06-25 10:23:55 [INFO] Checking foobar project path at /home/laney/.local/share/mojo/foobar ...
2019-06-25 10:23:55 [INFO] Containerless project has no container config
2019-06-25 10:23:55 [INFO] Checking foobar project container at /home/laney/.local/share/mojo/foobar/bionic ...
2019-06-25 10:23:55 [INFO] Checking foobar project container is setup ...
laney@raleigh> mojo project-destroy -s bionic foobar
2019-06-25 10:24:01 [INFO] Using pre-existing container class containerless
2019-06-25 10:24:02 [INFO] Using pre-existing container class containerless
2019-06-25 10:24:02 [INFO] Destroying project: foobar, series: bionic
2019-06-25 10:24:02 [INFO] Using no container. Not destroying a container
2019-06-25 10:24:02 [INFO] Destroying project root: /home/laney/.local/share/mojo/foobar

not sure what the project's policy on Fix Released is so I'll let a maintainer handle changing it.

Stuart Bishop (stub) on 2019-06-25
Changed in mojo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers