{"thread":{"id":"53724","subject":"error: Unable to get pack file","startedAt":"2020-06-20T14:59:03Z","lastAt":"2020-10-14T18:35:40Z","messageCount":2,"participants":["Hongyi Zhao","Tim Düsterhus"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"400253","messageId":"CAGP6POKvZHHWDcV4-4P6Y4yy6gCujm7vpEqKxWW0whT2FyqYEw@mail.gmail.com","threadId":"53724","inReplyTo":null,"subject":"error: Unable to get pack file","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2020-06-20T14:58:47Z","receivedAt":"2020-06-20T14:59:03Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"Hi,\n\nI have a local repo mirror for https://source.winehq.org/git/wine.git\nwhich was updated some time ago. When I try to update the local repo\nto its latest version, I meet the following error message:\n\n$ git pull\nerror: Unable to get pack file\nhttps://source.winehq.org/git/wine.git/objects/pack/pack-3776ee1d93e316ed56507e9062d8fc8e5c07feed.pack\nThe requested URL returned error: 416 Requested Range Not Satisfiable\nerror: Unable to find 6ed1d04b1325d4c2480907b76b8b1d5529caebab under\nhttps://source.winehq.org/git/wine.git\nCannot obtain needed object 6ed1d04b1325d4c2480907b76b8b1d5529caebab\nwhile processing commit bf454cc39428fc5299e5c26d9c0ddc6a9277c7ae.\nerror: fetch failed.\n\nAny suggestions for this problem?\n-- \nHongyi Zhao <hongyi.zhao@gmail.com>\n"},{"id":"407542","messageId":"419fd4ad-f9c2-927c-7ae0-c6083f70dcba@bastelstu.be","threadId":"53724","inReplyTo":"CAGP6POKvZHHWDcV4-4P6Y4yy6gCujm7vpEqKxWW0whT2FyqYEw@mail.gmail.com","subject":"Unable to get pack file - HTTP 416 [was: error: Unable to get pack file]","fromName":"Tim Düsterhus","fromEmail":"tim@bastelstu.be","sentAt":"2020-10-14T18:25:44Z","receivedAt":"2020-10-14T18:35:40Z","isPatch":false,"sender":{"key":"tim@bastelstu.be","avatar":null},"body":"Hi List,\nHongyi,\nWilly,\n\n[please leave me in Cc, I am not subscribed]\n\nAm 20.06.20 um 16:58 schrieb Hongyi Zhao:\n> I have a local repo mirror for https://source.winehq.org/git/wine.git\n> which was updated some time ago. When I try to update the local repo\n> to its latest version, I meet the following error message:\n> \n> $ git pull\n> error: Unable to get pack file\n> https://source.winehq.org/git/wine.git/objects/pack/pack-3776ee1d93e316ed56507e9062d8fc8e5c07feed.pack\n> The requested URL returned error: 416 Requested Range Not Satisfiable\n> error: Unable to find 6ed1d04b1325d4c2480907b76b8b1d5529caebab under\n> https://source.winehq.org/git/wine.git\n> Cannot obtain needed object 6ed1d04b1325d4c2480907b76b8b1d5529caebab\n> while processing commit bf454cc39428fc5299e5c26d9c0ddc6a9277c7ae.\n> error: fetch failed.\n> \n> Any suggestions for this problem?\n> \n\nI experienced the same issue yesterday with the canonical git repository\nof HAProxy [0]. The git repository uses the dumb HTTP transport.\n\nI am using git 2.28.0 from the `git-core` PPA for Ubuntu:\nhttps://launchpad.net/~git-core/+archive/ubuntu/ppa\n\n\n\nI attempted to update the repository using `git fetch` as usual, but\ninterrupted the fetch with Ctrl+C, because it appeared stuck. It did not\nreturn in tens of seconds, while it usually updates in single-digit seconds.\n\nAfterwards I retried the operation, but it failed with the same error\nmessage Hongyi experienced in June.\n\nI could track the issue down to the following:\n\n1. git already downloaded all the bytes of the pack file in question.\n2. When retrying the `git fetch` git attempted to resume the download by\nsending a `Range` request.\n3. Because the file was complete git was sending an invalid `Range`.\n4. The nginx at haproxy.org returned the HTTP 416 in response, causing\ngit to fail.\n\nI could fix the issue by truncating the temporary pack file to be 1 Byte\nsmaller than before. I suspect deleting the temporary file would also\nhave worked. Even after truncation the operation took quite a while. I\nam not sure what git was doing under the hood. The network connection\nwas not the limiting factor there.\n\nNeither running `git fsck` nor `git gc` was able to fix the issue. I had\nto edit around in the `.git/objects/` folder.\n\nI would claim that this behavior is a bug in git, because I was unable\nto fix my repository with regular git commands. The next repack on the\nserver might or might not have fixed the issue.\n\nI believe one of the following suggestions should prevent this issue\nfrom happening:\n\n1. Retry without the `Range` header when receiving a 416 in response.\n2. Checking the returned `Content-Range` to check whether the full pack\nis already downloaded and then ignoring the error status.\n3. Deleting the temporary packfile in progress when resuming the\ndownload fails. Then the next retry would have worked from my understanding.\n\nPlease see the following link to mail-archive.com for my initial thread\non the HAProxy mailing list. It might contain additional details:\n\nhttps://www.mail-archive.com/haproxy@formilux.org/msg38650.html\n\nBest regards\nTim Düsterhus\n\n[0] https://git.haproxy.org/git/haproxy.git/\n"}]}