Forums

Unknown MySQL server host

Hi PA Team,

I have a notification sytem in place which checks for new notifications on a pre-determined interval. I have the application setup to email me of any errors and just received the following: (2005, "Unknown MySQL server host 'xdev.mysql.pythonanywhere-services.com' (0)"). I just checked my application and everything seems to be working fine, but I'm unsure of what I need to do to prevent this from occuring in the first place.

Any ideas on what would have caused this or what I can/should do to prevent this from happening?

Thanks for your help!

I just received this notification too. And my site is showing a server error (500).

That's strange -- where are you seeing those errors? Are they still happening? Can you connect to your databases from the PA Bash console as shown here?

From my error.log:

File "/home/absencelog/.virtualenvs/absencelog/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 179, in init super(Connection, self).init(args, *kwargs2) OperationalError: (2005, "Unknown MySQL server host 'absencelog.mysql.pythonanywhere-services.com' (0)")

This occurred suddenly last night (I haven't changed my code in many months). But this morning it seems to have resolved itself. I can connect to the database through the PA Bash console as well as through Sequel Pro on my local Mac. I don't know what happened last night, but I'm nervous that it will happen again.

Where am I seeing those errors? I've attached the traceback below but it has to do with my django app's sessions.

Are they still happening? After posting the first time, it occured another 5 times yesterday. I haven't seen it happen today.

Can you connect to your databases from the PA Bash console as shown here? Yes, and I verified it was working myself by logging into the site.


Traceback (most recent call last): File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/contrib/sessions/backends/base.py", line 233, in _get_session return self._session_cache

During handling of the above exception ('SessionStore' object has no attribute '_session_cache'), another exception occurred: File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection connection = Database.connect(**conn_params) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/MySQLdb/__init__.py", line 123, in Connect return Connection(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__ super().__init__(*args, **kwargs2)

The above exception ((2005, "Unknown MySQL server host 'xdev.mysql.pythonanywhere-services.com' (11)")) was the direct cause of the following exception: File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request)

Looks like some network glitch. We will have to investigate.

Great, thank you PA team!