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 2039652 - No error info report when failed to start daemon for setting log_outputs to non-exist dir
Summary: No error info report when failed to start daemon for setting log_outputs to n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-12 07:28 UTC by yafu
Modified: 2022-05-17 13:07 UTC (History)
8 users (show)

Fixed In Version: libvirt-8.0.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:46:17 UTC
Type: Bug
Target Upstream Version: 8.0.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-107529 0 None None None 2022-01-12 07:41:24 UTC
Red Hat Product Errata RHBA-2022:2390 0 None None None 2022-05-17 12:46:49 UTC

Description yafu 2022-01-12 07:28:17 UTC
Description of problem:
No error info report when failed to start daemon for setting log_outputs to non-exist dir

Version-Release number of selected component (if applicable):
libvirt-8.0.0-0rc1.1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Change log setting in virtqemud.conf and set log_outputs to non-existing dir:
#vim /etc/libvirt/virtqemud.conf
log_level = 1
log_outputs = "1:syslog:virtqemud 1:file:/test/virteqmud.log"

2.Check the log path:
#ls /test
ls: cannot access '/test': No such file or directory

3.Restart the daemon:
#systemctl restart virtqemud
Job for virtqemud.service failed because the control process exited with error code.
See "systemctl status virtqemud.service" and "journalctl -xeu virtqemud.service" for details.

4.Check the syslog:
#cat /var/log/messages
Jan 12 02:20:36 * systemd[1]: Starting Virtualization qemu daemon...
Jan 12 02:20:36 * virtqemud[30897]: 2022-01-12 07:20:36.624+0000: 30897: info : libvirt version: 8.0.0, package: 0rc1.1.el9 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2022-01-10-08:11:57, )
Jan 12 02:20:36 * virtqemud[30897]: 2022-01-12 07:20:36.624+0000: 30897: info : hostname: *
Jan 12 02:20:36 * virtqemud[30897]: 2022-01-12 07:20:36.624+0000: 30897: debug : virLogParseOutputs:1635 : outputs=1:syslog:virtqemud 1:file:/test/virteqmud.log
Jan 12 02:20:36 * virtqemud[30897]: 2022-01-12 07:20:36.624+0000: 30897: debug : virLogParseOutput:1482 : output=1:syslog:virtqemud
Jan 12 02:20:36 * virtqemud[30897]: 2022-01-12 07:20:36.624+0000: 30897: debug : virLogParseOutput:1482 : output=1:file:/test/virteqmud.log
Jan 12 02:20:36 dell-per440-14 systemd[1]: virtqemud.service: Main process exited, code=exited, status=1/FAILURE
Jan 12 02:20:36 dell-per440-14 systemd[1]: virtqemud.service: Failed with result 'exit-code'.

5.Try to start the daemon at foreground:
# virtqemud 
2022-01-12 07:23:25.769+0000: 30937: info : libvirt version: 8.0.0, package: 0rc1.1.el9 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2022-01-10-08:11:57, )
2022-01-12 07:23:25.769+0000: 30937: info : hostname: *
2022-01-12 07:23:25.769+0000: 30937: debug : virLogParseOutputs:1635 : outputs=1:syslog:virtqemud 1:file:/test/virteqmud.log
2022-01-12 07:23:25.770+0000: 30937: debug : virLogParseOutput:1482 : output=1:syslog:virtqemud
2022-01-12 07:23:25.770+0000: 30937: debug : virLogParseOutput:1482 : output=1:file:/test/virteqmud.log


Actual results:
Daemon failed to start, but no error info about the failed reason when setting log_output to non-exist dir

Expected results:
Should report related error when failed to start daemon

Additional info:
1.Can start daemon successfully when setting log_output to non-existing dir with libvirt-daemon-7.10.0-1.module+el8.6.0+13502+4f24a11d.x86_64.

Comment 1 Michal Privoznik 2022-01-12 10:06:54 UTC
Fixed upstream by:

