SIGTERM when using consistency.prefix = {hostname}-{now} #162

Closed
opened 2019-05-10 00:48:23 +00:00 by meowsqueak · 5 comments

I've recently upgraded borgmatic (via pip to 1.3.2, not sure what the old version was unfortunately) and I saw the warning:

/etc/borgmatic/config.yaml: Parsing configuration file
Since version 1.1.16, if you provide `archive_name_format`, you should also specify `consistency.prefix`.

Because storage.prefix is set (by me) to archive_name_format: '{hostname}-{now}' I therefore set consistency.prefix to the same value.

The warning is no longer displayed, however this now generates the following error:

/etc/borgmatic/config.yaml: Error running configuration file
Command 'echo "`date` - Error while creating a backup."' died with <Signals.SIGTERM: 15>.
I've recently upgraded borgmatic (via pip to 1.3.2, not sure what the old version was unfortunately) and I saw the warning: ``` /etc/borgmatic/config.yaml: Parsing configuration file Since version 1.1.16, if you provide `archive_name_format`, you should also specify `consistency.prefix`. ``` Because `storage.prefix` is set (by me) to `archive_name_format: '{hostname}-{now}'` I therefore set `consistency.prefix` to the same value. The warning is no longer displayed, however this now generates the following error: ``` /etc/borgmatic/config.yaml: Error running configuration file Command 'echo "`date` - Error while creating a backup."' died with <Signals.SIGTERM: 15>. ```
Owner

Thanks for filing this. Could I have a look at your config.yaml file contents (with any sensitive information redacted)? Do you for instance have a "hook" in place that looks like the failing command?

Thanks for filing this. Could I have a look at your `config.yaml` file contents (with any sensitive information redacted)? Do you for instance have a "hook" in place that looks like the failing command?
Contributor

It would also be useful to see -v 2 verbose output.

It would also be useful to see `-v 2` verbose output.
witten added the
question / support
label 2019-05-12 01:04:13 +00:00
Author

Sorry for the delay in getting back to this - I looked to reproduce this and for some reason I am not able to. The backup now proceeds as expected. Is it possible that this was caused by having existing archives that did not use this new config option, and enabling it caused the issue? Yet three days later, during which the backup has run to completion at least once, the problem is no longer occurring.

Sorry I can't explain this at all - the problem has literally just "gone away".

Sorry for the delay in getting back to this - I looked to reproduce this and for some reason I am not able to. The backup now proceeds as expected. Is it possible that this was caused by having existing archives that did not use this new config option, and enabling it caused the issue? Yet three days later, during which the backup has run to completion at least once, the problem is no longer occurring. Sorry I can't explain this at all - the problem has literally just "gone away".
Author

@witten my config.yaml looks like this:

location:
    source_directories:
        - /etc
        - /Users
        - /Library

    one_file_system: true

    files_cache: ctime,size,inode

    remote_path: borg1

    repositories:
        - /Volumes/Backup/borg/<my-machine-name>

    exclude_patterns:
        - '*.pyc'
        - /home/*/.cache
        - /etc/ssl

    exclude_from:
        - /etc/borgmatic/excludes

    exclude_caches: true

    exclude_if_present: .nobackup

storage:
    compression: lz4

    remote_rate_limit: 100

    umask: 0077

    archive_name_format: '{hostname}-{now}'

retention:
    keep_within: 3H

    keep_hourly: 24

    keep_daily: 7

    keep_weekly: 4

    keep_monthly: 6

    keep_yearly: 1

    prefix: "{hostname}-{now}"

consistency:
    checks:
        - repository
        - archives

    check_last: 3

    prefix: "{hostname}-{now}"

hooks:
    before_backup:
        - echo "`date` - Starting a backup job."

    after_backup:
        - echo "`date` - Backup created."

    on_error:
        - echo "`date` - Error while creating a backup."

So yes, that last on_error hook looks like the error message. What I didn't see in the log from three days ago was any other error (I had --verbosity==2 at the time).

Sorry, I am puzzled by this, there was definitely an issue three days ago, but it seems to have solved itself by the time I got to look at it again today, and I can't explain why.

@witten my `config.yaml` looks like this: ``` location: source_directories: - /etc - /Users - /Library one_file_system: true files_cache: ctime,size,inode remote_path: borg1 repositories: - /Volumes/Backup/borg/<my-machine-name> exclude_patterns: - '*.pyc' - /home/*/.cache - /etc/ssl exclude_from: - /etc/borgmatic/excludes exclude_caches: true exclude_if_present: .nobackup storage: compression: lz4 remote_rate_limit: 100 umask: 0077 archive_name_format: '{hostname}-{now}' retention: keep_within: 3H keep_hourly: 24 keep_daily: 7 keep_weekly: 4 keep_monthly: 6 keep_yearly: 1 prefix: "{hostname}-{now}" consistency: checks: - repository - archives check_last: 3 prefix: "{hostname}-{now}" hooks: before_backup: - echo "`date` - Starting a backup job." after_backup: - echo "`date` - Backup created." on_error: - echo "`date` - Error while creating a backup." ``` So yes, that last `on_error` hook looks like the error message. What I didn't see in the log from three days ago was any other error (I had `--verbosity==2` at the time). Sorry, I am puzzled by this, there was definitely an issue three days ago, but it seems to have solved itself by the time I got to look at it again today, and I can't explain why.
Owner

Glad to hear it's working now! Your config looks fine to me. If anything, you could probably just remove the hooks entirely, as they're duplicative if you're running with any verbosity level (--verbosity 1 or --verbosity 2).

Is it possible that this was caused by having existing archives that did not use this new config option, and enabling it caused the issue?

The consistency prefix? I don't think so, as that logic is applied by borgmatic/Borg and is not specific to archive contents.

In any case, if you encounter this again, please feel free to re-open or re-file. Thanks.

Glad to hear it's working now! Your config looks fine to me. If anything, you could probably just remove the hooks entirely, as they're duplicative if you're running with any verbosity level (`--verbosity 1` or `--verbosity 2`). > Is it possible that this was caused by having existing archives that did not use this new config option, and enabling it caused the issue? The consistency prefix? I don't think so, as that logic is applied by borgmatic/Borg and is not specific to archive contents. In any case, if you encounter this again, please feel free to re-open or re-file. Thanks.
Sign in to join this conversation.
No Milestone
No Assignees
3 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#162
No description provided.