Error generating e-Invoice

Hi
I have configured the GST E-Invoice. I am Running ERP Next software from localhost Server.

When I am Submitting the Sales invoice During E-Invoice Generation shows following error.

ERROR:

Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
request.js:457 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 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/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 “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 715, in urlopen
httplib_response = self._make_request(
File “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 404, in _make_request
self._validate_conn(conn)
File “env/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 1058, in _validate_conn
conn.connect()
File “env/lib/python3.10/site-packages/urllib3/connection.py”, line 363, in connect
self.sock = 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.HTTPSConnection object at 0x7fd9bc20f310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

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 799, 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: HTTPSConnectionPool(host=‘asp.resilient.tech’, port=443): Max retries exceeded with url: /ei/api/invoice (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7fd9bc20f310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 161, in _make_request
raise e
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 131, in _make_request
response = requests.request(method, **request_args)
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: HTTPSConnectionPool(host=‘asp.resilient.tech’, port=443): Max retries exceeded with url: /ei/api/invoice (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7fd9bc20f310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 95, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 47, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1608, in call
return fn(*args, **newargs)
File “apps/india_compliance/india_compliance/gst_india/utils/e_invoice.py”, line 191, in generate_e_invoice
raise e
File “apps/india_compliance/india_compliance/gst_india/utils/e_invoice.py”, line 128, in generate_e_invoice
result = api.generate_irn(data)
File “apps/india_compliance/india_compliance/gst_india/api_classes/e_invoice.py”, line 77, in generate_irn
result = self.post(endpoint=“invoice”, json=data)
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 81, in post
return self._make_request(“POST”, *args, **kwargs)
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 164, in _make_request
log.output = response_json.copy()
AttributeError: ‘NoneType’ object has no attribute ‘copy’

Please any one help me on this. I tried Reinstalling the APP but it doesn’t works

Hello,

Your local server may not be connected to the internet and hence is not capable of being used for features that require internet connectivity - in your case generating the e-Invoice (these features require communication with the Govt. APIs).

Specifically, the DNS resolution is not happening as expected.

Hello @snv

Thanks for your reply.

My system is connected with Internet and I am browsing it. Any other issues?

Hello,

Try this command in your terminal once, to ascertain if the DNS records are being received. If the command does not revert with one or more IP addresses, your DNS configuration may need fixing.

dig a +short asp.resilient.tech

You can also try resolving the DNS records of erpnext.com for comparison:

dig a +short erpnext.com

Hello,
I used the following command

dig a +short asp.resilient.tech

following is result

Also I Need to Clarify that I have Credit of 0 in my India Compliance Account. Whether above error is because of this credit.

Hello,

This means that your DNS servers are not configured correctly. Try this guide:

This is a separate issue. If you’re using sandbox mode, you don’t need credits. Otherwise, you may be required to make a purchase.

Hello,

DNS Issue has been resolved and Working now. But Showing no Credits.

As you said I have set the Checkbox Sandbox Mode enabled and Triggered E-Invoice from Sales invoice. It generated successfully.
Sand Box Mode is for Testing API right. It won’t generate bill in E-Invoice Portal.
because I couldn’t receive IRN number while using Sandbox Mode.

Yes. Sandbox mode is only for testing. If you need to generate a real e-Invoice, please consider purchasing API credits.

Note: India Compliance API is freely available on Frappe Cloud.

Hello
Thank you very much