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 1412567

Summary: Regression: atomic parses trailing arguments in command
Product: Red Hat Enterprise Linux 7 Reporter: Stef Walter <stefw>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: ajia, dperpeet, dwalsh
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-28 15:41:26 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 Stef Walter 2017-01-12 10:16:03 UTC
Description of problem:

The atomic command on RHEL Atomic 7.3 no longer supports the --sysroot and --tmp-dir arguments.

Version-Release number of selected component (if applicable):

# atomic host status
State: idle
Deployments:
● rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.3.1 (2016-11-30 02:14:24)
        Commit: 42cfe1ca3305defb16dfd59cd0be5c539f19ea720dba861ed11e13941423ae86
        OSName: rhel-atomic-host
# rpm -qa atomic
atomic-1.13.8-1.el7.x86_64
# atomic host upgrade
Updating from: rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
1 metadata, 0 content objects fetched; 837 B transferred in 3 seconds
No upgrade available.

How reproducible: Every time.


Steps to Reproduce:
1. # atomic run rhel7/rhel-tools sosreport --sysroot /host --tmp- 

Actual results:

atomic: unrecognized arguments: --sysroot /host --tmp-dir /host/var/tmp
Try 'atomic --help' for more information.

Expected results:

No failure. Run the container.

Additional info:

Adding a '--' in the appropriate place makes the command work. 

Used to work in RHEL Atomic 7.2.x. Hence the regression.

# atomic host status
State: idle
Deployments:
● rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.2.7 (2016-09-09 18:43:35)
        Commit: 347c3f5eb641e69fc602878c646cf42c4bcd5d9f36847a1f24ff8f3ec80f17b1
        OSName: rhel-atomic-host

  rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.2.6 (2016-07-29 19:54:25)
        Commit: b672bf8a457cb28e003dee20c53749636ef5fce3e4743afe4aaad269d3aaa62a
        OSName: rhel-atomic-host
# rpm -q atomic
atomic-1.10.5-7.el7.x86_64
# atomic run rhel7/rhel-tools sosreport --sysroot /host --tmp-dir /host/var/tmp
rhel-tools

sosreport (version 3.2)
...

Works in Fedora Atomic 25

# atomic host status
State: idle
Deployments:
● fedora-atomic:fedora-atomic/25/x86_64/docker-host
       Version: 25.24 (2016-12-27 21:07:18)
        Commit: e456566ee11507ab105e3261e5d82a0ec0b023924c02253e8a1b63b76c5440d5
        OSName: fedora-atomic

  fedora-atomic:fedora-atomic/25/x86_64/docker-host
       Version: 25.19 (2016-12-20 17:03:15)
        Commit: 1af39f18d4899dc0e94279cfb004e67bde46f361fcc2ccc3bd8bedf7f57a9339
        OSName: fedora-atomic
# rpm -qa atomic
atomic-1.13.1-3.git5dfcaa9.fc25.x86_64
# atomic run cockpit/ws --sysroot /host --tmp-dir /host/var/tmp

Comment 1 Stef Walter 2017-01-12 10:18:02 UTC
The description above is incorrect. The real cause of the problem is that the atomic command now parses trailing arguments that used to be passed to the command inside the container.

Comment 2 Stef Walter 2017-01-12 10:19:38 UTC
This was detected by the Cockpit integration tests. Unfortunately we didn't update to testing against RHEL 7.3 Atomic until today ... fail :S

