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 1884531 - qemu-ga aborts after guest-shutdown command
Summary: qemu-ga aborts after guest-shutdown command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: qemu-kvm
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: rc
: 8.0
Assignee: Marc-Andre Lureau
QA Contact: dehanmeng
URL:
Whiteboard:
: 1879449 (view as bug list)
Depends On:
Blocks: 1900578
TreeView+ depends on / blocked
 
Reported: 2020-10-02 08:38 UTC by Tomáš Golembiovský
Modified: 2021-05-18 15:23 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-4.2.0-36.module+el8.4.0+8807+0c3dc3b0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1900578 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:22:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomáš Golembiovský 2020-10-02 08:38:48 UTC
Guest agent crashes after handling guest-shutdown command. It dies with error:

ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)

This was introduced by commit 781f2b3d1e in version 4.0.0 and fixed by commit 844bd70b in version 5.1.0. The fix has to be backported to guest agent in base rhel.

This is especially grave because there seems to be another problem in systemd where the crashed service during shutdown is stuck and systemd cannot decide whether to start or stop the service. This prevents the shutdown of VM completely.

Comment 1 John Ferlan 2020-10-02 11:45:29 UTC
Looks like we need to backport the commit into RHEL 8.4.0 and then since RHV is needs a RHEL 8.3.0 related fix as well for the guest side we'll have to make the same change and get a z-stream bz to manage that.

It's really too bad RHV cannot somehow use the RHEL-AV bits for the guest side as that would seemingly solve the issue (similarly noted in bug 1859494).

Comment 3 Marc-Andre Lureau 2020-10-04 16:15:08 UTC
*** Bug 1879449 has been marked as a duplicate of this bug. ***

Comment 4 dehanmeng 2020-10-09 14:12:22 UTC
(In reply to Tomáš Golembiovský from comment #0)
> Guest agent crashes after handling guest-shutdown command. It dies with
> error:
> 
> ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)
> 
> This was introduced by commit 781f2b3d1e in version 4.0.0 and fixed by
> commit 844bd70b in version 5.1.0. The fix has to be backported to guest
> agent in base rhel.
> 
> This is especially grave because there seems to be another problem in
> systemd where the crashed service during shutdown is stuck and systemd
> cannot decide whether to start or stop the service. This prevents the
> shutdown of VM completely.

Hi Tomáš
According to the package versions you mentioned,I tried to reproduce this bug with several versions of qemu-ga-4.0.0-x and RHEL8.1.0 guest and qemu-ga-4.2.0-x with RHEL8.3.0 , didn't hit this issue,so I want to confirm two things with you:
1. whether are these qga versions I test right? 
2. `ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)` this error info come from inside guest when the shutdown operation is completed?

Comment 5 Tomáš Golembiovský 2020-10-13 15:20:16 UTC
(In reply to dehanmeng from comment #4)
> Hi Tomáš
> According to the package versions you mentioned,I tried to reproduce this
> bug with several versions of qemu-ga-4.0.0-x and RHEL8.1.0 guest and

Is that from AV? Wasn't it 0.9x up to RHEL 8.2?

> qemu-ga-4.2.0-x with RHEL8.3.0 ,

I am able to reproduce it with: qemu-guest-agent-4.2.0-29.module+el8.3.0+7212+401047e6.x86_64
from RHEL-8.3.0-Beta-1.

> didn't hit this issue,so I want to confirm
> two things with you:
> 1. whether are these qga versions I test right? 

See above.

> 2. `ERROR:qga/main.c:532:send_response: assertion failed: (rsp &&
> s->channel)` this error info come from inside guest when the shutdown
> operation is completed?

Yes it comes from the guest. Best to enable persistent journald logs so you can get back to it after next boot. It should contain something like this:

Oct 13 11:12:48 localhost.localdomain systemd[1]: Started QEMU Guest Agent.
Oct 13 11:13:32 localhost.localdomain qemu-ga[719]: info: guest-shutdown called, mode: powerdown
Oct 13 11:13:33 localhost.localdomain qemu-ga[719]: **
Oct 13 11:13:33 localhost.localdomain qemu-ga[719]: ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)
Oct 13 11:13:33 localhost.localdomain systemd[1]: Stopping QEMU Guest Agent...
Oct 13 11:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service: Main process exited, code=dumped, status=6/ABRT
Oct 13 11:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service: Failed with result 'core-dump'.
Oct 13 11:13:33 localhost.localdomain systemd[1]: Stopped QEMU Guest Agent.

