{"action":"created","issue":{"url":"https://api.github.com/repos/borgbackup/borg/issues/1211","repository_url":"https://api.github.com/repos/borgbackup/borg","labels_url":"https://api.github.com/repos/borgbackup/borg/issues/1211/labels{/name}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/1211/comments","events_url":"https://api.github.com/repos/borgbackup/borg/issues/1211/events","html_url":"https://github.com/borgbackup/borg/pull/1211","id":162524424,"number":1211,"title":"Fix incorrect propagation of OSErrors in create code","user":{"login":"enkore","id":1330164,"avatar_url":"https://avatars.githubusercontent.com/u/1330164?v=3","gravatar_id":"","url":"https://api.github.com/users/enkore","html_url":"https://github.com/enkore","followers_url":"https://api.github.com/users/enkore/followers","following_url":"https://api.github.com/users/enkore/following{/other_user}","gists_url":"https://api.github.com/users/enkore/gists{/gist_id}","starred_url":"https://api.github.com/users/enkore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enkore/subscriptions","organizations_url":"https://api.github.com/users/enkore/orgs","repos_url":"https://api.github.com/users/enkore/repos","events_url":"https://api.github.com/users/enkore/events{/privacy}","received_events_url":"https://api.github.com/users/enkore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-27T19:04:49Z","updated_at":"2016-06-29T12:50:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/borgbackup/borg/pulls/1211","html_url":"https://github.com/borgbackup/borg/pull/1211","diff_url":"https://github.com/borgbackup/borg/pull/1211.diff","patch_url":"https://github.com/borgbackup/borg/pull/1211.patch"},"body":"Pulling a thumbdrive during a backup now produces the correct result:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 81, in wrapper\r\n    return method(self, args, repository=repository, **kwargs)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 247, in do_create\r\n    create_inner(archive, cache)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 219, in create_inner\r\n    read_special=args.read_special, dry_run=dry_run)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 275, in _process\r\n    status = archive.process_file(path, st, cache, self.ignore_inode)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archive.py\", line 594, in process_file\r\n    chunks.append(cache.add_chunk(self.key.id_hash(chunk), chunk, self.stats))\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/cache.py\", line 365, in add_chunk\r\n    self.repository.put(id, data, wait=False)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/repository.py\", line 467, in put\r\n    segment, offset = self.io.write_put(id, data)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/repository.py\", line 706, in write_put\r\n    fd = self.get_write_fd(raise_full=raise_full)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/repository.py\", line 600, in get_write_fd\r\n    self._write_fd = open(self.segment_filename(self.segment), 'ab')\r\nOSError: [Errno 5] Input/output error: '/run/media/mabe/00B524275BF67732/repo/data/0/9'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 1569, in main\r\n    exit_code = archiver.run(args)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 1506, in run\r\n    return args.func(args)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/archiver.py\", line 81, in wrapper\r\n    return method(self, args, repository=repository, **kwargs)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/repository.py\", line 86, in __exit__\r\n    self.close()\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/repository.py\", line 181, in close\r\n    self.lock.release()\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/locking.py\", line 291, in release\r\n    self._roster.modify(EXCLUSIVE, REMOVE)\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/locking.py\", line 203, in modify\r\n    roster = self.load()\r\n  File \"/home/mabe/Projekte/_oss/borg/borg/locking.py\", line 182, in load\r\n    data = json.load(f)\r\n  File \"/home/mabe/.pyenv/versions/3.5.1/lib/python3.5/json/__init__.py\", line 265, in load\r\n    return loads(fp.read(),\r\nOSError: [Errno 5] Input/output error\r\n\r\nPlatform: Linux tiger 4.5.7-1-ck #1 SMP PREEMPT Wed Jun 8 08:42:43 EDT 2016 x86_64 \r\nLinux: arch  \r\nBorg: 1.0.4.dev46+ngbc0a838.d20160627  Python: CPython 3.5.1\r\nPID: 27050  CWD: /home/mabe/Projekte/_oss/borg/issue1138\r\nsys.argv: ['/home/mabe/.pyenv/versions/3.5.1/bin/borg', 'create', '/run/media/mabe/00B524275BF67732/repo::testbreaking', '...............', '-svp']\r\nSSH_ORIGINAL_COMMAND: None\r\n\r\nzsh: exit 2     borg create /run/media/mabe/00B524275BF67732/repo::testbreaking  -svp\r\n```\r\n\r\nTried it a few times, logic seems solid. I don't think I missed a spot, but that's what we do code reviews for, isn't it? ;)\r\n\r\n_Rather curious_: ntfs-3g journaling doesn't seem to be very reliable. After a few pulls with no repository corruption I get an EIO on open(2) on a data file and a rather ugly ntfs-3g message:\r\n\r\n> Jun 27 20:59:35 tiger ntfs-3g[27314]: Trying to read non-allocated mft records (83 > 82): Nicht erlaubter Seek (_seek not permissible_)\r\n> Jun 27 20:59:35 tiger ntfs-3g[27314]: Trying to read non-allocated mft records (83 > 82): Nicht erlaubter Seek\r\n\r\nEven root can't touch that inode anymore, not even rm the dirent. I'll see whether Windows chkdsk can fix that, or whether I have to reformat my thumb drive?!"},"comment":{"url":"https://api.github.com/repos/borgbackup/borg/issues/comments/229345942","html_url":"https://github.com/borgbackup/borg/pull/1211#issuecomment-229345942","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/1211","id":229345942,"user":{"login":"ThomasWaldmann","id":356103,"avatar_url":"https://avatars.githubusercontent.com/u/356103?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasWaldmann","html_url":"https://github.com/ThomasWaldmann","followers_url":"https://api.github.com/users/ThomasWaldmann/followers","following_url":"https://api.github.com/users/ThomasWaldmann/following{/other_user}","gists_url":"https://api.github.com/users/ThomasWaldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasWaldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasWaldmann/subscriptions","organizations_url":"https://api.github.com/users/ThomasWaldmann/orgs","repos_url":"https://api.github.com/users/ThomasWaldmann/repos","events_url":"https://api.github.com/users/ThomasWaldmann/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasWaldmann/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T12:50:28Z","updated_at":"2016-06-29T12:50:28Z","body":"merge?"}}
{"actor":{"display_login":"ThomasWaldmann"}}