Comment 4 Alex Jia 2017-01-13 07:02:01 UTC
(In reply to Stef Walter from comment #1)
> The description above is incorrect. The real cause of the problem is that
> the atomic command now parses trailing arguments that used to be passed to
> the command inside the container.

Stef, if previous description is incorrect, could you give an correct example? thanks.

Comment 5 Stef Walter 2017-01-13 08:58:05 UTC
It's just the first sentence that's incorrect. 

INCORRECT: The atomic command on RHEL Atomic 7.3 no longer supports the --sysroot and --tmp-dir arguments.

CORRECT: The atomic command now parses trailing arguments that used to be passed to the command inside the container.

Comment 6 Stef Walter 2017-01-17 08:13:39 UTC
Possibly related argument parsing issue that has broken Fedora's usage of 'atomic storage reset': https://bugzilla.redhat.com/show_bug.cgi?id=1413862

Comment 7 Stef Walter 2017-01-17 08:17:50 UTC
Upstream Cockpit has committed a fix to work around this bug:

https://github.com/cockpit-project/cockpit/pull/5486/commits/e006659929739fa1b9e4562fb67ce4a9ab07a6fb

However the RHEL released versions atomic CLI and Cockpit will actually run into this issue. This remains a regression.

Comment 8 Alex Jia 2017-01-17 10:13:26 UTC
(In reply to Stef Walter from comment #5)
> It's just the first sentence that's incorrect. 
> 
> INCORRECT: The atomic command on RHEL Atomic 7.3 no longer supports the
> --sysroot and --tmp-dir arguments.
> 
> CORRECT: The atomic command now parses trailing arguments that used to be
> passed to the command inside the container.

IMO, we should document this change in atomic at least.

Comment 9 Daniel Walsh 2017-01-18 19:06:24 UTC
No this is definitely a bug.

Comment 10 Brent Baude 2017-05-26 13:55:34 UTC
I think this now works in upstream ... and the test in atomic-1.17.2-4 looks good.

[cloud-user@baude ~]$ sudo atomic --debug run rhel7/rhel-tools sosreport --sysroot /host --tmp-dir /host/var/tmp
docker run -it --name rhel-tools --privileged --ipc=host --net=host --pid=host -e HOST=/host -e NAME=rhel-tools -e IMAGE=rhel7/rhel-tools -v /run:/run -v /var/log:/var/log -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -v /:/host rhel7/rhel-tools sosreport --sysroot /host --tmp-dir /host/var/tmp

This container uses privileged security switches:

INFO: --ipc=host 
      Processes in this container can see and possibly interact with all semaphores and shared memory segments on the host as well as disables SELinux within the container.

INFO: --net=host 
      Processes in this container can listen to ports (and possibly rawip traffic) on the host's network.

INFO: --pid=host 
      Processes in this container can see and interact with all processes on the host and disables SELinux within the container.

INFO: --privileged 
      This container runs without separation and should be considered the same as root on your system.

For more information on these switches and their security implications, consult the manpage for 'docker run'.


sosreport (version 3.3)

This command will collect diagnostic and configuration infor...

Comment 12 Alex Jia 2017-06-19 01:17:30 UTC
[root@dell-per630-02 ~]# rpm -q atomic skopeo docker
atomic-1.18.1-2.1.git0705b1b.el7.x86_64
skopeo-0.1.20-2.el7.x86_64
docker-1.12.6-30.1.git1398f24.el7.x86_64

[root@dell-per630-02 ~]# atomic version registry.access.redhat.com/rhel7/rhel-tools
IMAGE NAME                                                  VERSION   IMAGE ID  
registry.access.redhat.com/rhel7/rhel-tools:latest          7.3-25    4bc4f634f159

[root@dell-per630-02 ~]# atomic --debug run rhel7/rhel-tools sosreport --sysroot /host --tmp-dir /host/var/tmp
The 'rhel-tools' container is using an older version of the installed
'rhel7/rhel-tools' container image. If you wish to use the newer image,
you must either create a new container with a new name or
uninstall the 'rhel-tools' container. 

# atomic uninstall --name rhel-tools rhel7/rhel-tools

and create new container on the rhel7/rhel-tools image.

# atomic update --force rhel7/rhel-toolss

 removes all containers based on an image.

sosreport (version 3.3)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

</ignore...>

Comment 14 errata-xmlrpc 2017-06-28 15:41:26 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:1627