fast-data-dev icon indicating copy to clipboard operation
fast-data-dev copied to clipboard

Apple M1 - Could not successfully bind to port 2181

Open julianlecalvez opened this issue 3 years ago • 16 comments

Hi ! I cope with an issue when I try to run the docker image on my Apple M1 mac (see the command and error below). At first, I tried to look for the port, which I was using because I have a zookeeper installation with brew, but after shutting it down, and even a restart, I still have this error. And if I run : lsof -nP -iTCP -sTCP:LISTEN | grep 2181, i get nothing. Now I'm thinking it's because of the new Apple M1 chips, because of the warning I get, but i'm not sure it's a common issue, and I'm not sure the actual error message can be related with ^^ Is there anything someone can think of that I can try ?

Thanks a lot !

$ docker run --rm --net=host lensesio/fast-data-dev

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0x512269, 0x9)
	/usr/lib/go/src/runtime/panic.go:566 +0x95
runtime.newosproc(0xc420030000, 0xc42003ffc0)
	/usr/lib/go/src/runtime/os_linux.go:160 +0x194
runtime.newm(0x5203a0, 0x0)
	/usr/lib/go/src/runtime/proc.go:1572 +0x132
runtime.main.func1()
	/usr/lib/go/src/runtime/proc.go:126 +0x36
runtime.systemstack(0x593600)
	/usr/lib/go/src/runtime/asm_amd64.s:298 +0x79
runtime.mstart()
	/usr/lib/go/src/runtime/proc.go:1079

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/lib/go/src/runtime/asm_amd64.s:252 fp=0xc42002a768 sp=0xc42002a760
runtime.main()
	/usr/lib/go/src/runtime/proc.go:127 +0x6c fp=0xc42002a7c0 sp=0xc42002a768
runtime.goexit()
	/usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42002a7c8 sp=0xc42002a7c0
Could not successfully bind to port 2181. Maybe some other service
in your system is using it? Please free the port and try again.
Exiting.

julianlecalvez avatar May 02 '21 16:05 julianlecalvez

I have the same issue, also with Apple M1 chip. Did you maybe manage to fix it by yourself?

blesof avatar May 14 '21 14:05 blesof

I have the same issue, also with Apple M1 chip. Did you maybe manage to fix it by yourself?

No, I didn't fix it. I'm still hoping an solution in this thread :)

julianlecalvez avatar May 15 '21 11:05 julianlecalvez

No, I didn't fix it. I'm still hoping an solution in this thread :)

If you want a quick and dirty fix which works, you can comment this in setup-and-run.sh file (lines 500 to 504):

    elif ! /usr/local/bin/checkport -port "$port"; then
        echo "Could not successfully bind to port $port. Maybe some other service"
        echo "in your system is using it? Please free the port and try again."
        echo "Exiting."
        exit 1

And also remove duphard from Dockerfile. Then you can build this image locally and it works fine.

But still I'm waiting for a fix in this thread :) Issue is caused by checkport app used there.

blesof avatar May 18 '21 16:05 blesof

Looking at the Dockerfile, looks like there's several things that need to be updated/ported to work for the M1's:

  • duphard
  • checkport
  • coyote
  • gotty
  • quickcert
  • caddy
  • normcat

ericnograles avatar Jun 29 '21 11:06 ericnograles

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

faberchri avatar Oct 19 '21 18:10 faberchri

I was able to come up with an alternative, check it out here:

https://github.com/lensesio/fast-data-dev/issues/182#issuecomment-1018131875

FilipeNavas avatar Jan 21 '22 03:01 FilipeNavas

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

Thank you very much! - It's working :-). I was thinking if it is possible to make a pull request here?

medialwerk avatar Apr 26 '22 15:04 medialwerk

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working.

As pictured below, you can see the error. Any idea? image

M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

aminch18 avatar May 13 '22 10:05 aminch18

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

@faberchri , Thanks a lot the changes made in dockerFile worked

chanukyamoorthy avatar Jun 10 '22 22:06 chanukyamoorthy

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I built on this to create PR 185 which adds support for arm64 and amd64 at same time + along with how to build a multi-arch image using docker buildx.

dougdonohoe avatar Jul 07 '22 19:07 dougdonohoe

Yes, this PR 185 from dougdonohoe help me a lot and solved the problem of compiling an image for linux/arm64 architecture.

Thank you, kind Sir! 🙌

egel avatar Jul 12 '22 12:07 egel

Created a fork with the required changes to run on arm64 / Apple M1. Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working.

As pictured below, you can see the error. Any idea? image

M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

Hi I am facing the same issue, have you found a solution for this yet?

henok-tesfa-kr avatar Nov 23 '22 14:11 henok-tesfa-kr

Created a fork with the required changes to run on arm64 / Apple M1. Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working. As pictured below, you can see the error. Any idea? image M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

Hi I am facing the same issue, have you found a solution for this yet?

same here

JBERKO9 avatar Nov 25 '22 09:11 JBERKO9

I think this is because archive.lenses.io is down. It seems it has happened before, per this issue: https://github.com/lensesio/fast-data-dev/issues/186

dougdonohoe avatar Nov 27 '22 02:11 dougdonohoe

You can also just docker pull dougdonohoe/fast-data-dev and get the image I built prior to the issues with archive.lenses.io

dougdonohoe avatar Nov 27 '22 05:11 dougdonohoe

I filed a ticket with lenses.io over the weekend and they seem to have restored archive.lenses.io. It's working for me now.

dougdonohoe avatar Nov 28 '22 22:11 dougdonohoe