frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.85k stars 7.33k forks source link

Connection Error: HTTPConnectionPool(host='****erp.krishiyog.in', port=80): Max retries exceeded with url / #39418

Closed agrVidushi closed 9 months ago

agrVidushi commented 10 months ago

Information about bug

Getting this error for connection as: ConnectionError at /orgs/items/ HTTPConnectionPool(host='****.erp.krishiyog.in', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f61944e9640>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Sometimes it is working and sometimes giving this error.

Module

stock

Version

12

Installation method

None

Relevant log output / Stack trace / Full Error Message.

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

During handling of the above exception ([Errno -2] Name or service not known), another exception occurred:
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(

During handling of the above exception (<urllib3.connection.HTTPConnection object at 0x7f61841edbe0>: Failed to establish a new connection: [Errno -2] Name or service not known), another exception occurred:
  File "/home/ubuntu/.local/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/home/ubuntu/.local/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))

During handling of the above exception (HTTPConnectionPool(host='demo-v3.erp.krishiyog.in', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f61841edbe0>: Failed to establish a new connection: [Errno -2] Name or service not known'))), another exception occurred:
  File "/home/ubuntu/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/ubuntu/.local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/ubuntu/kyapp-backend/kyapp/middleware/auth_validators.py", line 118, in wrap
    return f(request, *args, **kwargs)
  File "/home/ubuntu/kyapp-backend/kyapp/webapps/orgs/super_views.py", line 8435, in post
    client = get_client_for_org_id(request.query_params.get('org_id'))
  File "/home/ubuntu/kyapp-backend/kyapp/webapps/orgs/frappe_service.py", line 304, in get_client_for_org_id
    client = FrappeClient(url=old_org.site_url, username=ERP_NEXT_USERNAME, password=ERP_NEXT_PASSWORD)
  File "/home/ubuntu/kyapp-backend/kyapp/utils/frappeclient.py", line 45, in __init__
    self.login(username, password)
  File "/home/ubuntu/kyapp-backend/kyapp/utils/frappeclient.py", line 57, in login
    r = self.session.post(self.url, data={
  File "/home/ubuntu/.local/lib/python3.9/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
ankush commented 9 months ago

Not a bug. Something wrong with your deployment, hard to tell from this.