Error in 'docker-compose up'

Try to setup on local according to the README and get an error as the sreenshot shows.
Any hints to resolve it?

1 Like

Hi @Shengjie_Yang! Welcome to the forum :slight_smile:

It looks like a clash in port forwarding. You can check if port is used by other process with sudo netstat -ltnp | grep ':80'

From you command docker ps -a I see that revproxy-service was created. I wonder if you do

docker-compose down
docker-compose up -d

do you see the same error?

@Viktorija Thanks for your reply. I just tried docker-compose down, then docker-compose up -d. Still got the same error as previously. Please see the screenshot of the output from netstat
FYI, I host some websites on local. Could it cause the conflict? If so, how to resolve it?
Thanks!

Hi @Shengjie_Yang!

Yes, you are right about conflict. I see apache2 hosted on the same port, that's why revproxy-service can not use it. You can change port for revproxy service and any other service in the docker-compose.yaml file https://github.com/uc-cdis/compose-services/blob/master/docker-compose.yml#L215 Also for revproxy you would need to change port in the nginx.conf https://github.com/uc-cdis/compose-services/blob/master/nginx.conf#L29

Hi @Viktorija, that works now. I changed my apache default port and docker-compose up didn't return any error.
But when I visit https://localhost/, it show 502 Bay Gateway (nginx/1.15.5). Then I look into the log and get the message like below. Could you help me on that? Thanks a lot

Hi @Shengjie_Yang! Sometimes 502 Bad Gateway can appear when portal service or other services are not ready yet. Sheepdog and Peregrine services download the dictionary schema at startup, and the portal service runs a series of pre-launch compilations that depend on Sheepdog and Peregrine, so it may take several minutes for the portal to finally come up at https://localhost. You can monitor startup process by following portal logs:

docker logs -f portal-service

If all services started and you still get 502 Bad Gateway error after several minutes, maybe there is additional information in other logs? You can check it with docker logs -f <service-name> for a live log output when you attempt to reach localhost.

Hi @Viktorija , I find it's cause by the Postgres. Running docker logs -f composeservices_postgres_1 shows

Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html

I find a solution by adding below option in docker-compose.yml :


Then I can visit and login the local instance.
Thanks a lot for your help:)

2 Likes

I'm glad it works now! :slight_smile: I wonder if you would like to join our slack channel, where people interested in Gen3 share their experience in configuring and running Gen3 services?

Thank you @Viktorija , I'd love to join the community and please send the invitation to yangshengjie4u@gmail.com :slight_smile:

We sent you the invite :slight_smile:

Thank you:) I received it