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

Minimal docker-compose setup fails to start up on M1 Mac #24

Open
mikeyhew opened this issue Jul 12, 2021 · 16 comments
Open

Minimal docker-compose setup fails to start up on M1 Mac #24

mikeyhew opened this issue Jul 12, 2021 · 16 comments

Comments

@mikeyhew
Copy link

This is my docker-compose.yml file:

version: "3.9"  # optional since v1.27.0
services:
  edgedb:
    image: edgedb/edgedb:nightly
    environment:
      - EDGEDB_PASSWORD=edgedb

When I run docker compose up, I get this output:

docker compose up
[+] Running 2/1
 ⠿ Network sharestuff_default     Created                                                                                                                                                              3.7s
 ⠿ Container sharestuff_edgedb_1  Created                                                                                                                                                              0.0s
Attaching to edgedb_1
edgedb_1  | Bootstrapping EdgeDB instance on the local volume...
edgedb_1  | INFO 51 2021-07-12 04:52:36,209 edb.server: EdgeDB server (1.0-beta.3+dev5728.d2021071200.gba528d9cf.cv202107020000) starting.
edgedb_1  | INFO 51 2021-07-12 04:52:38,462 edb.server: Using 19 max backend connections based on total memory.
edgedb_1  | INFO 51 2021-07-12 04:52:38,545 edb.server.pgcluster: Initializing database cluster in /var/lib/edgedb/data
edgedb_1  | INFO 51 2021-07-12 04:52:42,412 edb.server: Creating template database...
edgedb_1  | INFO 51 2021-07-12 04:52:43,190 edb.server: Creating the necessary PostgreSQL extensions...
edgedb_1  | INFO 51 2021-07-12 04:52:43,205 edb.server: Initializing the standard library...
edgedb_1  | ERROR: Server socket did not appear within 120 seconds.
edgedb_1  | /usr/local/bin/docker-entrypoint-funcs.sh: line 599: kill: (53) - No such process
edgedb_1  | ERROR: Could not bootstrap EdgeDB server instance.
edgedb_1 exited with code 1
@elprans
Copy link
Member

elprans commented Jul 12, 2021

Hi @mikeyhew! What system are you running this on?

@mikeyhew
Copy link
Author

Hi @elprans! I'm running on an M1 mac with Big Sur 11.4, using Docker Desktop for Mac. I don't know any reason why it would behave differently on other systems though - were you able to reproduce it?

docker --version gives me:

Docker version 20.10.6, build 370c289

@elprans
Copy link
Member

elprans commented Jul 13, 2021

Can't reproduce on an Intel Mac, so this might be related to x86 emulation on m1, as we don't have native builds for it at the moment.

@elprans
Copy link
Member

elprans commented Jul 13, 2021

That said, non-docker installation method (via the edgedb CLI) should work on m1.

@mikeyhew
Copy link
Author

Can't reproduce on an Intel Mac, so this might be related to x86 emulation on m1, as we don't have native builds for it at the moment.

@elprans ok thanks for that info. I'll see if I can get some time later to debug this some more. Do you have any ideas of things I could check to try to figure out why the server socket isn't showing up?

@mikeyhew mikeyhew changed the title Minimal docker-compose setup fails to start up Minimal docker-compose setup fails to start up on M1 Mac Jul 14, 2021
@elprans
Copy link
Member

elprans commented Jul 14, 2021

My best guess would be that it's either too slow due to Docker virtualization on macOS on M1 or that things are crashing weirdly.

I'd start by adding a bunch of verbose logging:

docker run --rm -it -e EDGEDB_DOCKER_TRACE=1 -e EDGEDB_EXTRA_ARGS="--log-level=debug" -e EDGEDB_DEBUG_SERVER=1 -e EDGEDB_DEBUG_PGSERVER=1 -e EDGEDB_PASSWORD=foo edgedb/edgedb:nightly | tee log.txt

Please compress the resulting log.txt and attach here.

@mikeyhew
Copy link
Author

Here is the log from running that command: log.txt.gz

This might actually be the first docker dependency that I've used since getting my M1 Mac that didn't have an arm64 build, so it's possible that there's issues with the x86_64 emulation that I just haven't encountered yet. If that's the case then it might be worth trying to build this locally for arm64 - would that be possible, and if so what is the correct docker incantation to run once I've cloned this repo?

@elprans
Copy link
Member

elprans commented Jul 15, 2021

From the log it seems like it's just taking longer than the timeout. I'll respin the image making that timeout configurable via an env var.

@mikeyhew
Copy link
Author

To me, based on the log it looks like nothing is happening for the last 110 seconds of the 120 second timeout, so i wouldn't expect increasing the timeout to help. I could be missing something though

@elprans
Copy link
Member

elprans commented Jul 16, 2021

nothing is happening for the last 110 seconds

Does top confirm this?

@mikeyhew
Copy link
Author

Good question. I can't do it right now, but I'll check this weekend.

@mikeyhew
Copy link
Author

@elprans yes, running docker exec -it <container> top shortly after starting the docker run command, I see close to 100% CPU usage, and then it reduces down to about 1% after the last "real" logs are emitted.

By "real" logs, I mean anything other than this

+ for i in $(seq 1 $(($timeout / $retry_period)))
+ sleep 5
+ '[' ']'

Which is repeated 22 times at the end, without any other logs in between. That's where I got the 110 seconds from.

@mikeyhew
Copy link
Author

mikeyhew commented Aug 7, 2021

@elprans how hard would it be to create an arm64 version of this image? i think ultimately that would be the best solution, since even if we could get the x86_64 version working, it would still be running under emulation and less performant than a native image.

If that's not feasible, then it might make sense to look into getting the x86_64 version working, but it could be there's some obscure bug that happens when running x86_64 containers in emulation in Docker for Mac on M1 Macs that's just not worth trying to track down, whereas having an arm64 version of the image would be more widely beneficial.

@limx0
Copy link

limx0 commented Sep 15, 2021

+1 I'm also seeing this issue - unable to docker install or native on my M1 mac. This is for both beta3 and the nightly build.

Is there a way to turn on debug logging for the native install?

@tailhook
Copy link
Contributor

Is there a way to turn on debug logging for the native install?

You can try RUST_LOG=debug edgedb server install. And also edgedb server _detect

@limx0
Copy link

limx0 commented Sep 15, 2021

Thanks @tailhook. I realised this is the docker repo so I've opened edgedb/edgedb#2940 instead.

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

No branches or pull requests

4 participants