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

Socket operation on non-socket on git clone cmd #2312

Open
AvihaiSam opened this issue Mar 17, 2024 · 2 comments
Open

Socket operation on non-socket on git clone cmd #2312

AvihaiSam opened this issue Mar 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@AvihaiSam
Copy link

Bug Description

running on osX M1:

gh repo clone $REPO $PATH -- -c advice.detachedHead=false --quiet --depth 1 -b $BRANCH

and got the following output:

ERROR ThreadId(01) mirrord_layer::error: Error occured in Layer >> ProxyError(CodecError(IoError(Os { code: 38, kind: Uncategorized, message: “Socket operation on non-socket” })))
gethostname: Invalid argument

Steps to Reproduce

gh repo clone $REPO $PATH -- -c advice.detachedHead=false --quiet --depth 1 -b $BRANCH

Backtrace

No response

Relevant Logs

No response

Your operating system and version

osX, M1

Local process

the code runs inside bash script

Local process version

Additional Info

mirrord vr: 3.92.0

@AvihaiSam AvihaiSam added the bug Something isn't working label Mar 17, 2024
@AvihaiSam
Copy link
Author

trace logs of agent mirrord-agent.log

@meowjesty
Copy link
Member

I've tried looking into this (on linux) and could not reproduce this error IoError(Os { code: 38, kind: Uncategorized, message: “Socket operation on non-socket” } exactly. Instead, what I'm getting is a hard crash:

remote_hostname_string:remote_open: mirrord_layer::file::ops: peer_addr [Err(Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" })], local_addr [Err(Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" })] path="/etc/hostname" open_options=OpenOptionsInternal { read: true, write: false, append: false, truncate: false, create: false, create_new: false }

Which indicates that the internal proxy socket is being closed/dropped (even when I tried unsetting O_CLOEXEC), both before and after adding an execve hook. The end result is the same, gh repo clone doesn't work.

I've made a small sample app that reproduces the issue here. It executes curl using a golang Command.

gh-cli is written in go, so this looks like a mirrord-go issue, I've tried simulating this with a rust sample (start a process and run git clone) and it just worked, meanwhile the go sample is unreliable, sometimes it works, most of the time it doesn't.

I'm dropping this for now, if someone else wants to investigate it on macos, would appreciate (maybe it's a different issue on macos?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants