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

[BUG] Too many levels of symbolic links (os error 62) #1363

Open
1 task done
anacrolix opened this issue Aug 7, 2023 · 6 comments
Open
1 task done

[BUG] Too many levels of symbolic links (os error 62) #1363

anacrolix opened this issue Aug 7, 2023 · 6 comments
Labels

Comments

@anacrolix
Copy link

Checks

  • I have read the troubleshooting section and still think this is a bug.

Describe the bug you encountered:

/ % fd wireguard /opt/homebrew --show-errors -L
[fd error]: /opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1: Too many levels of symbolic links (os error 62)
[fd error]: /opt/homebrew/Library/Homebrew/vendor/gems/mechanize/mechanize-2.9.1: Too many levels of symbolic links (os error 62)

Describe what you expected to happen:

/ % find /opt/homebrew -name wireguard
/opt/homebrew/etc/wireguard

What version of fd are you using?

fd 8.7.0

Which operating system / distribution are you on?

% uname -srm
Darwin 22.6.0 arm64
@anacrolix anacrolix added the bug label Aug 7, 2023
@tavianator
Copy link
Collaborator

What is the output of

/ % ls -l /opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1

? I suspect it really is a symbolic link loop.

@anacrolix
Copy link
Author

You are quite right.

/opt/homebrew/Library/Homebrew/vendor/gems/mechanize % ls -l /opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1
lrwxr-xr-x@ 1 anacrolix  admin  16 22 May 14:40 /opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1@ -> mechanize-2.9.1/
/opt/homebrew/Library/Homebrew/vendor/gems/mechanize % cd mechanize-2.9.1
cd: too many levels of symbolic links: mechanize-2.9.1

I think this error is also recoverable: If we receive that error, drop following that symlink and just continue on to the next item. With this behaviour, --show-errors can retain its existing behaviour too: If enabled, the above error message can be displayed, otherwise it is not.

@tavianator
Copy link
Collaborator

Ohh I didn't notice the missing /opt/homebrew/etc/wireguard. I'm not sure that has to do with the loop error. Do any of these work?

/ % fd wireguard /opt/homebrew
/ % fd -L wireguard /opt/homebrew
/ % fd -u wireguard /opt/homebrew

@anacrolix
Copy link
Author

@tavianator I thought you had found the issue with the symlink loop, but then I got this:

~ % fd wireguard /opt/homebrew
~ % fd -L wireguard /opt/homebrew
~ % fd -u wireguard /opt/homebrew
/opt/homebrew/opt/wireguard-tools
/opt/homebrew/opt/wireguard-go
/opt/homebrew/Cellar/wireguard-tools/
/opt/homebrew/Cellar/wireguard-tools/1.0.20210914_1/.brew/wireguard-tools.rb
/opt/homebrew/Cellar/wireguard-go/
/opt/homebrew/Cellar/wireguard-go/0.0.20230223/.brew/wireguard-go.rb
/opt/homebrew/Cellar/wireguard-go/0.0.20230223/bin/wireguard-go
/opt/homebrew/Cellar/zig/0.10.1/lib/zig/libc/include/any-linux-any/linux/wireguard.h
/opt/homebrew/Caskroom/android-ndk/25c/AndroidNDK9519653.app/Contents/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/wireguard.h
/opt/homebrew/etc/wireguard/
/opt/homebrew/var/homebrew/linked/wireguard-tools
/opt/homebrew/var/homebrew/linked/wireguard-go
/opt/homebrew/bin/wireguard-go

I did not expect that with -u. So I ran

~ % fd ignore /opt/homebrew
/opt/homebrew/.dockerignore
/opt/homebrew/.gitignore

~ % fd wireguard /opt/homebrew --no-ignore
/opt/homebrew/opt/wireguard-go
/opt/homebrew/opt/wireguard-tools
/opt/homebrew/Cellar/wireguard-tools/
/opt/homebrew/Cellar/wireguard-go/
/opt/homebrew/Cellar/wireguard-go/0.0.20230223/bin/wireguard-go
/opt/homebrew/Cellar/zig/0.10.1/lib/zig/libc/include/any-linux-any/linux/wireguard.h
/opt/homebrew/Caskroom/android-ndk/25c/AndroidNDK9519653.app/Contents/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/wireguard.h
/opt/homebrew/etc/wireguard/
/opt/homebrew/var/homebrew/linked/wireguard-go
/opt/homebrew/var/homebrew/linked/wireguard-tools
/opt/homebrew/bin/wireguard-go

I see the desired dir in the list /opt/homebrew/etc/wireguard/. What a ride. This seems like unintended behaviour here, clearly .gitignore in the homebrew dir is not intended to suppress searches in that directory.

@tmccombs
Copy link
Collaborator

tmccombs commented Aug 9, 2023

That depends on the content of .gitignore

@Mroczek1992
Copy link

8yzkfsoxput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants