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 1739418 - Regression: Unhandled exception in tuned 2.11 when using '=>' for a sysctl
Summary: Regression: Unhandled exception in tuned 2.11 when using '=>' for a sysctl
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.7
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL:
Whiteboard:
: 1749411 (view as bug list)
Depends On:
Blocks: 1739563 1752415
TreeView+ depends on / blocked
 
Reported: 2019-08-09 09:26 UTC by Jiří Mencák
Modified: 2024-08-28 08:46 UTC (History)
10 users (show)

Fixed In Version: tuned-2.11.0-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1739563 1752415 (view as bug list)
Environment:
Last Closed: 2020-03-31 19:12:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1739322 0 unspecified CLOSED The tuned pod doesn't set max virtual memory areas vm.max_map_count for elasticsearch pod in node. 2023-10-06 18:28:51 UTC
Red Hat Knowledge Base (Solution) 4392331 0 None None None 2019-09-05 20:18:05 UTC
Red Hat Knowledge Base (Solution) 4395931 0 None None None 2019-09-20 16:26:37 UTC
Red Hat Product Errata RHBA-2020:1008 0 None None None 2020-03-31 19:12:38 UTC

Description Jiří Mencák 2019-08-09 09:26:37 UTC
Description of problem:
When running tuned 2.11, sysctl settings with '=>' functionality cause unhandled exceptions.

Version-Release number of selected component (if applicable):
tuned-2.11.0-5.el7.noarch

How reproducible:
Always when running tuned in one-shot mode

Steps to Reproduce:
1. mkdir -p /etc/tuned/pidmax
2. 
[root@b7 pidmax]# cat > /etc/tuned/pidmax/tuned.conf <<EOF
> [main]
> summary=PoC
> 
> [sysctl]
> kernel.pid_max=>131072
> EOF

3. Optionally switch tuned config to one-shot mode
sed -i 's|^daemon.*|daemon = 0|' /etc/tuned/tuned-main.conf 

4. Shut down the tuned daemon if running

5. Run tuned (e.g. tuned --no-dbus --debug)

Actual results:
[root@b7 pidmax]# rpm -q tuned
tuned-2.11.0-5.el7.noarch
[root@b7 pidmax]# tuned --no-dbus --debug
2019-08-09 05:05:13,253 INFO     tuned.daemon.application: dynamic tuning is globally disabled
2019-08-09 05:05:13,257 DEBUG    tuned.daemon.daemon: initializing daemon
2019-08-09 05:05:13,257 INFO     tuned.daemon.daemon: using sleep interval of 1 second(s)
2019-08-09 05:05:13,257 INFO     tuned.profiles.loader: loading profile: pidmax
2019-08-09 05:05:13,258 WARNING  tuned.daemon.application: Using one shot no deamon mode, most of the functionality will be not available, it can be changed in global config
2019-08-09 05:05:13,258 INFO     tuned.daemon.controller: starting controller
2019-08-09 05:05:13,258 INFO     tuned.daemon.daemon: starting tuning
2019-08-09 05:05:13,259 DEBUG    tuned.plugins.repository: creating plugin sysctl
2019-08-09 05:05:13,259 DEBUG    tuned.utils.plugin_loader: loading module tuned.plugins.plugin_sysctl
2019-08-09 05:05:13,259 DEBUG    tuned.units.manager: creating 'sysctl' (sysctl)
2019-08-09 05:05:13,259 DEBUG    tuned.plugins.base: initializing instance sysctl (sysctl)
2019-08-09 05:05:13,259 DEBUG    tuned.hardware.inventory: starting monitor observer
2019-08-09 05:05:13,260 INFO     tuned.daemon.controller: terminating controller
2019-08-09 05:05:13,260 INFO     tuned.daemon.daemon: stopping tuning
2019-08-09 05:05:13,260 DEBUG    tuned.plugins.plugin_sysctl: Value of sysctl parameter 'kernel.pid_max' is '131072'
2019-08-09 05:05:13,260 DEBUG    tuned.plugins.plugin_sysctl: Setting sysctl parameter 'kernel.pid_max' to 'None'
2019-08-09 05:05:13,261 ERROR    tuned.units.manager: BUG: Unhandled exception in start_tuning: expected a character buffer object
2019-08-09 05:05:13,261 ERROR    tuned.units.manager: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tuned/units/manager.py", line 88, in _try_call
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/instance/instance.py", line 78, in apply_tuning
    self._plugin.instance_apply_tuning(self)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/base.py", line 261, in instance_apply_tuning
    self._instance_apply_static(instance)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysctl.py", line 62, in _instance_apply_static
    _write_sysctl(option, new_value)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysctl.py", line 174, in _write_sysctl
    f.write(value)
TypeError: expected a character buffer object

2019-08-09 05:05:13,261 INFO     tuned.daemon.daemon: static tuning from profile 'pidmax' applied
2019-08-09 05:05:13,261 DEBUG    tuned.utils.commands: Executing ['systemctl', 'is-system-running'].
2019-08-09 05:05:13,265 DEBUG    tuned.utils.commands: Executing ['systemctl', 'list-jobs'].
2019-08-09 05:05:13,269 INFO     tuned.daemon.daemon: terminating Tuned in one-shot mode
2019-08-09 05:05:13,270 DEBUG    tuned.units.manager: destroying instance sysctl
2019-08-09 05:05:13,270 DEBUG    tuned.units.manager: cleaning plugin 'sysctl'
[root@b7 pidmax]# echo $? # Ideally, this should also be non-zero when failing
0

Expected results:
No unhandled exception and the sysctl applied as expected.

Additional info:
Associated OCP 4.1 bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1739322

Comment 3 Jaroslav Škarvada 2019-08-09 09:47:03 UTC
Fixed by the following upstream commit:
https://github.com/redhat-performance/tuned/commit/a8f2a8306e1bac6cfc739e6753d381bf509c995e

Comment 10 Ryan Howe 2019-09-05 20:18:05 UTC
*** Bug 1749411 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2020-03-31 19:12:11 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, 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-2020:1008


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