{"action":"created","issue":{"url":"https://api.github.com/repos/borgbackup/borg/issues/3912","repository_url":"https://api.github.com/repos/borgbackup/borg","labels_url":"https://api.github.com/repos/borgbackup/borg/issues/3912/labels{/name}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/3912/comments","events_url":"https://api.github.com/repos/borgbackup/borg/issues/3912/events","html_url":"https://github.com/borgbackup/borg/issues/3912","id":333094908,"node_id":"MDU6SXNzdWUzMzMwOTQ5MDg=","number":3912,"title":"\"does not look like a Borg cache\" error on pruning","user":{"login":"dpantel","id":15957402,"node_id":"MDQ6VXNlcjE1OTU3NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/15957402?v=4","gravatar_id":"","url":"https://api.github.com/users/dpantel","html_url":"https://github.com/dpantel","followers_url":"https://api.github.com/users/dpantel/followers","following_url":"https://api.github.com/users/dpantel/following{/other_user}","gists_url":"https://api.github.com/users/dpantel/gists{/gist_id}","starred_url":"https://api.github.com/users/dpantel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpantel/subscriptions","organizations_url":"https://api.github.com/users/dpantel/orgs","repos_url":"https://api.github.com/users/dpantel/repos","events_url":"https://api.github.com/users/dpantel/events{/privacy}","received_events_url":"https://api.github.com/users/dpantel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-17T21:38:34Z","updated_at":"2018-06-20T22:00:29Z","closed_at":null,"author_association":"NONE","body":"## Have you checked borgbackup docs, FAQ, and open Github issues?\r\n\r\nYes\r\n\r\n## Is this a BUG / ISSUE report or a QUESTION?\r\n\r\nBUG / ISSUE\r\n\r\n## System information. For client/server mode post info for both machines.\r\n\r\n- Platform: Linux asylum 4.13.0-45-generic ~16.04.1-Ubuntu SMP x86_64\r\n- Linux: LinuxMint 18.2 sonya\r\n- Borg: 1.1.5  Python: CPython 3.5.2\r\n- FS: source data on ext4, archive on btrfs\r\n- All archives: 561.22 GB (orig) / 463.21 GB (compressed) / 9.46 GB (dedup)\r\n- Chunk index: 32771 (unique) / 3701498 (total)\r\n\r\n## Describe the problem you're observing.\r\n\r\nSeveral days ago, my hourly borg/borgmatic script started throughing exceptions on purge.  I can execute both the borgmatic script and the cronjob manually (as root) without issue.  I can also run the prune command manually without issue.  But when it runs unattended, I get the following error:\r\n\r\n```\r\nSun Jun 17 13:17:01 MDT 2018 - Starting a backup job.\r\n/mnt/@snapshots/borg: Pruning archives\r\nLocal Exception\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3/dist-packages/borg/archiver.py\", line 4253, in main\r\n    exit_code = archiver.run(args)\r\n  File \"/usr/lib/python3/dist-packages/borg/archiver.py\", line 4185, in run\r\n    return set_ec(func(args))\r\n  File \"/usr/lib/python3/dist-packages/borg/archiver.py\", line 143, in wrapper\r\n    assert_secure(repository, kwargs['manifest'])\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 206, in assert_secure\r\n    sm.assert_secure(manifest, manifest.key)\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 171, in assert_secure\r\n    with cache_config:\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 238, in __enter__\r\n    self.open()\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 262, in open\r\n    self.load()\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 267, in load\r\n    self._check_upgrade(self.config_path)\r\n  File \"/usr/lib/python3/dist-packages/borg/cache.py\", line 326, in _check_upgrade\r\n    raise Exception('%s does not look like a Borg cache.' % config_path) from None\r\nException: /root/.cache/borg/eb1f9b3234podifvkspdoisabd81f/config does not look like a Borg cache.\r\n\r\nPlatform: Linux asylum 4.13.0-45-generic #50~16.04.1-Ubuntu SMP Wed May 30 11:18:27 UTC 2018 x86_64\r\nLinux: LinuxMint 18.2 sonya\r\nBorg: 1.1.5  Python: CPython 3.5.2\r\nPID: 18340  CWD: /\r\nsys.argv: ['/usr/bin/borg', 'prune', '/mnt/@snapshots/borg', '--keep-within', '3H', '--keep-hourly', '48', '--keep-daily', '14', '--keep-weekly', '12', '--keep-monthly', '6', '--keep-yearly', '1', '--prefix', 'archive.', '--info', '--stats']\r\nSSH_ORIGINAL_COMMAND: None\r\n\r\n/etc/borgmatic/config.yaml: Running command for on-error hook\r\nSun Jun 17 13:17:01 MDT 2018 - Error while creating a backup.\r\nCommand '('borg', 'prune', '/mnt/@snapshots/borg', '--keep-within', '3H', '--keep-hourly', '48', '--keep-daily', '14', '--keep-weekly', '12', '--keep-monthly', '6', '--keep-yearly', '1', '--prefix', 'archive.', '--info', '--stats')' returned non-zero exit status 2\r\n```\r\n\r\nThis is my cron script\r\n\r\n```\r\n#!/bin/sh\r\n\r\n# tell borg to ignore the unknown/unencrypted repository issue\r\nexport BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes\r\n\r\n# run borg (via borgmatic) hourly\r\nexec /usr/local/bin/borgmatic -v 1 >> /var/log/borg.log 2>&1\r\n```"},"comment":{"url":"https://api.github.com/repos/borgbackup/borg/issues/comments/398911619","html_url":"https://github.com/borgbackup/borg/issues/3912#issuecomment-398911619","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/3912","id":398911619,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODkxMTYxOQ==","user":{"login":"dpantel","id":15957402,"node_id":"MDQ6VXNlcjE1OTU3NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/15957402?v=4","gravatar_id":"","url":"https://api.github.com/users/dpantel","html_url":"https://github.com/dpantel","followers_url":"https://api.github.com/users/dpantel/followers","following_url":"https://api.github.com/users/dpantel/following{/other_user}","gists_url":"https://api.github.com/users/dpantel/gists{/gist_id}","starred_url":"https://api.github.com/users/dpantel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpantel/subscriptions","organizations_url":"https://api.github.com/users/dpantel/orgs","repos_url":"https://api.github.com/users/dpantel/repos","events_url":"https://api.github.com/users/dpantel/events{/privacy}","received_events_url":"https://api.github.com/users/dpantel/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T22:00:29Z","updated_at":"2018-06-20T22:00:29Z","author_association":"NONE","body":"The config file is zero-sized. \r\n\r\nOnly one borg binary is installed.\r\n\r\nI don't really run borg manually.  I've always run it with the same script and only recently started seeing issues.  I agree it's probably the environment.  As a test I can run borg as root without issues.  When I substitute the environment for the the cron one, it failes.\r\n\r\nAny ideas on what I may be missing from the cron environment?"}}
{"actor":{"display_login":"dpantel"}}