jgrisham / pi-hole

A black hole for Internet advertisements
https://pi-hole.net
Other
0 stars 0 forks source link

Fix corrupted patch #1

Open jgrisham opened 2 years ago

jgrisham commented 2 years ago

Chain of events:

  1. Inadvertently closed upstream PR when renaming linked ‘patch-1’
  2. Clicked “restore branch” in PR
  3. Reopened PR

Results:

There are now two branches in my fork, including the one linked to the PR, which…

A. cannot be downloaded using git (command-line or official app) B. GitHub.com reports an ‘Error 500’ page when attempting to view either patch in my fork.

  1. patch-1 <— broken with HTTP Error 500 page <— [x] (fixed)
  2. patch_nov2021-err500-stillbroke <— broken with HTTP Error 500 page <— [x] (fixed)

Current most recent revision: https://github.com/jgrisham/pi-hole/blob/c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb/manpages/pihole-FTL.conf.5

jgrisham commented 2 years ago

Original (renamed) patch:

A. Name: patch_nov2021-err500-stillbroke B. URL: https://github.com/jgrisham/pi-hole/tree/patch_nov2021-err500-stillbroke C. Commit hash (”HEAD”): c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb D. Parent commit hash: 2 parents 52020c3 + b5e0f14 E. Tree hash: b108e9080aece8611205b61f954034c3fe4ba5a0


Restored patch:

A. Name: patch-1 B. URL: https://github.com/jgrisham/pi-hole/patch-1 C. Commit hash (”HEAD”): c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb D. Parent commit hash: 2 parents 52020c3 + b5e0f14 E. Tree hash: b108e9080aece8611205b61f954034c3fe4ba5a0


Commits:

(API commit listing for entire repository)

Details… A. jgrisham committed on Mar 14: 1 parent cbfb58f **commit** 131b365cc45207237e8377ae28e2826b58abf850 1. Commit message: a. Commit API URL: https://api.github.com/repos/jgrisham/pi-hole/commits/131b365cc45207237e8377ae28e2826b58abf850 2. BLOB: 7d4f1426346f951befd7d6cc94f40a86c54e27fc a. File URL: https://github.com/jgrisham/pi-hole/blob/131b365cc45207237e8377ae28e2826b58abf850/manpages/pihole-FTL.conf.5 3. Tree: ae86527b32778cf7ea292a9050c48c8ac5775c81 a. Tree URL: https://github.com/jgrisham/pi-hole/tree/131b365cc45207237e8377ae28e2826b58abf850 b. Tree URL: https://github.com/jgrisham/pi-hole/tree/ae86527b32778cf7ea292a9050c48c8ac5775c81 c. Tree API URL: https://api.github.com/repos/jgrisham/pi-hole/git/trees/ae86527b32778cf7ea292a9050c48c8ac5775c81 B. PromoFaux committed on Sep 29: 2 parents 2673c2c + 841222f commit dad6247cb0c90fe8cc1ad541e0ccf8f02e1dd2be C. PromoFaux committed on Oct 23: 2 parents dad6247 + 8713135 commit b5e0f142ccefe9b1b59b94d7e82d3052efbfdcd0 D. jgrisham committed 22 hours ago: 1 parent 131b365 **commit** 1ddd24480e13eb046b3b54a0a0f8081c46d363a7 1. Commit message: a. Commit API URL: https://api.github.com/repos/jgrisham/pi-hole/commits/1ddd24480e13eb046b3b54a0a0f8081c46d363a7 2. BLOB: ba79c67fb97b7f3a127cab883cd9372a754bcb8b a. File URL: https://github.com/jgrisham/pi-hole/blob/1ddd24480e13eb046b3b54a0a0f8081c46d363a7/manpages/pihole-FTL.conf.5 3. Tree: 1c4e040bc8a1a547c2d8264ce5f48ac3b08c87db a. Tree URL: https://github.com/jgrisham/pi-hole/tree/1ddd24480e13eb046b3b54a0a0f8081c46d363a7 E. jgrisham committed 21 hours ago: 1 parent 1ddd244 **commit** 52020c393bb755daa20fdf55f278b68e00b9269e 1. Commit message: a. Commit API URL: https://api.github.com/repos/jgrisham/pi-hole/commits/52020c393bb755daa20fdf55f278b68e00b9269e 2. BLOB: b4bda9f255fed969e93f20dcda51782c692fb2b8 a. File URL: https://github.com/jgrisham/pi-hole/blob/52020c393bb755daa20fdf55f278b68e00b9269e/manpages/pihole-FTL.conf.5 3. Tree: 17a77ce60552c2b08cde8bd37297c272f415a56b a. Tree URL: https://github.com/jgrisham/pi-hole/tree/52020c393bb755daa20fdf55f278b68e00b9269e F. jgrisham committed 21 hours ago: 2 parents 52020c3 + b5e0f14 commit c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb 1. Commit message: Merge branch 'pi-hole:master' into patch-1 a. Commit API URL: https://api.github.com/repos/jgrisham/pi-hole/commits/c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb 2. Tree: b108e9080aece8611205b61f954034c3fe4ba5a0 _(corrupt or missing??)_ a. Tree URL: https://github.com/jgrisham/pi-hole/tree/c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb

Trees:

O. cbfb58f7a283c2a3e7aad95a834a0287175ccb24 Tree: f805a1e5645fb77a94ab22b10bf569e2b3661eb1 (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: cc8efafc5c7792b06198f4e6a9488be8af85f322 (API URL | recursive) a. pihole-FTL.conf.5 BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 (API URL)

A. 131b365cc45207237e8377ae28e2826b58abf850 Tree: ae86527b32778cf7ea292a9050c48c8ac5775c81 (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: 8819904fad40452b903c7206851a42d729453be6 (API URL) a. pihole-FTL.conf.5 BLOB: 7d4f1426346f951befd7d6cc94f40a86c54e27fc (API URL)

B. dad6247cb0c90fe8cc1ad541e0ccf8f02e1dd2be Tree: 54df1e19fd37fb6888d7e3d31b7cb8164fce9926 (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: d638503515ebd11cce6925d5f5c86fdce3c2e9dc (API URL) a. pihole-FTL.conf.5 BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 (API URL)

C. b5e0f142ccefe9b1b59b94d7e82d3052efbfdcd0 Tree: ff104d2503ea781db9f01653b39acfb448934921 (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: d638503515ebd11cce6925d5f5c86fdce3c2e9dc (API URL) a. pihole-FTL.conf.5 BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 (API URL)

D. 1ddd24480e13eb046b3b54a0a0f8081c46d363a7 Tree: 1c4e040bc8a1a547c2d8264ce5f48ac3b08c87db (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: a4cd53449d1fb4086be6c452c76c6e055af90cdc (API URL) a. pihole-FTL.conf.5 BLOB: ba79c67fb97b7f3a127cab883cd9372a754bcb8b (API URL)

E. 52020c393bb755daa20fdf55f278b68e00b9269e Tree: 17a77ce60552c2b08cde8bd37297c272f415a56b (API URL | recursive) (Web URL via commit hash)

  1. ./Manpages subtree: 7d0929ce4188c20d966cdd8729fa9f9de267a7a4 (API URL) a. pihole-FTL.conf.5 BLOB: b4bda9f255fed969e93f20dcda51782c692fb2b8 (API URL)

F. c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb Tree: b108e9080aece8611205b61f954034c3fe4ba5a0 (API URL <— seems okay? | recursive <— returns blank page!!) (Web URL via commit hash <— broken with HTTP Error 500!!)

  1. ./Manpages subtree: 25de2540b8426753e5c3dbfcc94bd708638b6f14 (API URL) a. pihole-FTL.conf.5 BLOB: b4bda9f255fed969e93f20dcda51782c692fb2b8 (API URL)

Files:

O. cbfb58f7a283c2a3e7aad95a834a0287175ccb24 BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 A. 131b365cc45207237e8377ae28e2826b58abf850 BLOB: 7d4f1426346f951befd7d6cc94f40a86c54e27fc B. dad6247cb0c90fe8cc1ad541e0ccf8f02e1dd2be BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 C. b5e0f142ccefe9b1b59b94d7e82d3052efbfdcd0 BLOB: 42405436246e60c85ebbac66d9f9a75b27b6e171 D. 1ddd24480e13eb046b3b54a0a0f8081c46d363a7 BLOB: ba79c67fb97b7f3a127cab883cd9372a754bcb8b E. 52020c393bb755daa20fdf55f278b68e00b9269e BLOB: b4bda9f255fed969e93f20dcda51782c692fb2b8 F. c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb BLOB: b4bda9f255fed969e93f20dcda51782c692fb2b8

Refs:

(git ‘refs’ listing for entire repository)

Details for the two affected branches… ``` { "ref": "refs/heads/patch_nov2021-err500-stillbroke", "node_id": "MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2hfbm92MjAyMS1lcnI1MDAtc3RpbGxicm9rZQ==", "url": "https://api.github.com/repos/jgrisham/pi-hole/git/refs/heads/patch_nov2021-err500-stillbroke", "object": { "sha": "c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb", "type": "commit", "url": "https://api.github.com/repos/jgrisham/pi-hole/git/commits/c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb" } }, { "ref": "refs/heads/patch-1", "node_id": "MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2gtMQ==", "url": "https://api.github.com/repos/jgrisham/pi-hole/git/refs/heads/patch-1", "object": { "sha": "c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb", "type": "commit", "url": "https://api.github.com/repos/jgrisham/pi-hole/git/commits/c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb" } }, ```

A. Original (renamed)

  1. refs/heads/patch_nov2021-err500-stillbroke (API URL) (ref) a. Commit: c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb (API URL) b. Node ID: MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2hfbm92MjAyMS1lcnI1MDAtc3RpbGxicm9rZQ== c. Node ID (common portion): MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2 d. Node ID (unique portion): hfbm92MjAyMS1lcnI1MDAtc3RpbGxicm9rZQ== e. Node ID (decoded from Base64): 03:Ref347722266:refs/heads/patch_nov2021-err500-stillbroke

B. Restored

  1. refs/heads/patch-1 (API URL) a. Commit: c93cf2781df7fa21059a0c4bb5d9bbf11647c7fb (API URL) b. Node ID: MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2gtMQ== c. Node ID (common portion): MDM6UmVmMzQ3NzIyMjY2OnJlZnMvaGVhZHMvcGF0Y2 d. Node ID (unique portion): gtMQ== e. Node ID (decoded from Base64): 03:Ref347722266:refs/heads/patch-1
jgrisham commented 2 years ago

Questions:

  1. It seems the PR refers to the branch by name and not by commit hash. Is this correct? a. The GitHub API also appears to use a NodeID for Commits and Files/BLOBs, but not for trees… could this be contributing to the problem?
  2. If the answer to 1 is yes, will the PR work properly once the 500 error is resolved?
  3. Can I just create a new branch (manually, with tree, commit, and file hashes?) and keep the existing PR?

References:

  1. https://docs.github.com/en/rest/guides/getting-started-with-the-git-database-api
  • [ ] Update the reference of your branch to point to the new commit SHA
jgrisham commented 2 years ago

Mitigation:

Support ticket details - - - - #### Description Two branches in a my fork of a public project point to the same commit, and with either branch: 1. I cannot download or operate on those specific branches using the official GitHub app for Windows or via `git` on Linux 2. attempting to view the branch pages or the tree page _(via the commit page)_ on GitHub.com results in an `HTTP Error 500` page. 3. attempting to view the tree using an API link does work More information _(including my notes thus far)_ can be seen at: > - https://github.com/jgrisham/pi-hole/issues/1 Tl;dr: this is **_not_ an emergency for me**, but it may cause data loss or reposition corruption for other folks, so I wanted to make sure someone was aware that the problem exists. - - - - #### Reproduction Steps I haven’t yet tried to reproduce - I am still attempting to recover from the initial occurrence _(a bit less than 24 hours ago)_ All actions leading up to this occurred on Github.com; my fork of this repository was never used as a local copy using the GitHub desktop or mobile app or command-line `git` tools. The steps leading up to this, as best as I recall: 1. I updated a branch _(rebased with no merge conflicts, I think?)_, using the GitHub.com website a. That branch was linked to an existing and open PR from last spring 2. I then renamed the branch to have a more descriptive name than “patch-1” _(forgetting that would result in the PR auto-closing)_ 3. In the PR, I saw that my branch “patch-1” was deleted and the PR had been auto-closed 4. I clicked the “Restore branch” button on the PR, and then clicked “Re-open branch” On the surface the PR appears fine, but a. the branch cannot be checked out by _(at least some of)_ the project’s GitHub Actions CI tools b. HTTP ‘Error 500’ pages appear on certain related pages _(as well as the other symptoms noted in the previous section)_ Please see details at: https://github.com/jgrisham/pi-hole/issues/1 - - - - #### Fault Type - Intermittent - Occurring irregularly Blocking? - Blocking Last working date - 28 November - - - - #### Logs I don’t have any handy at this time. If I am able to collect them, I will add them to the issues page linked above.