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

Docker startup getting stuck on mysqladmin ping #587

Closed
ZetaTwo opened this issue Mar 13, 2018 · 1 comment
Closed

Docker startup getting stuck on mysqladmin ping #587

ZetaTwo opened this issue Mar 13, 2018 · 1 comment

Comments

@ZetaTwo
Copy link

ZetaTwo commented Mar 13, 2018

Environment:

  • CTFd Version/Commit: ctfd/ctfd:latest from Docker hub (17 days old)
  • Operating System: Amazon Linux AMI 2017.09.j x86_64 ECS HVM GP2
  • Web Browser and Version: N/A

What happened?

Trying to setup CTFd with AWS ECS and RDS Aurora.
If I don't set the DATABASE_URL env variable, it works fine and starts.
If I do set the DATABASE_URL to mysql+pymysql://ctfd:@CTFd.i.eu-west-1.rds.amazonaws.com/ctfd I get stuck on docker-entrypoint.sh:7 while ! mysqladmin ping -h db --silent; do

What did you expect to happen?

That the ping should succeed and startup continue

How to reproduce your issue

Create an ECS task with ctfd/ctfd as image source, set env variable SECRET_KEY and DATABASE_URL. Start container.

I have made sure the container can access the database by running docker exec container-id mysql -h ctfd.<resource-id>.eu-west-1.rds.amazonaws.com -p<SECRET PASSWORD> which works.

Any associated stack traces or error logs

Just stuck on "Waiting on MySQL"

My question is basically: am I doing something wrong and should somehow make that "db" resolve to the database or is the script incorrect and should take the value of DATABASE_URL into account?

@ColdHeat
Copy link
Member

Sorry I missed this issue. Within docker-compose each of the containers (including the db) get a hostname related to the service.

I think we should be taking into account the DATABASE_URL value.

If you have the time a PR would be great!

ColdHeat added a commit that referenced this issue Mar 25, 2018
JJwang11 pushed a commit to sigpwny/CTFd that referenced this issue Jan 22, 2020
* Add redis to docker-compose, bump worker count to 4
* Add workers & missing SECRET_KEY error
* Remove uwsgi specific files
* Parse database host in `docker-entrypoint.sh`. Closes CTFd#587
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

2 participants