2a9264b8b2 util: fix prototype of virDaemonSetupLogging
cfb67c8cf4 Do not print error in remote_daemon.c:main
9b652d5841 Dispatch error in virInitialize
9f6749dea0 util: Check for errors in virLogSetFromEnv
a873924e36 Exit on errors from virDaemonSetupLogging
b863085493 util: Initialize virLogMutex statically
ed5a93e4ed util: Report error in virLogSetDefaultOutputToFile
47fb83f8b7 util: Do not hide errors in virLogSetDefaultOutput
3e54152d9f util: Report error in virLogParseDefaultPriority

v8.0.0-rc1~44

Comment 2 yafu 2022-01-13 09:12:52 UTC
(In reply to Michal Privoznik from comment #1)
> Fixed upstream by:
> 
> 2a9264b8b2 util: fix prototype of virDaemonSetupLogging
> cfb67c8cf4 Do not print error in remote_daemon.c:main
> 9b652d5841 Dispatch error in virInitialize
> 9f6749dea0 util: Check for errors in virLogSetFromEnv
> a873924e36 Exit on errors from virDaemonSetupLogging
> b863085493 util: Initialize virLogMutex statically
> ed5a93e4ed util: Report error in virLogSetDefaultOutputToFile
> 47fb83f8b7 util: Do not hide errors in virLogSetDefaultOutput
> 3e54152d9f util: Report error in virLogParseDefaultPriority
> 
> v8.0.0-rc1~44

Hi Michal,

I still can reproduce the issue with v8.0.0-rc2-5-g59e0d130fe. 
Would you help to check it please?Thanks.

Comment 3 Martin Kletzander 2022-01-13 13:47:51 UTC
Fix posted upstream:

https://listman.redhat.com/archives/libvir-list/2022-January/msg00590.html

Comment 4 Martin Kletzander 2022-01-13 14:45:23 UTC
Fixed upstream with v8.0.0-rc2-10-g537b51daeb8a:
commit 537b51daeb8a9a89e58df16bdc5f83dd3f31b978
Author: Martin Kletzander <mkletzan>
Date:   Thu Jan 13 14:41:03 2022 +0100

    Print errors on daemon startup if logging setup fails

Comment 8 yafu 2022-01-19 02:49:35 UTC
Verified with libvirt-8.0.0-1.el9.x86_64.

Test steps:
1.Change log setting in virtqemud.conf and set log_outputs to non-existing dir:
#vim /etc/libvirt/virtqemud.conf
log_level = 1
log_outputs = "1:syslog:virtqemud 1:file:/test/virteqmud.log"

2.Check the log path:
#ls /test
ls: cannot access '/test': No such file or directory

3.Restart the daemon:
#systemctl restart virtqemud
Job for virtqemud.service failed because the control process exited with error code.
See "systemctl status virtqemud.service" and "journalctl -xeu virtqemud.service" for details.

4.Check the syslog, can see error info about the non-existing dir:
#cat /var/log/messages
...
Jan 18 21:45:52 dell-per440-14 virtqemud[29429]: 2022-01-19 02:45:52.596+0000: 29429: debug : virLogParseOutputs:1635 : outputs=3:syslog:virtqemud 1:file:/test/libvirtd.log
Jan 18 21:45:52 dell-per440-14 virtqemud[29429]: 2022-01-19 02:45:52.596+0000: 29429: debug : virLogParseOutput:1482 : output=3:syslog:virtqemud
Jan 18 21:45:52 dell-per440-14 virtqemud[29429]: 2022-01-19 02:45:52.596+0000: 29429: debug : virLogParseOutput:1482 : output=1:file:/test/libvirtd.log
Jan 18 21:45:52 dell-per440-14 virtqemud[29429]: libvirt:  error : failed to open /test/libvirtd.log: No such file or directory
Jan 18 21:45:52 dell-per440-14 systemd[1]: virtqemud.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 21:45:52 dell-per440-14 systemd[1]: virtqemud.service: Failed with result 'exit-code'.
Jan 18 21:45:52 dell-per440-14 systemd[1]: Failed to start Virtualization qemu daemon.

...

Comment 10 errata-xmlrpc 2022-05-17 12:46:17 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 (new packages: libvirt), 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-2022:2390


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