Report this

What is the reason for this report?

Issue with the database connection regarding the App Platform deployment.

Posted on December 31, 2024

As I was following the documentation regarding of deploying in app-platform, I am using flask and I successfully deployed the application. It showed the login UI and then when I attempt to login, internal error problem. I tracked the runtime logs showing “no table user exist”. I tried to check in my cli the mysql connection using the flags and after I checked the user and other table existed, this is very weird problem. How can I fix this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there! 👋

After deploying your app, do you by any chance run your database migrations as well?

If your app requires migrations to set up tables (e.g., using Flask-Migrate or SQLAlchemy), you need to make sure that these migrations are run as part of your deployment/run process. App Platform deployments don’t automatically run migrations unless you include a step for it.

If you haven’t already, add a migration step to your start or deploy command in the App Platform configuration. For example:

flask db upgrade && gunicorn -w 4 -b 0.0.0.0:8080 app:app

You can change the gunicorn based on your needs if needed.

Let me know how it goes!

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.