Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TuneD traceback when recommended profile is an empty string #537

Open
jmencak opened this issue Jun 9, 2023 · 0 comments
Open

TuneD traceback when recommended profile is an empty string #537

jmencak opened this issue Jun 9, 2023 · 0 comments

Comments

@jmencak
Copy link
Contributor

jmencak commented Jun 9, 2023

Reproducer:

systemctl stop tuned
rm -f /etc/tuned/{active_profile,profile_mode}
echo '[]' > /etc/tuned/recommend.d/10-test.conf
tuned
2023-06-09 16:52:17,896 INFO     tuned.daemon.application: TuneD: 2.20.0, kernel: 6.3.5-100.fc37.x86_64
2023-06-09 16:52:17,896 INFO     tuned.daemon.application: dynamic tuning is enabled (can be overridden in plugins)
2023-06-09 16:52:17,899 INFO     tuned.daemon.daemon: using sleep interval of 1 second(s)
2023-06-09 16:52:17,899 INFO     tuned.daemon.daemon: dynamic tuning is enabled (can be overridden by plugins)
2023-06-09 16:52:17,899 INFO     tuned.daemon.daemon: using update interval of 10 second(s) (10 times of the sleep interval)
2023-06-09 16:52:17,899 INFO     tuned.daemon.daemon: Running in automatic mode, checking what profile is recommended for your configuration.
Traceback (most recent call last):
  File "/usr/sbin/tuned", line 69, in <module>
    app = tuned.daemon.Application(args.profile, config)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/daemon/application.py", line 56, in __init__
    self._daemon = daemon.Daemon(unit_manager, profile_loader, profile_name, self.config, self)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/daemon/daemon.py", line 49, in __init__
    self._init_profile(profile_names)
  File "/usr/lib/python3.11/site-packages/tuned/daemon/daemon.py", line 71, in _init_profile
    (profile_names, manual) = self._get_startup_profile()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/daemon/daemon.py", line 274, in _get_startup_profile
    profile = self._get_recommended_profile()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/daemon/daemon.py", line 265, in _get_recommended_profile
    profile = self._profile_recommender.recommend()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/utils/profile_recommender.py", line 52, in recommend
    matching = self.process_config(path, has_root=has_root)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tuned/utils/profile_recommender.py", line 66, in process_config
    config.read_file(f, fname)
  File "/usr/lib64/python3.11/configparser.py", line 734, in read_file
    self._read(f, source)
  File "/usr/lib64/python3.11/configparser.py", line 1101, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: '/etc/tuned/recommend.d/10-test.conf', line: 1
'[]\n'
jmencak added a commit to jmencak/cluster-node-tuning-operator that referenced this issue Jun 14, 2023
Add minLength == 1 to Tuned spec.profile[].name and spec.recommend[].profile
The profile name will always has at least 1 character and this will also
prevent TuneD daemon traceback when recommending an empty-string
profile.

Also see: redhat-performance/tuned#537
jmencak added a commit to jmencak/cluster-node-tuning-operator that referenced this issue Jun 14, 2023
Add minLength == 1 to Tuned spec.profile[].name and spec.recommend[].profile
The profile name always has at least 1 character and this will also
prevent TuneD daemon traceback when recommending an empty-string
profile.

Also see: redhat-performance/tuned#537
openshift-merge-robot pushed a commit to openshift/cluster-node-tuning-operator that referenced this issue Jun 15, 2023
Add minLength == 1 to Tuned spec.profile[].name and spec.recommend[].profile
The profile name always has at least 1 character and this will also
prevent TuneD daemon traceback when recommending an empty-string
profile.

Also see: redhat-performance/tuned#537

Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant