jkfran / killport

A command-line tool to easily kill processes running on a specified port.
MIT License
1.68k stars 37 forks source link

brew install fails on mismatched SHA hash #5

Closed jkfran closed 1 year ago

AllanLeanderRostockHansen commented 1 year ago

Tried installing from brew but get this error (copy-pasted from my terminal):

❯ brew tap jkfran/killport
brew install killport
==> Tapping jkfran/killport
Cloning into '/opt/homebrew/Library/Taps/jkfran/homebrew-killport'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 16 (delta 5), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (16/16), 5.08 KiB | 5.08 MiB/s, done.
Resolving deltas: 100% (5/5), done.
Tapped 1 formula (15 files, 15.7KB).
==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
###################################################################################################################################################################################### 100.0%
==> Fetching jkfran/killport/killport
==> Downloading https://github.com/jkfran/killport/releases/download/v0.6.0/killport-aarch64-apple-darwin.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/615362447/8d748110-f777-41e3-b925-d3b3118a35a7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Crede
###################################################################################################################################################################################### 100.0%
Error: killport: SHA256 mismatch
Expected: b31402afc2e59b1483a80c2ba1692a41ea4642c9f0d1c6a5c5b80e9e66c9bbae
  Actual: dde62729e132609ca90e4d4c9995364c2653f117663113cd910ee3091dbf2b2e
    File: /Users/allanlrh/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz
To retry an incomplete download, remove the file above.
jkfran commented 1 year ago

I am not having this issue. I just downloaded the file, and it matches the SHA256:

image
speckz commented 1 year ago

Having the same issue just now:

❯ brew install killport
==> Fetching jkfran/killport/killport
==> Downloading https://github.com/jkfran/killport/releases/download/v0.6.0/killport-aarch64-apple-darwin.tar.gz
Already downloaded: /Users/barnabas/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz
Error: killport: SHA256 mismatch
Expected: b31402afc2e59b1483a80c2ba1692a41ea4642c9f0d1c6a5c5b80e9e66c9bbae
  Actual: dde62729e132609ca90e4d4c9995364c2653f117663113cd910ee3091dbf2b2e
    File: /Users/barnabas/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz
To retry an incomplete download, remove the file above.
uzza1hossain commented 1 year ago

rm Users/barnabas/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz

Then try to install again. Hopefully it will fix the issue.

speckz commented 1 year ago

No luck, see below:

❯ rm /Users/barnabas/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz
❯ brew install killport
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##O=-#     #
==> Fetching jkfran/killport/killport
==> Downloading https://github.com/jkfran/killport/releases/download/v0.6.0/killport-aarch64-apple-darwin.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/615362447/8d748110-f777-41e3-b925-d3b3118a35a7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Cre
#################################################################################################################################################################################### 100.0%
Error: killport: SHA256 mismatch
Expected: b31402afc2e59b1483a80c2ba1692a41ea4642c9f0d1c6a5c5b80e9e66c9bbae
  Actual: dde62729e132609ca90e4d4c9995364c2653f117663113cd910ee3091dbf2b2e
    File: /Users/barnabas/Library/Caches/Homebrew/downloads/dcd8642740025541c389466fd4d65f20a4b31e1b178eb11971d2ebdd2747b345--killport-aarch64-apple-darwin.tar.gz
To retry an incomplete download, remove the file above.
janbaykara commented 1 year ago

Same here, running rm ... then rerunning brew install killport always results in SHA256 mismatch

Screenshot 2023-04-25 at 18 02 35
jkfran commented 1 year ago

I am completely speechless. I am getting this new sha256sum right now:

image

How did the sha256sum change? A few hours ago, when I downloaded the file: https://github.com/jkfran/killport/issues/5#issuecomment-1521619774

I am the creator of this tool. I also used this architecture and installed it using Homebrew without this issue. I didn't release any version lately. You can check the releases which are built on GitHub and pull from there: https://github.com/jkfran/killport/releases

Is there a logical explanation for this?

jkfran commented 1 year ago

Could it be related to this?

https://github.com/orgs/community/discussions/45830

jkfran commented 1 year ago

I keep finding reports on the internet about people having similar issues on GitHub: https://security.stackexchange.com/questions/240204/how-can-the-authenticity-of-releases-on-github-and-gitlab-be-ensured-can-their

I updated the formula. So:

brew update
brew install killport

I think it should now work. I will find a better solution, any suggestion is welcome.

timsco commented 1 year ago

That fixed the issue for me. Thank you @jkfran.

speckz commented 1 year ago

brew update now fixes the issue. However, it did not work in the past.

jkfran commented 1 year ago

Thank you, everyone, for using this tool. I will close this issue for now. Any contribution is welcome!