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 1663395 - when libvirtd use listen_tls and auth_tls="sasl", libvirtd report error: authentication failed: Failed to start SASL negotiation: -20 (SASL(-13): user not found: unable to canonify user and get auxprops
Summary: when libvirtd use listen_tls and auth_tls="sasl", libvirtd report error: auth...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-04 07:58 UTC by wangyuehui
Modified: 2019-10-22 02:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-17 13:24:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description wangyuehui 2019-01-04 07:58:40 UTC
Description of problem:
when libvirtd use listen_tls and auth_tls="sasl", and use "saslpasswd2 -a libvirtd -f passwd.db admin" to add the user, and use "virsh -c qemu+tls://ip/system" to connect to remote kvm host, libvirtd report error: authentication failed: Failed to start SASL negotiation: -20 (SASL(-13): user not found: unable to canonify user and get auxprops

Version-Release number of selected component (if applicable):
# libvirtd -V
libvirtd (libvirt) 4.5.0

How reproducible:


Steps to Reproduce:
1.
# grep ^[^#] libvirtd.conf 
listen_tls = 1
listen_addr = "0.0.0.0"
auth_tls = "sasl"
2.
# grep ^[^#] /etc/sasl2/libvirt.conf 
mech_list: scram-sha-1
sasldb_path: /etc/libvirt/passwd.db
3.
grep ^[^#] /etc/sysconfig/libvirtd 
LIBVIRTD_ARGS="--listen"
4.# grep ^[^#] /etc/libvirt/qemu.conf 
vnc_listen = "0.0.0.0"
5. # saslpasswd2 -a libvirt admin
Password: 
Again (for verification): 
# sasldblistusers2 -f /etc/libvirt/passwd.db 
admin@c2-app-kvm1: userPassword
root@c2-app-kvm1: userPassword
6.#   virsh -c qemu+tls://10.134.64.21/system                                                  
Please enter your authentication name: admin
Please enter your password: 
error: failed to connect to the hypervisor
error: authentication failed: authentication failed

Actual results:
client:
error: failed to connect to the hypervisor
error: authentication failed: authentication failed
libvirtd server:
libvirtd[286000]: 2019-01-04 07:29:57.607+0000: 286004: error : virNetSASLSessionServerStart:544 : authentication failed: Failed to start SASL negotiation: -20 (SASL(-13): user ...d get auxprops)
libvirtd[286000]: 2019-01-04 07:29:57.607+0000: 286004: error : remoteDispatchAuthSaslStart:3596 : authentication failed: authentication failed

Expected results:
login successfully

Additional info:

Comment 2 wangyuehui 2019-01-04 08:10:11 UTC
libvirtd log:
libvirtd: 2019-01-04 07:26:51.224+0000: 286002: error : virNetSASLSessionServerStart:544 : authentication failed: Failed to start SASL negotiation: -20 (SASL(-13): user not found: unable to canonify user and get auxprops)
libvirtd: 2019-01-04 07:26:51.224+0000: 286002: error : remoteDispatchAuthSaslStart:3596 : authentication failed: authentication failed
libvirtd: 2019-01-04 07:26:51.225+0000: 286000: error : virNetSocketReadWire:1791 : Cannot recv data: Input/output error

if I comment the auth_tls = "sasl" line in libvirtd.conf, then "virsh -c qemu+tls://ip/system"  will login successfully.
I am confused by the libvirtd error log "user not found" because I have already add this user and have no idear when google it. 
When I use libvirt 3.9.0 on other kvm host, it works for me.

Comment 3 Ján Tomko 2019-04-17 13:24:26 UTC
Does this also happen if you connect via a hostname matching the output of sasldblistusers2?
Alternatively, supply the full username (admin@c2-app-kvm1) to the "authentication name:" prompt.

Either way, this does not seem like a libvirt bug.

Comment 4 wangyuehui 2019-10-22 02:58:39 UTC
two resolvtions:
1.  when use sasldb to create user, need to give "-f /etc/libvirt/passwd.db", if no "-f" options, in some version of OS, it is not store in " /etc/libvirt/passwd.db"
2.  in some version of libvirtd, use full username and hostname as admin@c2-app-kvm1 to login to libvirtd


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