Comment 6 dehanmeng 2020-10-14 09:55:29 UTC
(In reply to Tomáš Golembiovský from comment #5)
> (In reply to dehanmeng from comment #4)
> > Hi Tomáš
> > According to the package versions you mentioned,I tried to reproduce this
> > bug with several versions of qemu-ga-4.0.0-x and RHEL8.1.0 guest and
> 
> Is that from AV? Wasn't it 0.9x up to RHEL 8.2?
> 
> > qemu-ga-4.2.0-x with RHEL8.3.0 ,
> 
> I am able to reproduce it with:
> qemu-guest-agent-4.2.0-29.module+el8.3.0+7212+401047e6.x86_64
> from RHEL-8.3.0-Beta-1.
> 
> > didn't hit this issue,so I want to confirm
> > two things with you:
> > 1. whether are these qga versions I test right? 
> 
> See above.
> 
> > 2. `ERROR:qga/main.c:532:send_response: assertion failed: (rsp &&
> > s->channel)` this error info come from inside guest when the shutdown
> > operation is completed?
> 
> Yes it comes from the guest. Best to enable persistent journald logs so you
> can get back to it after next boot. It should contain something like this:
> 
> Oct 13 11:12:48 localhost.localdomain systemd[1]: Started QEMU Guest Agent.
> Oct 13 11:13:32 localhost.localdomain qemu-ga[719]: info: guest-shutdown
> called, mode: powerdown
> Oct 13 11:13:33 localhost.localdomain qemu-ga[719]: **
> Oct 13 11:13:33 localhost.localdomain qemu-ga[719]:
> ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)
> Oct 13 11:13:33 localhost.localdomain systemd[1]: Stopping QEMU Guest
> Agent...
> Oct 13 11:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service:
> Main process exited, code=dumped, status=6/ABRT
> Oct 13 11:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service:
> Failed with result 'core-dump'.
> Oct 13 11:13:33 localhost.localdomain systemd[1]: Stopped QEMU Guest Agent.

thanks for your explanation so that I reproduced it with qemu-guest-agent-4.2.0-29.module+el8.3.0+7212+401047e6.x86_64,and I compared with 5.1.0, there were no error info at all.

Comment 7 Danilo de Paula 2020-10-15 18:01:32 UTC
QA_ack please?

Comment 11 Danilo de Paula 2020-11-18 00:47:05 UTC
qemu-kvm is for RHEL-8.4 is blocked due to bz#1898700

Comment 12 John Ferlan 2020-11-19 15:49:22 UTC
Changing to ITM=5 assuming that the build that is blocked from comment 11 will be unblocked soon.  If QE would prefer a later date, that's fine too.

Comment 16 dehanmeng 2020-11-22 14:04:07 UTC
Reproduce with version qemu-kvm-4.2.0-29.module+el8.3.0+7212+401047e6.x86_64

Steps to Reproduce:
1.Boot rhel830 guest successfully.
2.Configure log persistence in guest:
[root@ vm-73-139~]# mkdir /var/log/journal
[root@ vm-73-139~]# chgrp systemd-journal /var/log/journal
[root@ vm-73-139~]# chmod g+s /var/log/journal
[root@ vm-73-139~]# systemctl restart systemd-journald
3.Send following command in above socket connection in the host side to shutdown the guest:
[root@dell-per440-06 ~]# nc -U /tmp/qga.sock
{"execute":"guest-ping"}
{"return": {}}
{ "execute":"guest-shutdown","arguments":{"mode":"powerdown"}}
4.Check qga.service status after guest reboot.
[root@ vm-73-139~]# journalctl -e | grep -6 -i "ERROR"

Actual result:
Nov 22 21:12:48 localhost.localdomain systemd[1]: Started QEMU Guest Agent.
Nov 22 21:13:32 localhost.localdomain qemu-ga[719]: info: guest-shutdown called, mode: powerdown
Nov 22 21:13:33 localhost.localdomain qemu-ga[719]: **
Nov 22 21:13:33 localhost.localdomain qemu-ga[719]: ERROR:qga/main.c:532:send_response: assertion failed: (rsp && s->channel)
Nov 22 21:13:33 localhost.localdomain systemd[1]: Stopping QEMU Guest Agent...
Nov 22 21:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service: Main process exited, code=dumped, status=6/ABRT
Nov 22 21:13:33 localhost.localdomain systemd[1]: qemu-guest-agent.service: Failed with result 'core-dump'.
Nov 22 21:13:33 localhost.localdomain systemd[1]: Stopped QEMU Guest Agent.

Expected result:
There is no error that qga.service abort after shutdown.

Verified with version qemu-kvm-4.2.0-36.module+el8.4.0+8807+0c3dc3b0

Steps to Reproduce like above,but boot up rhel840 guest instead.

Actual result:
There is no error that qga.service abort after shutdown.

Expected result
There is no error that qga.service abort after shutdown.

Comment 21 errata-xmlrpc 2021-05-18 15:22:56 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 (Moderate: virt:rhel and virt-devel:rhel security, 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/RHSA-2021:1762


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