Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1425495

Summary: 'atomic uninstall' of the cockpit-ws container fails
Product: Red Hat Enterprise Linux 7 Reporter: Micah Abbott <miabbott>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact: Yoana Ruseva <yruseva>
Priority: unspecified    
Version: 7.3CC: ajia, bbaude, jscotka, lfriedma
Target Milestone: rcKeywords: Extras, Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Users may not be able to uninstall images using 'atomic uninstall' Due to an error in parsing the uninstall command for an image, the 'atomic' command may not successfully uninstall an image. To workaround the error, users may run the raw 'docker' command that can be found by inspecting the 'uninstall' label of an 'image'
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-26 14:28:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Micah Abbott 2017-02-21 15:05:53 UTC
Using atomic-1.15.4-1.el7.x86_64 and the cockpit-ws container on the Red Hat registry, I found that the 'atomic uninstall' command is failing.

This is a regression, as I am able to successfully uninstall the same container using atomic-1.14.1-5.el7.x86_64.

See below for some output.



# atomic uninstall registry.access.redhat.com/rhel7/cockpit-ws
bad operand type for unary +: 'unicode'

# atomic --debug uninstall registry.access.redhat.com/rhel7/cockpit-ws
Namespace(_class=<class 'Atomic.uninstall.Uninstall'>, args=[], assumeyes=False, debug=True, display=False, force=False, func='uninstall', image='registry.access.redhat.com/rhel7/cockpit-ws', name=None, opt1=None, opt2=None, opt3=None, storage=None)
bad operand type for unary +: 'unicode'
Traceback (most recent call last):
  File "/bin/atomic", line 188, in <module>
    sys.exit(_func())
  File "/usr/lib/python2.7/site-packages/Atomic/uninstall.py", line 62, in uninstall
    be.uninstall(img_obj, name=self.args.name, atomic=self)
  File "/usr/lib/python2.7/site-packages/Atomic/backends/_docker.py", line 350, in uninstall
    cmd =+ uninstall_command
TypeError: bad operand type for unary +: 'unicode'


# docker inspect registry.access.redhat.com/rhel7/cockpit-ws | grep uninstall
                "uninstall": "/usr/bin/docker run -ti --rm --privileged -v /:/host IMAGE /container/atomic-uninstall",
                "uninstall": "/usr/bin/docker run -ti --rm --privileged -v /:/host IMAGE /container/atomic-uninstall",

# docker run --rm registry.access.redhat.com/rhel7/cockpit-ws cat /container/atomic-uninstall
#!/bin/sh -eu

# This is the install script for Cockpit when run in a privileged container
#
# The host file system must be mounted at /host

cd /
PATH="/bin:/sbin"

if [ ! -d /host/etc -o ! -d /host/proc -o ! -d /host/var/run ]; then
    echo "host file system is not mounted at /host" >&2
    exit 1
fi
if [ ! -f /host/usr/bin/cockpit-bridge ]; then
    echo "cockpit-bridge must be installed in the host" >&2
    exit 1
fi
if [ ! -d /host/usr/share/cockpit ]; then
    echo "cockpit-shell and other resources must be installed in the host" >&2
    exit 1
fi
if [ -f /host/usr/libexec/cockpit-ws ]; then
    echo "cockpit-ws must not be installed in the host" >&2
    exit 1
fi

set -x

# Everything else is settings and should remain
rm -f /host/etc/pam.d/cockpit

Comment 2 Micah Abbott 2017-02-21 20:05:53 UTC
While this is a regression, the workaround is to just run the raw 'docker' command found in the 'uninstall' label.

Comment 4 Brent Baude 2017-02-21 22:04:29 UTC
Fixed upstream -> https://github.com/projectatomic/atomic/pull/903

Comment 5 Laurie Friedman 2017-02-22 16:16:22 UTC
Decision from QE:  Since there is a workaround, this is not a blocker.  I cleared the blocker flag.

Comment 7 Alex Jia 2017-03-10 09:10:43 UTC
It works in atomic-1.15.4-2.el7.x86_64.

[root@atomic-host-test cloud-user]# atomic --debug uninstall registry.access.redhat.com/rhel7/cockpit-ws
/usr/bin/docker run --rm --privileged -v /:/host registry.access.redhat.com/rhel7/cockpit-ws /container/atomic-uninstall
+ rm -f /host/etc/pam.d/cockpit

Comment 9 Alex Jia 2017-04-28 00:14:58 UTC
It also works well in latest atomic-1.17.1-1.gitf304570.el7.x86_64 w/ skopeo-0.1.18-1.el7.x86_64.

Comment 10 Alex Jia 2017-05-17 02:35:47 UTC
It also works in atomic-1.17.2-2.git2760e30.el7.x86_64.

Comment 12 errata-xmlrpc 2017-05-26 14:28:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1323