Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UnicodeDecodeError on cobbler status #3898

@zak333

Description

@zak333

Describe the bug

When cobbler status is executed and binary files are inside /var/log/cobbler, a UnicodeDecodeError is thrown:

Unexpected remote error, check the server side logs for further info

<class 'UnicodeDecodeError'>:'utf-8' codec can't decode byte 0xfd in position 0: invalid start byte

This is due to logging mechanisms which compress and rotate older logfiles.

Steps to reproduce

  1. touch /var/log/cobbler/install.log-2099999
  2. xz /var/log/cobbler/install.log-2099999
  3. cobbler status

Expected behavior

There should be no exception.

Cobbler version

Cobbler 3.3.3
  source: ?, ?
  build time: Thu Jul 21 12:00:00 2022

Operating system

SUSE Linux Enterprise Desktop 15 SP5

Cobbler log

[Thread-36] 2025-03-25T16:05:46 - INFO | Exception occurred: <class 'UnicodeDecodeError'>
[Thread-36] 2025-03-25T16:05:46 - INFO | Exception value: 'utf-8' codec can't decode byte 0xfd in position 0: invalid start byte
[Thread-36] 2025-03-25T16:05:46 - INFO | Exception Info:
  File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 3753, in _dispatch
    return method_handle(*params)

  File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 3319, in get_status
    return self.api.status(mode=mode)

  File "/usr/lib/python3.6/site-packages/cobbler/api.py", line 1657, in status
    return statusifier.run()

  File "/usr/lib/python3.6/site-packages/cobbler/actions/status.py", line 192, in run
    self.scan_logfiles()

  File "/usr/lib/python3.6/site-packages/cobbler/actions/status.py", line 78, in scan_logfiles
    data = fd.read()

  File "/usr/lib64/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions