DarthSim / overmind

Process manager for Procfile-based applications and tmux
MIT License
2.82k stars 79 forks source link

listen unix ./.overmind.sock: bind: operation not supported #88

Closed dudintv closed 1 year ago

dudintv commented 4 years ago

I'm trying to setup Overmind on the WSL (Linux inside Windows) Ubuntu 16.04. And, after this command:

root@big-pc:/mnt/c/rails/vizmarket# overmind s

I've got an error:

system    | Tmux socket name: overmind-vizmarket-f2ZGVMrcSIdyY0QKfLB0X_
system    | Tmux session ID: vizmarket
system    | Listening at ./.overmind.sock
overmind: listen unix ./.overmind.sock: bind: operation not supported

What should I do to make it works?

DarthSim commented 4 years ago

Hey! Looks like Unix sockets don't work properly on WSL. I'll check this later.

As a workaround, I added ability to bind to TCP network instead of Unix socket to 2.2.0

Pagehey commented 3 years ago

Hey @dudintv ! I'm trying to do the same here but I can't figure out what to start with. How did you install overmind in the first place ? I guess it's with the binary but I'm not sure what I should do with it. And then, does the DarthSim's solution work ? Could you give me a hint also on this subject please. I'm new to WSL and Linux (my mac just crashed), and I struggle to figure what should go where. Thx =)

dudintv commented 3 years ago

@Pagehey I've abandoned that and moved to my mac book. WSL provides too many shits. It could look like ok but at some moment it crashes unexpectedly.

tmbs commented 3 years ago

Same issue on macOS 11.2.3 with Docker 3.3.0 and SAM CLI 1.22.0 running sam: sam local start-api --warm-containers=EAGER --env-vars=env.json, works fine without --warm-containers=EAGER.

DarthSim commented 3 years ago

@tmbs do you run sam with Overmind or Overmind with sam?

tmbs commented 3 years ago

Current Procfile ran with overmind s:

sam: sam local start-api --env-vars=env.json
tsc: npm run watch
DarthSim commented 3 years ago

It is weird then as Overmind binds to the socket before running the processes, so processes shouldn't affect the binding.

dreamalligator commented 3 years ago

Hey! Looks like Unix sockets don't work properly on WSL. I'll check this later.

As a workaround, I added ability to bind to TCP network instead of Unix socket to 2.2.0

Can confirm that this is still an issue in 2.2.2.

overmind start
# system | Tmux socket name: overmind-[...]
# system | Tmux session ID: [...]
# system | Listening at ./.overmind.sock
# overmind: it looks like Overmind is already running. If it's not, remove ./.overmind.sock and try again
overmind --version
# Overmind version 2.2.2
DarthSim commented 3 years ago

@dreamalligator This is WSL issue, so it can't be fixed inside Overmind. However, you're getting the error that tells you that you have already started an Overmind instance in the current dir. That's strange.

dreamalligator commented 3 years ago

Thanks @DarthSim. From turning computer off, I assume there is no cleanup step when not manually closing Overmind. Maybe I can add a script when my computer turns on to remove it, or whatever is best practice.

edit:

made the following alias function :shrug:

overmind() {
  if [[ $@ == "start" ]]; then
    [ -e .overmind.sock ] && rm -f .overmind.sock
    command overmind start
  else
    command overmind "$@"
  fi
}

edit edit:

suggestion from a friend:

function om() {
  OVERMIND_SOCKET="/tmp/.overmind-$(echo $PWD | md5sum | cut -f1 -d' ').sock" overmind "$@"
}
ibrahima commented 3 months ago

Sorry to bump an old thread, can make a new one if necessary. My coworker ran into this error while using Overmind inside Docker Desktop on macOS. I don't understand why this would be the case... any thoughts? We checked uname -a and it showed a Linux kernel 6.26. I would expect even if it was running on the macOS host Unix sockets should still be available. This seems pretty bizarre to me. We got it working with the TCP socket option but it feels strange to have to do this. Any pointers would be greatly appreciated!

ioev commented 2 months ago

I have two WSL2 instances, one is Ubuntu 18.04 and overmind works perfectly, the other is 22.04 and overmind gives me the overmind: listen unix ./.overmind.sock: bind: operation not supported error. Maybe not a WSL issue? Both instances are WSL2.

Update: turns out this was because the files I was accessing were on a Windows drive shared to the WSL instance. When I moved everything over to the linux filesystem, overmind works exactly as expected.