Skip to content

gerrit container not starting #1

@s-friedman

Description

@s-friedman

I've verified that gerrit-docker is up to date and has had no modifications from the stock repo. Trying to start the gerrit container yields:

FATA[0001] Error response from daemon: Cannot start container 936f9931e733f30457269055785653bda80b4dd1d9c650d771d117c688e11a2f: Cannot link to a non running container: /gerrit AS /proxy/gerrit

The gerrit docker container shows that it couldn't contact the pg-gerrit on TCP:

steve@klaatu:~$ sudo docker logs gerrit
First time initialize gerrit...
[2016-02-18 20:57:27,566] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /var/gerrit/review_site/etc/gerrit.config; assuming defaults
Generating SSH host key ... rsa(simple)... done
Initialized /var/gerrit/review_site

/gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*

Upgrading gerrit...
fatal: DbInjector failed
fatal: Unable to determine SqlDialect
fatal: caused by org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
fatal: caused by java.net.ConnectException: Connection refused

pg-gerrit does have an open port on 5432:
steve@klaatu:~$ sudo docker exec -it pg-gerrit bash
root@3d9c7c520637:/# cat /proc/net/tcp
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 00000000:1538 00000000:0000 0A 00000000:00000000 00:00000000 00000000 999 0 2067181 1 0000000000000000 100 0 0 10 0

I noticed that pg-gerrit's log shows that it bounces the database during initialization, but this change to start up script has no effect on the ultimate outcome.

steve@klaatu:~/gerrit-docker (master)$ git diff
diff --git a/createGerrit.sh b/createGerrit.sh
index 879ae9e..574d135 100755
--- a/createGerrit.sh
+++ b/createGerrit.sh
@@ -23,7 +23,7 @@ docker run
-e POSTGRES_DB=reviewdb
-d ${POSTGRES_IMAGE}

-while [ -z "$(docker logs ${PG_GERRIT_NAME} 2>&1 | grep 'autovacuum launcher started')" ]; do
+while [ "$(docker logs ${PG_GERRIT_NAME} 2>&1 | grep 'autovacuum launcher started' | wc -l )" -ge 2 ]; do
echo "Waiting postgres ready."
sleep 1
done

Not sure how to proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions