lyft / confidant

Confidant: your secret keeper. https://lyft.github.io/confidant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker gunicorn process correctly starts up but doesn't run the app

arjunblj opened this issue · comments

Not sure if clone of #150.

I have local AWS credentials (in ~/.aws) and the configuration variables passed to Docker via a CLI arg but nothing shows up when I navigate to the app's address. In addition, tables aren't created/there's nothing that indicates a running process. I run:

> docker run --env-file DOCKER_CONFIG -t lyft/confidant

What I see when I navigate to http://0.0.0.0:80:

image

Do the KMS master or auth keys have to be created manually in AWS' IAM in order to get this running?

Thank you!

0.0.0.0 is what gunicorn listens on, to say "I'll accept traffic from any interface", but it's not what you want to visit to get to the service from your browser. You need to connect to the IP of the container. Docker makes this annoyingly difficult. First find the container:

docker ps

Then find the IP for the container, using its container id:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container_id>

Then connect to that IP address.

Thanks @ryan-lane! The port that provided (172.17.0.2) still shows me the same page, on port 80/8000 as well. Not sure why this is.

Are you using boot2docker, or virtualbox or some other thing? It's possible it's doing port mapping to the vm, then to docker. So it may be some other IP you need to hit... Does the output from docker compose say anything?

Hey @ryan-lane -- thanks for your help earlier. I'm still having issues with this.

> aws dynamodb list-tables
{
    "TableNames": []
}
> aws iam get-user
{
    "User": {
        "UserName": "local-od",
        ...
    }
}
> aws sts get-caller-identity
{
    "Account": "679551263722",
...
}

It seems like I am correctly authenticated locally on my machine, but the tables aren't created in my local DynamoDB and the web process doesn't open. This is being started through docker-compose. Please let me know if there's anything else I can provide that would be helpful.

Full log for docker-compose up

> ~ docker-compose up
Starting confidant_dynamo_1 ...
Starting confidant_redis_1 ...
Starting confidant_dynamo_1
Starting confidant_redis_1 ... done
Starting confidant_confidant_1 ...
Starting confidant_confidant_1 ... done
Attaching to confidant_dynamo_1, confidant_redis_1, confidant_confidant_1
dynamo_1     | Initializing DynamoDB Local with the following configuration:
dynamo_1     | Port:	7777
dynamo_1     | InMemory:	false
dynamo_1     | DbPath:	/mnt/dynamo
dynamo_1     | SharedDb:	false
dynamo_1     | shouldDelayTransientStatuses:	false
dynamo_1     | CorsParams:	*
dynamo_1     |
redis_1      | 1:C 20 Sep 20:23:04.154 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1      | 1:C 20 Sep 20:23:04.154 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1      | 1:C 20 Sep 20:23:04.154 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1      | 1:M 20 Sep 20:23:04.159 * Running mode=standalone, port=6379.
redis_1      | 1:M 20 Sep 20:23:04.159 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1      | 1:M 20 Sep 20:23:04.159 # Server initialized
redis_1      | 1:M 20 Sep 20:23:04.161 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1      | 1:M 20 Sep 20:23:04.163 * DB loaded from disk: 0.002 seconds
redis_1      | 1:M 20 Sep 20:23:04.163 * Ready to accept connections
confidant_1  | [2017-09-20 20:23:05 +0000] [1] [INFO] Starting gunicorn 19.7.1
confidant_1  | [2017-09-20 20:23:05 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
confidant_1  | [2017-09-20 20:23:05 +0000] [1] [INFO] Using worker: gevent
confidant_1  | [2017-09-20 20:23:05 +0000] [9] [INFO] Booting worker with pid: 9
confidant_1  | [2017-09-20 20:23:05 +0000] [10] [INFO] Booting worker with pid: 10
confidant_1  | 172.17.0.1 - - [20/Sep/2017:20:23:21 +0000] "GET / HTTP/1.1" 302 243 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"

service.env has my real env variables and Google Auth is set up correctly. I've also added logging to the gunicorn task with --log-level set to debug, but nothing additional is logged out.

@arjunblj -- how'd you resolve this?