Bug 1644887 - Adding CDS fails with fatal error due to not prompting for sudo password on yum install
Summary: Adding CDS fails with fatal error due to not prompting for sudo password on y...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Documentation
Version: 3.0.5
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.x
Assignee: Parth Shah
QA Contact: Radek Bíba
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-31 19:51 UTC by Paul Dudley
Modified: 2022-11-16 18:44 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3797131 0 None None None 2020-02-19 14:01:24 UTC

Description Paul Dudley 2018-10-31 19:51:53 UTC
Description of problem:

Adding a CDS fails with the following output:

===
Checking that the RHUA services are reachable from the instance...
[rhuicds.net] sudo: yum install -d 0 -e 0 -y nc
[rhuicds.net] out: sudo password:
Fatal error: Needed to prompt for a connection or sudo password (host: rhuicds.net), but abort-on-prompts was set to True

Aborting.

Something happened, check the log file for more information: ~/.rhui/rhui.log
===

No information was recorded in /var/log/secure regarding password failures. This was the third CDS install on this RHUA, the other two CDSs did not hit this problem. This problem was remedied by adding passwordless sudo to the sudoers file on the CDS for the rhuicds user.


How reproducible:
Not reproduced reliably

Steps to Reproduce:
1. Install RHUA and CDS 
2. Create user for CDS 
3. Enter different user other than root to install CDS when prompted in rhui-manager

Actual results:
The user is not prompted for the password for the rhuicds user

Expected results:
The user is prompted for the password

Comment 3 Sagar Lutade 2019-01-10 08:17:22 UTC
We can bypass this by setting passwordless login from the user which you are trying to add CDS.
Also by adding the user and setting NOPASSWD.

# ssh-copy-id user@CDS
# ssh-keyscan -H user@CDS >> ~/.ssh/known_hosts           ======> Adding CDS as trusted with RHUA.

Then try adding the CDS again.

Comment 7 Radek Bíba 2022-05-25 15:21:25 UTC
The code that used to run "yum install -d 0 -e 0 -y nc" with sudo doesn't exist in RHUI 4.0+ because the use of paramiko/fabric was replaced with Ansible playbooks. That said, it is still necessary to use NOPASSWD in sudo configuration, or else node registration fails like this:

May 25 15:08:58 ip-10-103-223-103 sudo[14890]: **USER** : a password is required ; TTY=pts/1 ; PWD=/home/**USER** ; USER=root ; COMMAND=/bin/sh -c echo BECOME-SUCCESS-asgxmjirqxhwlfimvzatjaxtnnzcvpwh ; /usr/libexec/platform-python /home/**USER**/.ansible/tmp/ansible-tmp-1653491338.2099364-43364-176605629361190/AnsiballZ_setup.py

(this is from /var/log/secure on the CDS)


Note You need to log in before you can comment on or make changes to this bug.