tuned icon indicating copy to clipboard operation
tuned copied to clipboard

TuneD traceback when recommended profile is an empty string

Open jmencak opened this issue 1 year ago • 0 comments

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 avatar Jun 09 '23 14:06 jmencak