{"action":"created","issue":{"url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/31","repository_url":"https://api.github.com/repos/masc3d/btrfs-sxbackup","labels_url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/31/comments","events_url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/31/events","html_url":"https://github.com/masc3d/btrfs-sxbackup/issues/31","id":160673090,"number":31,"title":"Error when destination has no snapshots","user":{"login":"silkeh","id":5798032,"avatar_url":"https://avatars.githubusercontent.com/u/5798032?v=3","gravatar_id":"","url":"https://api.github.com/users/silkeh","html_url":"https://github.com/silkeh","followers_url":"https://api.github.com/users/silkeh/followers","following_url":"https://api.github.com/users/silkeh/following{/other_user}","gists_url":"https://api.github.com/users/silkeh/gists{/gist_id}","starred_url":"https://api.github.com/users/silkeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silkeh/subscriptions","organizations_url":"https://api.github.com/users/silkeh/orgs","repos_url":"https://api.github.com/users/silkeh/repos","events_url":"https://api.github.com/users/silkeh/events{/privacy}","received_events_url":"https://api.github.com/users/silkeh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-16T14:17:53Z","updated_at":"2016-06-16T17:10:30Z","closed_at":null,"body":"When running a backup with any amount of snapshots in the source but no snapshots in the destination, the program crashes with the following output:\r\n\r\n```sh\r\nINFO btrfs-sxbackup v0.6.7\r\nDEBUG ['bash', '-c', 'if [ -f \"/source/.btrfs-sxbackup\" ]; then exit 10; fi']\r\nDEBUG ['bash', '-c', 'cat \"/source/.sxbackup/.btrfs-sxbackup\"']\r\nDEBUG ['bash', '-c', 'cat \"/destination/.btrfs-sxbackup\"']\r\nINFO source :: url [/source/] container [.sxbackup/] retention [3] compress [False]\r\nINFO destination :: url [/destination/] retention [1d:4/d, 1w:2/w, 3m:2/m, 12m:none] compress [False]\r\nINFO preparing environment\r\nDEBUG ['bash', '-c', 'if [ ! -d \"/source/.sxbackup/\" ]; then btrfs sub create \"/source/.sxbackup/\"; fi']\r\nDEBUG ['bash', '-c', 'btrfs sub show \"/source/.sxbackup/\"']\r\nDEBUG ['bash', '-c', 'if [ -d \"/source/.sxbackup/.temp\"* ]; then btrfs sub del \"/source/.sxbackup/.temp\"*; fi']\r\nDEBUG ['bash', '-c', 'if [ ! -d \"/destination/\" ]; then btrfs sub create \"/destination/\"; fi']\r\nDEBUG ['bash', '-c', 'btrfs sub show \"/destination/\"']\r\nDEBUG ['bash', '-c', 'if [ -d \"/destination/.temp\"* ]; then btrfs sub del \"/destination/.temp\"*; fi']\r\nINFO source :: retrieving snapshots\r\nDEBUG ['bash', '-c', 'btrfs sub list -o \"/source/.sxbackup/\"']\r\nINFO destination :: retrieving snapshots\r\nDEBUG ['bash', '-c', 'btrfs sub list -o \"/destination/\"']\r\nERROR list index out of range\r\nERROR Traceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/btrfs_sxbackup/__main__.py\", line 216, in main\r\n    job.run()\r\n  File \"/usr/local/lib/python3.4/dist-packages/btrfs_sxbackup/core.py\", line 971, in run\r\n    and self.source.snapshots[0].name.timestamp != self.destination.snapshots[0].name.timestamp:\r\nIndexError: list index out of range\r\n```\r\n\r\nIn case of an empty destination a full snapshot should probably be transferred, in which case the check for a non-matching snapshot should be modified."},"comment":{"url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/comments/226550586","html_url":"https://github.com/masc3d/btrfs-sxbackup/issues/31#issuecomment-226550586","issue_url":"https://api.github.com/repos/masc3d/btrfs-sxbackup/issues/31","id":226550586,"user":{"login":"masc3d","id":7522372,"avatar_url":"https://avatars.githubusercontent.com/u/7522372?v=3","gravatar_id":"","url":"https://api.github.com/users/masc3d","html_url":"https://github.com/masc3d","followers_url":"https://api.github.com/users/masc3d/followers","following_url":"https://api.github.com/users/masc3d/following{/other_user}","gists_url":"https://api.github.com/users/masc3d/gists{/gist_id}","starred_url":"https://api.github.com/users/masc3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masc3d/subscriptions","organizations_url":"https://api.github.com/users/masc3d/orgs","repos_url":"https://api.github.com/users/masc3d/repos","events_url":"https://api.github.com/users/masc3d/events{/privacy}","received_events_url":"https://api.github.com/users/masc3d/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T17:10:30Z","updated_at":"2016-06-16T17:10:30Z","body":"`btrfs-sxbackup` always tries to preserve the most recent snapshot when cleaning out but yes, it makes sense to support it in case the destination dies. thanks for reporting."}}
{"actor":{"display_login":"masc3d"}}