arangodb / arangodb-docker

Docker container for ArangoDB
Apache License 2.0
106 stars 32 forks source link

Run crashes on macOS Ventura 13.5 #114

Closed michal-sankot closed 1 year ago

michal-sankot commented 1 year ago

I tried to run arango docker image as indicated in tutorial

docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb/arangodb:3.11.2

And it crashes.

 ~/workspace/arangodb  docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb/arangodb:3.11.2                        
Unable to find image 'arangodb/arangodb:3.11.2' locally
3.11.2: Pulling from arangodb/arangodb
c1d6d1b2d5a3: Pull complete
8d38d666a6cc: Pull complete
c2b0ae240f39: Pull complete
2ed1cc6cf126: Pull complete
2b33253e34bc: Pull complete
675c507860f7: Pull complete
350176059c1c: Pull complete
fe0c25583f89: Pull complete
2c699bb0da8d: Pull complete
17fc424bf7d2: Pull complete
Digest: sha256:aef44902df4ca26a7fd5322077799a130ad3772a9a3bf479bb7b0ec441f98b42
Status: Downloaded newer image for arangodb/arangodb:3.11.2
Initializing root user...Hang on...
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
Initializing database...Hang on...
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
qemu: uncaught target signal 4 (Illegal instruction) - core dumped

ArangoDB didn't start correctly during init
cat: can't open '/tmp/init-log': No such file or directory

Is there any way to make it work?

System Version: macOS 13.5 (22G74) Chip: Apple M1 Pro

dothebart commented 1 year ago

Hi, you need to make sure that the ARM-version of the container is used. If it pulls x86, Rosetta is ran, which doesn't implement some cpu opcodes - hence you get SIG_ILL.

michal-sankot commented 1 year ago

ok, thanks 👍

it worked with:

docker run --platform linux/arm64/v8 -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb/arangodb:3.11.2

it may be handy to add it as a note to https://www.arangodb.com/download-major/docker/ so that others on Mx don't hit the same issue.

tianon commented 10 months ago

Was there any investigation done into why it's choosing linux/amd64 on a linux/arm64/v8 host? Docker shouldn't do that, and I've indeed verified that Docker pulls the correct thing on a native host. 😕 Is it possible your Docker VM was running in x86 mode or something somehow? Was this on Docker Desktop? A hand-maintained VM? There's a pretty serious bug here somewhere, and I think it's one worth pulling on. :sweat_smile:

dothebart commented 10 months ago

@tianon this seemed to be a MacOS host; It has a Rossetta x86 emulation by default. To the MacOS user it seems to be more or less opaque which binary he's running - unless its x86 and demands AVX2 - which isn't implemented in Rosettta. So @michal-sankot would probably need to revalidate which docker etc. was in use on his machine.

michal-sankot commented 10 months ago

hey, i can validate it. though i'm not strong with docker. so if you give me steps/commands to run, i happily fire them to check it.

michal-sankot commented 10 months ago

i've listed defualt vars (on mac) and it sets default docker platform to linux/amd64. so that's why it assumed platform to be amd64 while it's arm (M1 chip).

DOCKER_DEFAULT_PLATFORM=linux/amd64
dothebart commented 10 months ago

can you file the docker binary? is it ARM? or is it M1? or is it a fat binary?

michal-sankot commented 10 months ago

it's ARM

/usr/local/bin/docker: Mach-O 64-bit executable arm64
tianon commented 10 months ago

😬 setting DOCKER_DEFAULT_PLATFORM on your host in this way is very very extremely not recommended (I think it might not even be an officially documented environment variable for exactly that reason)

michal-sankot commented 10 months ago

hmm, i was using intel mac before, so maybe it got carried over when migrating to m1 model 🤔