Bug 2097679
| Summary: | When running subscription-manager from a script, it might hang if some arguments are not provided | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Rehana <redakkan> |
| Component: | subscription-manager | Assignee: | Jason Jerome <jajerome> |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 9.0 | CC: | candlepin-bugs, dhill, jsefler, jstavel, redakkan, rhsm-qe |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | subscription-manager-1.29.32-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 2096852 | Environment: | |
| Last Closed: | 2023-05-09 08:18:42 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: | |||
| Bug Depends On: | 2096852 | ||
| Bug Blocks: | |||
|
Comment 2
Jan Stavel
2022-09-13 09:32:55 UTC
It works as supposed: root@localhost ~]# ssh -T localhost "subscription-manager register" root@localhost's password: Error: --username is a required parameter in non-interactive mode. Registering to: subscription.rhsm.stage.redhat.com:443/subscription [root@localhost ~]# rpm -qa | grep subscription-manager subscription-manager-rhsm-certificates-20220623-1.el9.noarch subscription-manager-cockpit-4^11.g9a71113-1.el9_1.noarch python3-subscription-manager-rhsm-1.29.31+24.g0e624a373-1.git.0.1356af2.x86_64 libdnf-plugin-subscription-manager-1.29.31+24.g0e624a373-1.git.0.1356af2.x86_64 subscription-manager-1.29.31+24.g0e624a373-1.git.0.1356af2.x86_64 PLAY [subscription-manager raises error when user input is required] ***********
TASK [Info about version of the entitlement stack] *****************************
ok: [192.168.122.47] =>
msg: |2-
server type: This system is currently not registered.
subscription management server: 4.2.10-1
subscription management rules: 5.43
subscription-manager: 1.29.31+24.g0e624a373-1.git.0.1356af2
TASK [Register in a script without TTY - without username, password] ***********
cmd: ssh -T localhost "subscription-manager register"
rc: 64
stdout: |-
root@localhost's password:
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Error: --username is a required parameter in non-interactive mode.
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: The right error message was printed on stdout
TASK [Register in a script without TTY - without password] *********************
cmd: ssh -T localhost "subscription-manager register --username stage_rhsmqe_testuser01"
rc: 64
stdout: |-
root@localhost's password:
Error: --password is a required parameter in non-interactive mode.
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: The right error message was printed on stdout
TASK [Register in a script without TTY - with username and password] ***********
changed: [192.168.122.47]
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: Info about registering of a system appeared.
TASK [Unregister in a script without TTY] **************************************
changed: [192.168.122.47]
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: Info about unregistering of a system appeared.
TASK [Register using activation key in a script without TTY - without org field] ***
cmd: ssh -T localhost "subscription-manager register --activationkey stage_rhsmqe_testuser01_13267397-ActivationKey1645276042189"
rc: 64
stdout: |-
root@localhost's password:
Error: Must provide --org with activation keys.
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: Info about missing field org appeared.
TASK [Register using activation key in a script without TTY] *******************
cmd: ssh -T localhost "subscription-manager register --org 13267397 --activationkey stage_rhsmqe_testuser01_13267397-ActivationKey1645276042189"
rc: 1
stdout: |-
root@localhost's password:
The system has been registered with ID: ef407fe6-5a06-45f2-a6f5-45767c34d9c9
The registered system name is: localhost.localdomain
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status: Not Subscribed
Unable to find available subscriptions for all your installed products.
TASK [ansible.builtin.assert] **************************************************
ok: [192.168.122.47] => changed=false
msg: Info about registering of a system appeared.
TASK: set the proper entitlement environment cmd: [subscription-manager, config, --server.hostname=subscription.rhsm.stage.redhat.com, --server.port=443, --server.insecure=1, '--rhsm.baseurl=https://cdn.stage.redhat.com'] rc: 0 stdout: stderr: TASK: version of installed subscription-manager package cmd: [subscription-manager, version] rc: 0 stdout: [94mMaking insecure (no auth) request:[0m[91m subscription.rhsm.stage.redhat.com:443 GET /subscription/[0m [94mMaking insecure (no auth) request:[0m[91m subscription.rhsm.stage.redhat.com:443 GET /subscription/status[0m server type: This system is currently not registered. subscription management server: 4.2.10-1 subscription management rules: 5.43 subscription-manager: 1.29.32-1.el9 stderr: TASK: Assert that a command ssh -T does not enable tty cmd: ssh -T localhost "python3 -c 'import sys; print(sys.stdin and sys.stdin.isatty())'" rc: 0 stdout: root@localhost's password: False stderr: ASSERT: A result should be False msg: All assertions passed status: ok TASK: Register in a script without TTY - without username, password cmd: ssh -T localhost "subscription-manager register" rc: 64 stdout: root@localhost's password: Registering to: subscription.rhsm.stage.redhat.com:443/subscription Error: --username is a required parameter in non-interactive mode. stderr: ASSERT: ansible.builtin.assert msg: The right error message was printed on stdout status: ok TASK: Register in a script without TTY - without password cmd: ssh -T localhost "subscription-manager register --username stage_rhsmqe_testuser01" rc: 64 stdout: root@localhost's password: Registering to: subscription.rhsm.stage.redhat.com:443/subscription Error: --password is a required parameter in non-interactive mode. stderr: ASSERT: ansible.builtin.assert msg: The right error message was printed on stdout status: ok TASK: Register in a script without TTY - with username and password cmd: ssh -T localhost "subscription-manager register --username stage_rhsmqe_testuser01 --password P@ssw0rd" rc: 0 stdout: root@localhost's password: Registering to: subscription.rhsm.stage.redhat.com:443/subscription The system has been registered with ID: 4209fc64-1d88-4ffb-8fa2-2f8ed44f06a0 The registered system name is: auto-hv-02-guest01.idmqe.lab.eng.bos.redhat.com stderr: ASSERT: ansible.builtin.assert msg: Info about registering of a system appeared. status: ok TASK: Unregister in a script without TTY cmd: ssh -T localhost "subscription-manager unregister" rc: 0 stdout: root@localhost's password: Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription System has been unregistered. stderr: ASSERT: ansible.builtin.assert msg: Info about unregistering of a system appeared. status: ok TASK: Register using activation key in a script without TTY - without org field cmd: ssh -T localhost "subscription-manager register --activationkey stage_rhsmqe_testuser01_13267397-ActivationKey1645276042189" rc: 64 stdout: root@localhost's password: Error: Must provide --org with activation keys. stderr: ASSERT: ansible.builtin.assert msg: Info about missing field org appeared. status: ok TASK: Register using activation key in a script without TTY cmd: ssh -T localhost "subscription-manager register --org 13267397 --activationkey stage_rhsmqe_testuser01_13267397-ActivationKey1645276042189" rc: 1 stdout: root@localhost's password: The system has been registered with ID: f4c5156f-1593-479e-afb4-0c1cfb6f4376 The registered system name is: auto-hv-02-guest01.idmqe.lab.eng.bos.redhat.com Installed Product Current Status: Product Name: Red Hat Enterprise Linux for x86_64 Beta Status: Not Subscribed Unable to find available subscriptions for all your installed products. stderr: ASSERT: ansible.builtin.assert msg: Info about registering of a system appeared. status: ok 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 (subscription-manager bug fix and enhancement update), 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-2023:2493 |