edgedb / edgedb-docker

Official Docker Image packaging for EdgeDB
83 stars 16 forks source link

1-alpha7 Docker image crashes #9

Closed clmnin closed 3 years ago

clmnin commented 3 years ago

Steps to Reproduce:

  1. Run the latest docker container
    docker run -it --rm -p 5656:5656 edgedb/edgedb:1-alpha7
  2. Get a runtime error

    edgedb error: ERROR: InternalServerError: not connected

    Bootstrapping EdgeDB instance...
    WARNING: unsolicited message LogMessage(LogMessage { severity: Debug, code: 4026531840, text: "received configuration reload request", attributes: {} })
    OK: CONFIGURE SYSTEM
    edgedb error: ERROR: InternalServerError: not connected
    Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
    Server traceback:
    Traceback (most recent call last):
    File "edb/server/mng_port/edgecon.pyx", line 1625, in edb.server.mng_port.edgecon.EdgeConnection.main
    File "edb/server/mng_port/edgecon.pyx", line 893, in simple_query
    File "edb/server/mng_port/edgecon.pyx", line 953, in _simple_query
    File "edb/server/pgcon/pgcon.pyx", line 231, in signal_sysevent
    File "edb/server/pgcon/pgcon.pyx", line 769, in simple_query
    File "edb/server/pgcon/pgcon.pyx", line 1050, in edb.server.pgcon.pgcon.PGProto.before_command
    RuntimeError: not connected
elprans commented 3 years ago

Confirmed. The crash is due to the listen-addresses port change in the last step of new instance bootstrap. Restarting the container on the same directory should work.

A better workaround is to use the edgedb server CLI to configure and start an instance in a docker container:

edgedb server init a7docker --version=1-alpha7 --method=docker
# connect to repl
edgedb -I a7docker
clmnin commented 3 years ago

@elprans Thank you. It worked.

I was previously using the verbose version

pool = await create_async_pool(
        host=EDGEDB_HOST,
        database=EDGEDB_DB,
        user=EDGEDB_USER,
)

Never occurred I could use the json from .edgedb/credentials/ to connect to an instance with ease.

pool = await edgedb.create_async_pool('my_instance')

Why was the port changed (from 5656 to 10702)?

elprans commented 3 years ago

Why was the port changed (from 5656 to 10702)?

When you run edgedb-server directly, the default port is still 5656. However, instances created by edgedb server init select a random port, because there may be many of them, and the idea is that you'll be relying on the instance parameters read from .edgedb/credentials.

tailhook commented 3 years ago

This should not be closed. Docker image still fails. It's very inconvenient to wait for container to fail and then start again before we can use it. Can we update the image? Or should we move this issue to edgedb-docker repo?

elprans commented 3 years ago

This is an edgedb-docker issue, and yes it's actionable.

tailhook commented 3 years ago

This looks like have been fixed with backend connection pool implementation, so works on nightly. Original error look like a crash because connection to postgres was interrupted. At least running the following works fine:

docker run -it --rm -p 5656:5656 edgedb/edgedb:20210128023945dde634

@elprans, you probably understand older the underlying issue better, so please comment or close the issue.

elprans commented 3 years ago

Yes, @1st1 fixed this with connection pool rework. The original crash was in the internal event sending code.