Hi,
I have created one custom doctype in frappe, and I have created on webhook it will be post operation on the external endpoint which is created on flask.
on_insert of record in frappe it should trigger webhook which will talk to external end point. I’m getting below mentioned response from the webhook, and it is not hitting the endpoint created in flask.
"Traceback (most recent call last):
File “env/lib/python3.10/site-packages/urllib3/connection.py”, line 174, in _new_conn
conn = connection.create_connection(
File “env/lib/python3.10/site-packages/urllib3/util/connection.py”, line 95, in create_connection
raise err
File “env/lib/python3.10/site-packages/urllib3/util/connection.py”, line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 714, in urlopen
httplib_response = self._make_request(
File “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 415, in _make_request
conn.request(method, url, **httplib_request_kw)
File “env/lib/python3.10/site-packages/urllib3/connection.py”, line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/lib/python3.10/http/client.py”, line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.10/http/client.py”, line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.10/http/client.py”, line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.10/http/client.py”, line 1037, in _send_output
self.send(msg)
File “/usr/lib/python3.10/http/client.py”, line 975, in send
self.connect()
File “env/lib/python3.10/site-packages/urllib3/connection.py”, line 205, in connect
conn = self._new_conn()
File “env/lib/python3.10/site-packages/urllib3/connection.py”, line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError:
<urllib3.connection.HTTPConnection object at 0x7f5e42a2f5e0>:
Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “env/lib/python3.10/site-packages/requests/adapters.py”, line 486, in send
resp = conn.urlopen(
File “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 798, in urlopen
retries = retries.increment(
File “env/lib/python3.10/site-packages/urllib3/util/retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError:
HTTPConnectionPool(host=‘127.0.0.1’, port=5000): Max retries exceeded
with url: /webhook (Caused by
NewConnectionError(‘<urllib3.connection.HTTPConnection object at
0x7f5e42a2f5e0>: Failed to establish a new connection: [Errno 111]
Connection refused’))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/frappe/frappe/integrations/doctype/webhook/webhook.py”, line 122, in enqueue_webhook
r = requests.request(
File “env/lib/python3.10/site-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “env/lib/python3.10/site-packages/requests/sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
File “env/lib/python3.10/site-packages/requests/sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
File “env/lib/python3.10/site-packages/requests/adapters.py”, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError:
HTTPConnectionPool(host=‘127.0.0.1’, port=5000): Max retries exceeded
with url: /webhook (Caused by
NewConnectionError(‘<urllib3.connection.HTTPConnection object at
0x7f5e42a2f5e0>: Failed to establish a new connection: [Errno 111]
Connection refused’))"
Thanks,
Praajna