Support Desk

Support for easySupport

You — 03.09.2018 07:36
How to install php software on the server?

Support Team — 03.01.2024 08:13
Hello,

Thank you for your question today. The software you want to place on your server will take a PHP plan in order to use it. Also, these software programs will not be supported by our normal support team, so any troubleshooting would need to be done by you.

Currently, we have no instructions on how to set up or install these programs on any of our servers. You may want to contact our support team to see if either our System Admin team or our Advanced Hosting Team can assist with getting the software set up. Their services may have an installation fee involved, however.

Kindest Regards,
Hosting Admin

You — 03.01.2024 09:59
Subject: Issue with Database Connection in Python Flask App

Description of the Problem:
We are currently facing an issue with the database connection in our Python Flask application. The application, which utilizes Flask-SQLAlchemy for database interactions, fails to establish a connection to the PostgreSQL database when running in a production environment.

Reproduction Steps:
1. Deploy the Flask app to a production server.
2. Access the application via the production URL.
3. Observe the error related to the database connection failure.

Environment Details:
- Operating System: Ubuntu 20.04 LTS
- Python Version: 3.8.5
- Flask Version: 2.0.1
- Flask-SQLAlchemy Version: 2.5.0
- PostgreSQL Version: 12.5
- Production Server: Nginx

Error Messages or Logs:
Upon accessing the application, the following error message is logged in the Gunicorn error log:

OperationalError: could not connect to server: Connection refused

Additionally, the PostgreSQL server logs do not show any incoming connection attempts from the production server IP.

Attempts to Solve the Issue:
1. Checked database credentials for correctness.
2. Verified that the PostgreSQL server is running and accepting connections.
3. Tested the application in a local development environment, where it successfully connects to the database.

Expected vs. Actual Behavior:
We expected the Flask app to establish a connection to the PostgreSQL database without any issues in the production environment. However, the actual behavior is a connection refusal error.

Code Snippets:
Relevant section of the Flask app's config.py file:

SQL_HOST = 'localhost'

SQL_NAME = 'username'

SQL_PASS = 'password'

Screenshots or Videos:
Screenshots of the Gunicorn error log and relevant portions of the PostgreSQL server log are attached to provide visual context.

Conclusion:
The development team seeks assistance in identifying the root cause of the database connection issue in the production environment and any potential solutions. Any guidance on how to troubleshoot this specific problem would be greatly appreciated.

You — 03.01.2024 11:39
Please give us some time to check and we'll get back to you asap.

gif jpg mp3 mp4 pdf png txt

BBcode allowed Markdown allowed Emoticon to Smiley replacement enabled — also try :hacker: :big: :bigger:

HINT — SORRY, IT'S ONLY A DEMO: No File-Uploads allowed and Demo data can not be deleted!