I have a simple server less function that is simply doing a select query to a PostgreSQL database hosted on digital ocean in Python using SQLAlchemy, but it is sending { “code”: “9d5872ba17cd438c844b05a5fe6a5450”, “error”: “There was an error processing your request.” } on line engine = create_engine(POSTGRES_DB_URL)
I am feeling dead end at this point.
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.
Hi SalmanZ10
There are a few things that could be causing the error you’re seeing. Here are a few things you can check to help debug the issue:
Make sure that the PostgreSQL database you’re trying to connect to is up and running, and that you can connect to it using the connection details specified in the
POSTGRES_DB_URL
variable.Check the permissions for the user specified in the
POSTGRES_DB_URL
. Make sure that the user has the appropriate permissions to run SELECT queries on the database.Check the application logs for more detailed information about the error. The logs may give more insight into the specific issue.
Verify the POSTGRES_DB_URL. Make sure that the url is valid, with the correct database name, host, port,user and password in it.
Try to see if the same code is working as expected on your local environment, as the error could be with the setup of the service on digital ocean’s app platform.
I hope this helps you to resolve the issue. If you need further assistance, please let me know.