python flask app cannot connect to mLab
I've got a domain from Godaddy and at the same time I've also got its Cpanel web hosting.
I have a flask app, and I'm using mLab as a database, and here's how I connect to the database in code:
I could manage to create a new python application on Cpanel:
when I check my domain, let say mydomain.com, my website is there, but the app couldn't connect to the database.
i checked logs, I've got this error:
[CODE=python]dsxxxxxx.mlab.com:xxxxx: [Errno 111] Connection refused, Timeout: 30s, Topology Description: ]>
and one more question, is it possible to have and use MongoDB in Cpanel? I need to say that I don't have enough knowledge of Cpanel, but I'm trying to deploy my website there. I really hope someone here can help me with this regard :)
and one more question, is it possible to have and use MongoDB in Cpanel? I need to say that I don't have enough knowledge of Cpanel, but I'm trying to deploy my website there. I really hope someone here can help me with this regard :)
-
Hey there! For the connection issue, you may want to try that work with the server's firewall disabled, as there wouldn't be anything on the cPanel side of things that keeps that from connecting properly. MongoDB is not something that is currently supported by cPanel, and due to the way the product is licensed at this time, we aren't looking to include that in a future release. You can find more details on that here: 0 -
Hey there! For the connection issue, you may want to try that work with the server's firewall disabled, as there wouldn't be anything on the cPanel side of things that keeps that from connecting properly. MongoDB is not something that is currently supported by cPanel, and due to the way the product is licensed at this time, we aren't looking to include that in a future release. You can find more details on that here:
0 -
There isn't a reason you would need to install CSF, although many people find that it makes managing the firewall on the system easier since it provides an interface in WHM that works with the firewall. Are you able to reach the mlab.com connection from outside your code? You could try digging that domain from the server, or you could try connecting with a telnet session if the code uses a custom port, just to see if the basic connection is working at all. 0 -
There isn't a reason you would need to install CSF, although many people find that it makes managing the firewall on the system easier since it provides an interface in WHM that works with the firewall. Are you able to reach the mlab.com connection from outside your code? You could try digging that domain from the server, or you could try connecting with a telnet session if the code uses a custom port, just to see if the basic connection is working at all.
Yes, mlab connection is working. and I checked again, I don't have root access, and contacted GoDaddy and asked them to give me root access, but they said my hosting plan should be either vps or dedicated. my current plan is delux.0 -
and i have a question, is it possible to use firebase instead? 0 -
Without root access there isn't going to be any troubleshooting you can do with the firewall level. I would expect Firebase to work in a similar fashion where you can connect to it remotely, although Google does provide entire hosting solutions based around Firebase as well. 0
Please sign in to leave a comment.
Comments
8 comments