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

Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg #16326

Closed
3 tasks done
abitrolly opened this issue Dec 13, 2023 · 5 comments
Closed
3 tasks done

Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg #16326

abitrolly opened this issue Dec 13, 2023 · 5 comments
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age

Comments

@abitrolly
Copy link
Contributor

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.1.25-36-gde22479
ORIGIN: https://github.com/Homebrew/brew
HEAD: de224796beb4e2aca73b7ad4a2a9b77f62ab5626
Last commit: 10 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: abc27f2945d3f8602c71fc30140f4f17cc89d405
Core tap last commit: 3 hours ago
Core tap branch: master
Core tap JSON: 13 Dec 08:07 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: quad-core 64-bit haswell
Clang: N/A
Git: 2.43.0 => /bin/git
Curl: 8.2.1 => /bin/curl
Kernel: Linux 6.6.4-200.fc39.x86_64 x86_64 GNU/Linux
OS: Fedora release 39 (Thirty Nine)
Host glibc: 2.38
/usr/bin/gcc: 13.2.1
/usr/bin/ruby: 3.2.2
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

brew cleanup

It is run automatically during brew update.

What happened (include all command output)?

$ brew cleanup
Warning: Skipping bat: most recent version 0.24.0 not installed
Warning: Skipping ca-certificates: most recent version 2023-12-12 not installed
Warning: Skipping crane: most recent version 0.17.0 not installed
Warning: Skipping diff-so-fancy: most recent version 1.4.4 not installed
Warning: Skipping dolt: most recent version 1.29.4 not installed
Warning: Skipping dust: most recent version 0.8.6 not installed
Warning: Skipping fastmod: most recent version 0.4.4 not installed
Warning: Skipping superfly/tap/flyctl: most recent version 0.1.134 not installed
Warning: Skipping glab: most recent version 1.35.0 not installed
Warning: Skipping helix: most recent version 23.10 not installed
Warning: Skipping kind: most recent version 0.20.0 not installed
Warning: Skipping kubernetes-cli: most recent version 1.28.4 not installed
Warning: Skipping lazygit: most recent version 0.40.2 not installed
Warning: Skipping nerdctl: most recent version 1.7.2 not installed
Warning: Skipping skaffold: most recent version 2.9.0 not installed
Warning: Skipping sourcegraph/src-cli/src-cli: most recent version 5.2.1 not installed
Warning: Skipping syncthing: most recent version 1.27.1 not installed
Warning: Skipping tree-sitter: most recent version 0.20.8 not installed
Warning: Skipping watchexec: most recent version 1.24.1 not installed
Warning: Skipping whalebrew: most recent version 0.4.1 not installed
Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg

What did you expect to happen?

No error.

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

Run `brew mkdocs`, which pulls `libyaml`.

==> Installing mkdocs dependency: libyaml
==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/manifests/0.2.5
Already downloaded: /home/anatoli/.cache/Homebrew/downloads/5f6b0af1730aa1bc02f8021c90ed7ffe988eeba95eec83e6c828f77332ba6406--libyaml-0.2.5.bottle_manifest.json
==> Pouring libyaml--0.2.5.x86_64_linux.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5: 11 files, 391.7KB
...
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /home/anatoli/.cache/Homebrew/ca-certificates--2023-08-22... (125.2KB)
Removing: /home/anatoli/.cache/Homebrew/dolt--1.29.3... (50.6MB)
Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg

Then run brew cleanup -d -v to confirm the problem. Here is the tail of the trace output.

Warning: Skipping whalebrew: most recent version 0.4.1 not installed
Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/keg.rb:163:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:770:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:770:in `block in from_rack'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:770:in `map'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:770:in `from_rack'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `bind_call'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `validate_call'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:89:in `block in create_validator_slow'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:131:in `stale_formula?'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation_2_7.rb:764:in `bind_call'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation_2_7.rb:764:in `block in create_validator_method_medium2'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:68:in `stale?'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `bind_call'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `validate_call'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:89:in `block in create_validator_slow'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:430:in `block in cleanup_cache'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:412:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:412:in `cleanup_cache'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cleanup.rb:276:in `clean!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/cleanup.rb:57:in `cleanup'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:86:in `<main>'

I've added the debug print to keg.rb:163 and it looks like libyaml path is shorter than others for some reason.

    odebug "#{path.parent.parent.realpath} ..... #{HOMEBREW_CELLAR.realpath}"
==> /home/linuxbrew/.linuxbrew/Cellar ..... /home/linuxbrew/.linuxbrew/Cellar
==> /home/linuxbrew/.linuxbrew/Cellar ..... /home/linuxbrew/.linuxbrew/Cellar
==> /home/linuxbrew/.linuxbrew ..... /home/linuxbrew/.linuxbrew/Cellar
Error: /home/linuxbrew/.linuxbrew/Cellar/libyaml is not a valid keg
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/keg.rb:164:in `initialize'
@abitrolly abitrolly added the bug Reproducible Homebrew/brew bug label Dec 13, 2023
@abitrolly
Copy link
Contributor Author

Forgot to add that it happens with other packages too if I remove libyaml.

@MikeMcQuaid
Copy link
Member

@abitrolly Can I see the output of find /home/linuxbrew/.linuxbrew/Cellar/libyaml? Thanks.

@abitrolly
Copy link
Contributor Author

@MikeMcQuaid

$ find /home/linuxbrew/.linuxbrew/Cellar/libyaml
/home/linuxbrew/.linuxbrew/Cellar/libyaml
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/.brew
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/.brew/libyaml.rb
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/libyaml-0.so.2.0.9
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/libyaml.a
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/libyaml-0.so.2
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/libyaml.so
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/pkgconfig
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/lib/pkgconfig/yaml-0.1.pc
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/INSTALL_RECEIPT.json
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/Changes
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/ReadMe.md
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/include
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/include/yaml.h
/home/linuxbrew/.linuxbrew/Cellar/libyaml/0.2.5/License

@MikeMcQuaid
Copy link
Member

This seems to be an issue specific to your system I'm afraid; you have issues with symlinks (did you manually move any around or your installation location or anything?). If we see more people reporting this I'll reopen but for now you'll have to uninstall and reinstall all formulae. brew bundle dump and brew bundle may make this easier if they aren't also broken by this. Sorry!

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
@abitrolly
Copy link
Contributor Author

No. I don't remember moving anything. Switching branches, rebasing for development, yes. It would be nice if brew doctor could reconcile. Maybe if other contributors report the same issue.

@github-actions github-actions bot added the outdated PR was locked due to age label Jan 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

2 participants