RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 1320744 - Exec[tuned-virtual-host]/returns: NameError: global name 'retcode' is not defined
Summary: Exec[tuned-virtual-host]/returns: NameError: global name 'retcode' is not def...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RDO
Classification: Community
Component: openstack-packstack
Version: trunk
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: trunk
Assignee: Ivan Chavero
QA Contact: yeylon@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-23 22:12 UTC by David Moreau Simard
Modified: 2016-04-18 07:14 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-03-30 23:06:31 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 296819 0 None None None 2016-03-23 22:28:35 UTC
Red Hat Bugzilla 1265660 0 urgent CLOSED Traceback during profile selection in inactive tuned 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1305903 0 urgent CLOSED Traceback during profile selection in inactive tuned 2021-02-22 00:41:40 UTC

Description David Moreau Simard 2016-03-23 22:12:32 UTC
There is a bugfix pending release for tuned, reference BZ:
- https://bugzilla.redhat.com/show_bug.cgi?id=1265660
- https://bugzilla.redhat.com/show_bug.cgi?id=1305903

Packstack installs, starts and sets up a tuned profile here:
https://github.com/openstack/packstack/blob/94eb2fdff99184b531603202260ca5b1383ec227/packstack/puppet/templates/nova_compute.pp#L47-L61

CI has been running into intermittent issues with the output being:
Debug: Executing '/usr/bin/systemctl is-active tuned'
Debug: Exec[tuned-virtual-host](provider=posix): Executing check '/usr/sbin/tuned-adm active | /bin/grep virtual-host'
Debug: Executing '/usr/sbin/tuned-adm active | /bin/grep virtual-host'
Debug: Exec[tuned-virtual-host](provider=posix): Executing '/usr/sbin/tuned-adm profile virtual-host'
Debug: Executing '/usr/sbin/tuned-adm profile virtual-host'
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns: DBus call to Tuned daemon failed
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns: Traceback (most recent call last):
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns:   File "/usr/sbin/tuned-adm", line 72, in <module>
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns:     result = action(**options)
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns:   File "/usr/lib/python2.7/site-packages/tuned/admin/admin.py", line 80, in profile
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns:     if retcode == 0:
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns: NameError: global name 'retcode' is not defined
Notice: /Stage[main]/Main/Exec[tuned-virtual-host]/returns: Trying to (re)start tuned...
Error: /usr/sbin/tuned-adm profile virtual-host returned 3 instead of one of [0]
Error: /Stage[main]/Main/Exec[tuned-virtual-host]/returns: change from notrun to 0 failed: /usr/sbin/tuned-adm profile virtual-host returned 3 instead of one of [0]

That particular error has been resolved upstream and will eventually land in the CentOS repositories.
In the meantime, the racy and intermittent nature of the issue seems to indicate that systemctl could report tuned as active (i.e, the process is running) but tuned would not actually be ready to receive commands just yet.

Comment 1 Alan Pevec 2016-03-23 23:04:53 UTC
> There is a bugfix pending release for tuned, reference BZ:

Even with that, there's race in tuned service, according to the trace it is reported as ready when it's not.
systemd assumes Type=dbus service is ready when its name is on dbus
which happens[1] before it is actually started[2]


[1] https://git.fedorahosted.org/cgit/tuned.git/tree/tuned.py#n66
[2] https://git.fedorahosted.org/cgit/tuned.git/tree/tuned.py#n76

Comment 2 Alan Pevec 2016-03-23 23:06:31 UTC
BTW in RDO bz we should be reporting only issues with RPM packaging, this could be reported in upstream bug tracker https://bugs.launchpad.net/packstack

Comment 3 David Moreau Simard 2016-03-23 23:47:44 UTC
(In reply to Alan Pevec from comment #1)
> > There is a bugfix pending release for tuned, reference BZ:
> 
> Even with that, there's race in tuned service, according to the trace it is
> reported as ready when it's not.
> systemd assumes Type=dbus service is ready when its name is on dbus
> which happens[1] before it is actually started[2]
> 
> 
> [1] https://git.fedorahosted.org/cgit/tuned.git/tree/tuned.py#n66
> [2] https://git.fedorahosted.org/cgit/tuned.git/tree/tuned.py#n76

Good catch on the actual race that we see!
Noted for packaging vs project bug.


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