Logging error: [Errno 90] Message too long #389

Closed
opened 2021-02-04 13:59:22 +00:00 by grote · 6 comments

What I'm trying to do and why

Steps to reproduce (if a bug)

run borgmatic as a daily cronjob in Debian with --verbosity -1 and use a hook that produces lots of output (even if piped to &> /dev/null)

hooks:
    before_backup:
        - echo "`date` - Starting backup"
        - /usr/local/bin/mariadb-backup

/usr/local/bin/mariadb-backup

#!/bin/sh
mariabackup --backup &> /dev/null

Actual behavior (if a bug)

Cron sends an error email with a Logging error:

/etc/cron.daily/borgmatic:
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/handlers.py", line 933, in emit
    self.socket.send(msg)
OSError: [Errno 90] Message too long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/handlers.py", line 937, in emit
    self.socket.send(msg)
OSError: [Errno 90] Message too long
Call stack:
  File "/root/.local/bin/borgmatic", line 10, in <module>
    sys.exit(main())
  File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 787, in main
    summary_logs = parse_logs + list(collect_configuration_run_summary_logs(configs, arguments))
  File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 685, in collect_configuration_run_summary_logs
    results = list(run_configuration(config_filename, config, arguments))
  File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 84, in run_configuration
    global_arguments.dry_run,
  File "/root/.local/lib/python3.7/site-packages/borgmatic/hooks/command.py", line 70, in execute_hook
    shell=True,
  File "/root/.local/lib/python3.7/site-packages/borgmatic/execute.py", line 199, in execute_command
    (process,), (input_file, output_file), output_log_level, borg_local_path=borg_local_path
  File "/root/.local/lib/python3.7/site-packages/borgmatic/execute.py", line 129, in log_outputs
    logger.log(output_log_level, remaining_output)

Expected behavior (if a bug)

Other notes / implementation ideas

Environment

borgmatic version: 1.5.12

borgmatic installation method: pip

Borg version: borg 1.1.9

Python version: Python 3.7.3

operating system and version: Debian stable

#### What I'm trying to do and why #### Steps to reproduce (if a bug) run borgmatic as a daily cronjob in Debian with `--verbosity -1` and use a hook that produces lots of output (even if piped to `&> /dev/null`) ``` hooks: before_backup: - echo "`date` - Starting backup" - /usr/local/bin/mariadb-backup ``` /usr/local/bin/mariadb-backup ``` #!/bin/sh mariabackup --backup &> /dev/null ``` #### Actual behavior (if a bug) Cron sends an error email with a Logging error: ``` /etc/cron.daily/borgmatic: --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.7/logging/handlers.py", line 933, in emit self.socket.send(msg) OSError: [Errno 90] Message too long During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.7/logging/handlers.py", line 937, in emit self.socket.send(msg) OSError: [Errno 90] Message too long Call stack: File "/root/.local/bin/borgmatic", line 10, in <module> sys.exit(main()) File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 787, in main summary_logs = parse_logs + list(collect_configuration_run_summary_logs(configs, arguments)) File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 685, in collect_configuration_run_summary_logs results = list(run_configuration(config_filename, config, arguments)) File "/root/.local/lib/python3.7/site-packages/borgmatic/commands/borgmatic.py", line 84, in run_configuration global_arguments.dry_run, File "/root/.local/lib/python3.7/site-packages/borgmatic/hooks/command.py", line 70, in execute_hook shell=True, File "/root/.local/lib/python3.7/site-packages/borgmatic/execute.py", line 199, in execute_command (process,), (input_file, output_file), output_log_level, borg_local_path=borg_local_path File "/root/.local/lib/python3.7/site-packages/borgmatic/execute.py", line 129, in log_outputs logger.log(output_log_level, remaining_output) ``` #### Expected behavior (if a bug) #### Other notes / implementation ideas #### Environment **borgmatic version:** 1.5.12 **borgmatic installation method:** pip **Borg version:** borg 1.1.9 **Python version:** Python 3.7.3 **operating system and version:** Debian stable
Owner

Thanks for reporting this! Do you happen to know what you're using for system logs? systemd's journal or rsyslog, perhaps?

Thanks for reporting this! Do you happen to know what you're using for system logs? systemd's journal or rsyslog, perhaps?
witten added the
bug
label 2021-02-05 16:48:52 +00:00
Author

rsyslog.service is running at least.

Do I maybe need to set --syslog-verbosity to -1 as well as a workaround?

`rsyslog.service` is running at least. Do I maybe need to set `--syslog-verbosity` to `-1` as well as a workaround?
Owner

Yes, you can try that as a work-around if you really want no logging at all. But ultimately borgmatic should probably not send too-long log messages to rsyslog!

Yes, you can try that as a work-around if you really want no logging at all. But ultimately borgmatic should probably not send too-long log messages to rsyslog!
Author

you can try that as a work-around if you really want no logging at all.

I only want to be informed about errors which as I understand would still be reported, right?

But ultimately borgmatic should probably not send too-long log messages to rsyslog!

I agree. That is why I created this ticket ;)

> you can try that as a work-around if you really want no logging at all. I only want to be informed about errors which as I understand would still be reported, right? > But ultimately borgmatic should probably not send too-long log messages to rsyslog! I agree. That is why I created this ticket ;)
Owner

I only want to be informed about errors which as I understand would still be reported, right?

That's correct!

> I only want to be informed about errors which as I understand would still be reported, right? That's correct!
Owner

While I don't have a repro for this, I believe this is fixed in master now! Should be part of the next release.

While I don't have a repro for this, I believe this is fixed in master now! Should be part of the next release.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#389
No description provided.