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

Unknown database 'chords_demo_production' (ActiveRecord::NoDatabaseError) #487

Open
ajamthetacc opened this issue Nov 12, 2018 · 8 comments

Comments

@ajamthetacc
Copy link

When trying to run Chords 0.9.7.1 locally, see following errors in chords app logs
Unknown database 'chords_demo_production' (ActiveRecord::NoDatabaseError). Please suggest if you have seen the issue before.Thanks.

@zastruga
Copy link
Collaborator

The current version of CHORDS is 0.9.8.2, which currently has a known issue for new instances. A fix is coming soon.

@ajamthetacc
Copy link
Author

Ok thanks for letting know. 0.9.7.1 had worked fine in past, its not anymore. Do you know until when would the fix be available?

@zastruga
Copy link
Collaborator

Here's something to try. The CHORDS database gets created when you first run the application and creates a flag saying the db was created. If that flag was set erroneously, it could lead to this problem. SSH into your VM/machine and then as a root/sudo enabled user, docker exec -it chords_app /bin/bash. This will drop you into a prompt within the docker container running the application. From there, cd /var/lib/mysql and see if the file chords_demo_production exists. If it does, remove that file and then exit the app container and restart the app using python chords_control --stop and then python chords_control --run from the /var/lib/chords directory.

@ajamthetacc
Copy link
Author

Thanks a lot for the instructions. The chords_app exits few seconds after python chords_control --run and it does not allow me to perform docker exec -it chords_app /bin/bash. Error response from daemon: Container not running.

@zastruga
Copy link
Collaborator

Ah, good point. I'd venture the MySQL container would still be running, so you can do the same steps, but use docker exec -it chords_mysql /bin/bash instead. The containers use shared volumes for persistent storage, so /var/lib/mysql will be accessible there as well.

@ajamthetacc
Copy link
Author

I don't see that file inside /var/lib/mysql either. And docker logs for chords_app say ERROR -- : Unknown database 'chords_demo_production' (ActiveRecord::NoDatabaseError). Any suggestions?

@zastruga
Copy link
Collaborator

Only other thing I can think of is not going through the python chords_control --config step completely and the mysql password maybe not getting set? If that file wasn't present, then the startup script should've attempted to create the database before moving forward. You could go back into the mysql container and use the mysql prompt to see if any databases exist. At this point, you might be better served removing the current docker images and shared volumes and starting from scratch and hope it works as expected.

@ajamthetacc
Copy link
Author

We started from scratch deleting the volumes and images, getting **** /var/lib/mysql/CHORDS_SEEDED_production not found. We will attempt to create the database.
in the docker logs for apps now.

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