Skip to content

bareos-fd-mariabackup: ignore invalid utf8 on decode()#2527

Merged
BareosBot merged 2 commits intobareos:masterfrom
philfry:mariabackup-decode
Feb 9, 2026
Merged

bareos-fd-mariabackup: ignore invalid utf8 on decode()#2527
BareosBot merged 2 commits intobareos:masterfrom
philfry:mariabackup-decode

Conversation

@philfry
Copy link
Contributor

@philfry philfry commented Jan 30, 2026

Thank you for contributing to the Bareos Project!

From time to time my mariadb backups (11.8.5 in my case) failed with

Fatal error: bareosfd: Traceback (most recent call last):
  File "/usr/lib64/bareos/plugins/BareosFdWrapper.py", line 69, in handle_plugin_event
    return bareos_fd_plugin_object.handle_plugin_event(event)
  File "/usr/lib64/bareos/plugins/BareosFdPluginBaseclass.py", line 422, in handle_plugin_event
    return self.start_backup_job()
  File "/usr/lib64/bareos/plugins/bareos-fd-mariabackup.py", line 333, in start_backup_job
    innodb_status = self.get_lsn_by_command()
  File "/usr/lib64/bareos/plugins/bareos-fd-mariabackup.py", line 195, in get_lsn_by_command
    ret = check_output(get_lsn_cmd).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 22371: invalid continuation byte

I guess it's best to just ignore non-decodeable data as it's probably irrelevant for extracting the LSN.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@sebsura
Copy link
Contributor

sebsura commented Feb 2, 2026

Thanks for the PR. Did you check why mariadb outputs non-utf8 data for you ? Does it run with a different locale ?

@philfry
Copy link
Contributor Author

philfry commented Feb 3, 2026

The databases are utf8mb4 and utf8mb3 containing icinga2 check results and icingaweb2 settings. I suspect some perfdata output from icinga2/nagios plugins might be not properly utf8 encoded, but I didn't debug any further. If needed I could add some debug lines to save the output to a file if decoding goes wrong.

@arogge arogge requested a review from sebsura February 3, 2026 10:33
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work.

@sebsura
Copy link
Contributor

sebsura commented Feb 4, 2026

Feel free to add yourself to the AUTHORS file.

@philfry philfry force-pushed the mariabackup-decode branch from 9f6e990 to 53c3daf Compare February 4, 2026 06:56
@sebsura sebsura force-pushed the mariabackup-decode branch from 53c3daf to 1bd2416 Compare February 9, 2026 06:03
@BareosBot BareosBot merged commit dfa89db into bareos:master Feb 9, 2026
1 check was pending
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

Successfully merging this pull request may close these issues.

3 participants