pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘mariadb’ ([Errno -3] Temporary failure in name resolution)”)
I’m facing an a issue while runing the erpnext13 in my local below i attache the error logs
172.18.0.1 - - [06/Feb/2023 10:36:22] "POST /api/method/frappe.desk.reportview.get HTTP/1.1" 500 -
Traceback (most recent call last):
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 613, in connect
sock = socket.create_connection(
File "/home/frappe/.pyenv/versions/3.10.5/lib/python3.10/socket.py", line 824, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/home/frappe/.pyenv/versions/3.10.5/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/development/frappe-bench/apps/frappe/frappe/middlewares.py", line 18, in __call__
return super(StaticDataMiddleware, self).__call__(environ, start_response)
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
return self.app(environ, start_response)
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
return self.app(environ, start_response)
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/werkzeug/local.py", line 231, in application
return ClosingIterator(app(environ, start_response), self.cleanup)
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/werkzeug/wrappers/base_request.py", line 237, in application
resp = f(*args[:-2] + (request,))
File "/workspace/development/frappe-bench/apps/frappe/frappe/app.py", line 97, in application
frappe.db.rollback()
File "/workspace/development/frappe-bench/apps/frappe/frappe/database/database.py", line 953, in rollback
self.sql("rollback")
File "/workspace/development/frappe-bench/apps/frappe/frappe/database/database.py", line 161, in sql
self.connect()
File "/workspace/development/frappe-bench/apps/frappe/frappe/database/database.py", line 85, in connect
self._conn = self.get_connection()
File "/workspace/development/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 76, in get_connection
conn = pymysql.connect(
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 353, in __init__
self.connect()
File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 664, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'mariadb' ([Errno -3] Temporary failure in name resolution)")
After that I realised the docker container maridb was not running. then i restart the project for once again. it’s working after 30sec it’s automatically stopped.
Then I restarted the container. using this command
docker restart <CONTAINER_ID>
after a 30sec again the container stopped. Please help me to resolve the issue
Here a reference topic i had already created for the same issue CLICK HERE