App Platform: API works perfect in prod but doesn't work

Hey all,

I’m writing an API and my API works completely on my machine, but then when I deploy it to DO’s App platform the auth and login functionality works but my schedulecontent/ resource breaks complaining:

phlik-it | 2020-10-15 20:00:12 - - [16/Oct/2020 01:00:12] "GET /schedulecontent HTTP/1.1" 308 -
phlik-it | 2020-10-15 20:00:12 [2020-10-16 01:00:12,517] ERROR in app: Exception on /schedulecontent/ [GET]
phlik-it | 2020-10-15 20:00:12 Traceback (most recent call last):
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask/", line 1950, in full_dispatch_request
phlik-it | 2020-10-15 20:00:12     rv = self.dispatch_request()
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask/", line 1936, in dispatch_request
phlik-it | 2020-10-15 20:00:12     return self.view_functions[rule.endpoint](**req.view_args)
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask_restful/", line 468, in wrapper
phlik-it | 2020-10-15 20:00:12     resp = resource(*args, **kwargs)
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask/", line 89, in view
phlik-it | 2020-10-15 20:00:12     return self.dispatch_request(*args, **kwargs)
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask_restful/", line 583, in dispatch_request
phlik-it | 2020-10-15 20:00:12     resp = meth(*args, **kwargs)
phlik-it | 2020-10-15 20:00:12   File "/usr/local/lib/python3.7/site-packages/flask_jwt/", line 177, in decorator
phlik-it | 2020-10-15 20:00:12     return fn(*args, **kwargs)
phlik-it | 2020-10-15 20:00:12   File "/app/Resources/", line 54, in get
phlik-it | 2020-10-15 20:00:12     cursor.execute(query)
phlik-it | 2020-10-15 20:00:12 sqlite3.OperationalError: no such column: None

and this makes no sense because everything is working just fine locally so there’s nothing for me to troubleshoot?

Any help or guidance on troubleshooting something like this would be MUCH appreciated.

Show comments

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello! This error appears to be coming from an SQLite database. SQLite is generally recommended only for development and importantly WILL see data loss in a containerized environment like the App Platform. Local disk storage on the App Platform is ephemeral. Anything written to local disk (including the SQLite DB) will disappear when the container is replaced or restarted. For persistent storage we commend using a database like the App Platform’s dev database or DigitalOcean managed databases.

It looks like you might be trying to use SQLite as your database and bundling it with your app. I can’t dig in further to confirm without more information, but you will want to avoid using SQLite and make use of MySQL or Postgres via our DBaaS product. Services deployed on app platform need to be ephemeral as any data you write to disk will be lost the next time you deploy or maintenance needs to occur. It’s possible that the location where your database is supposed to exist on disk is not accessible and therefore unreachable. If I am mistaken and you are not utilizing SQLite please let me know.