Question

Issue with the database connection regarding the App Platform deployment.

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?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
January 1, 2025

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

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.