Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The file name of the compressed package is incorrect when installing the dependency #11209

Closed
2 tasks done
KofClubs opened this issue Apr 21, 2021 · 9 comments · Fixed by #11781
Closed
2 tasks done

The file name of the compressed package is incorrect when installing the dependency #11209

KofClubs opened this issue Apr 21, 2021 · 9 comments · Fixed by #11781
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age

Comments

@KofClubs
Copy link

brew config output

HOMEBREW_VERSION: 3.1.3
ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HEAD: d89eda09abbeae907eb88bd6d01dc9cde7ff0e19
Last commit: 24 hours ago
Core tap ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
Core tap HEAD: 6ee6cdcb1a5edd7d73884c25313a301e2d951d1f
Core tap last commit: 63 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
HOMEBREW_BREW_GIT_REMOTE: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.2.3-arm64
CLT: 12.4.0.0.1.1610135815
Xcode: 12.4
Rosetta 2: false

brew doctor output

Your system is ready to brew.

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

I tried to install some packages. Because I recently encountered similar problems when installing these packages (gpg, jq, truffle, wget...) in an environment where brew was installed for the first time. I shall give an example, jq, to illustrate.

What happened (include all command output)?

** 1. Try to install jq **

$ brew install jq
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/manifests/6.9.7.1
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/990d33c0f9c31c03da34208acc7013dafd44862956791669763f69a8e731f065--oniguruma-6.9.7.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/blobs/sha256:ba81edc5b1d7b345bd219cd41e526bd3cfea09d793d4bfba
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/3a7201899efe3276cef38b1287cc471dcef0f8d7160d2dec3cf39c4ac648c49a--oniguruma--6.9.7.1.arm64_big_sur.bottle.tar.gz
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/jq-1.6.arm64_big_sur.bottle.1.tar.gz
==> Downloading from https://homebrew.bintray.com/jq-1.6.arm64_big_sur.bottle.1.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/jq/manifests/1.6-1
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/fc2724606b6ebef1ba0db7d7ae84cfca1df8cfed9e58e3a8714413b3676935f7--jq-1.6-1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:674b3ae41c399f1e8e44c271b0e6909babff9fcd2e04a2127d25e24
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/fb1fc734f1648026012c935eca3772798b36036d000aa3f282bcaadf115ef3e7--jq--1.6.arm64_big_sur.bottle.1.tar.gz
==> Installing dependencies for jq: oniguruma
==> Installing jq dependency: oniguruma
==> Pouring oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz
tar: Error opening archive: Failed to open '/Users/zhang/Library/Caches/Homebrew/downloads/9908b55fefbb22ab6875b8f3a96f9acc5e5b669735fa0471d6bc545bb8a6d558--oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz'
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/zhang/Library/Caches/Homebrew/downloads/9908b55fefbb22ab6875b8f3a96f9acc5e5b669735fa0471d6bc545bb8a6d558--oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz --directory /private/tmp/d20210421-25814-26elbt` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/zhang/Library/Caches/Homebrew/downloads/9908b55fefbb22ab6875b8f3a96f9acc5e5b669735fa0471d6bc545bb8a6d558--oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz'

** 2. Install the dependency manually **

$ brew install oniguruma
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/manifests/6.9.7.1
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/990d33c0f9c31c03da34208acc7013dafd44862956791669763f69a8e731f065--oniguruma-6.9.7.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/blobs/sha256:ba81edc5b1d7b345bd219cd41e526bd3cfea09d793d4bfba
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/3a7201899efe3276cef38b1287cc471dcef0f8d7160d2dec3cf39c4ac648c49a--oniguruma--6.9.7.1.arm64_big_sur.bottle.tar.gz
==> Pouring oniguruma--6.9.7.1.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/oniguruma/6.9.7.1: 14 files, 1.4MB

** 3. Retry to install jq **

$ brew install jq       
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/jq-1.6.arm64_big_sur.bottle.1.tar.gz
==> Downloading from https://homebrew.bintray.com/jq-1.6.arm64_big_sur.bottle.1.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/jq/manifests/1.6-1
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/fc2724606b6ebef1ba0db7d7ae84cfca1df8cfed9e58e3a8714413b3676935f7--jq-1.6-1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:674b3ae41c399f1e8e44c271b0e6909babff9fcd2e04a2127d25e24
Already downloaded: /Users/zhang/Library/Caches/Homebrew/downloads/fb1fc734f1648026012c935eca3772798b36036d000aa3f282bcaadf115ef3e7--jq--1.6.arm64_big_sur.bottle.1.tar.gz
==> Pouring jq--1.6.arm64_big_sur.bottle.1.tar.gz
🍺  /opt/homebrew/Cellar/jq/1.6: 18 files, 1.2MB

What did you expect to happen?

I hope I don’t have to install dependencies manually.

I tried to locate the problem:

$ ls /Users/zhang/Library/Caches/Homebrew/downloads | grep oniguruma                      
3a7201899efe3276cef38b1287cc471dcef0f8d7160d2dec3cf39c4ac648c49a--oniguruma--6.9.7.1.arm64_big_sur.bottle.tar.gz
990d33c0f9c31c03da34208acc7013dafd44862956791669763f69a8e731f065--oniguruma-6.9.7.1.bottle_manifest.json

I don't know if this is normal.

I manually renamed the compressed package and could successfully trick brew and install jq successfully.

$ cd /Users/zhang/Library/Caches/Homebrew/downloads
$ mv 3a7201899efe3276cef38b1287cc471dcef0f8d7160d2dec3cf39c4ac648c49a--oniguruma--6.9.7.1.arm64_big_sur.bottle.tar.gz 9908b55fefbb22ab6875b8f3a96f9acc5e5b669735fa0471d6bc545bb8a6d558--oniguruma-6.9.7.1.arm64_big_sur.bottle.tar.gz

Step-by-step reproduction instructions (by running brew commands)

# I installed Homebrew for the first time. In addition, because I am living in mainland China, it is very slow to access the official GitHub repository for some reasons. I designated a mirror:

xcode-select --install

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"

git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git
./install/install.sh

test -r ~/.zprofile && echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile

brew install jq
@KofClubs KofClubs added the bug Reproducible Homebrew/brew bug label Apr 21, 2021
@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Apr 21, 2021
@MikeMcQuaid
Copy link
Member

Thanks for the report!

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"

We'll probably need someone in China to help figure out this bug and submit a fix. We don't really support this workflow and there's clearly edge-cases (as demonstrated here).

@KofClubs
Copy link
Author

Thanks for the report!

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"

We'll probably need someone in China to help figure out this bug and submit a fix. We don't really support this workflow and there's clearly edge-cases (as demonstrated here).

@MikeMcQuaid Thank you for your reply! 🤝

Yes, the Homebrew / Linuxbrew mirrors in Mainland China are generally maintained by some universities. I don't know if this is caused by a problem with the mirror.

I would like to ask a trivial question whether brew supports skipping such file name checking. This means that when the version of the dependent package is correct, the package required by the user shall be forcibly installed. I noticed that the cached package version is correct, only the file name is incorrect. (I have reproduced this error many times.)

@MikeMcQuaid
Copy link
Member

I would like to ask a trivial question whether brew supports skipping such file name checking.

We do not.

I noticed that the cached package version is correct, only the file name is incorrect. (I have reproduced this error many times.)

This is the bug that will need fixed. The filenames should be the same in both cases.

@zhdaniel
Copy link

zhdaniel commented May 4, 2021

I met the same issue, so I unset the HOMEBREW_* env variables about mirror after I read the above comments, then it works. Hope it may help others.

@ghost
Copy link

ghost commented May 6, 2021

Having the same issue in the US. We have it set to our corporate mirror and when the packages aren't found, it exhibits this behaviour.

@ghost
Copy link

ghost commented May 6, 2021

Thanks for the report!

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"

We'll probably need someone in China to help figure out this bug and submit a fix. We don't really support this workflow and there's clearly edge-cases (as demonstrated here).

This is not related to China. It's more related to using HOMEBREW_BOTTLE_DOMAIN. We have a corporate mirror we are supposed to use and if the bottle is not found in our mirror, it breaks in the same way. It's expecting the file to be named a certain name. It downloads the file, but the name is not what it's expecting.

@MikeMcQuaid
Copy link
Member

@derrick-hardison I have no idea how your mirror works I'm afraid. It's not related to China but it is related to anyone using an unofficial mirror so those folks are the best ones equipped to debug and open a PR for this.

@yongfanbeta
Copy link

I met the same issue, so I unset the HOMEBREW_* env variables about mirror after I read the above comments, then it works. Hope it may help others.

@zhdaniel how to reset homebrew_bottle_domain,thx.

@gromgit
Copy link
Member

gromgit commented Jul 27, 2021

I met the same issue, so I unset the HOMEBREW_* env variables about mirror after I read the above comments, then it works. Hope it may help others.

@zhdaniel how to reset homebrew_bottle_domain,thx.

You unset it, as @zhdaniel mentioned:

unset HOMEBREW_BOTTLE_DOMAIN

For a more permanent solution, you'd also need to find the startup file in which you export HOMEBREW_BOTTLE_DOMAIN=... and delete that line.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants