Hello Guys,
I have an immediate requirement from my client to use the E-Invoicing feature in ERPNext.
The application is a self-hosted on Linux Server, Ubuntu v20.04 with the following below version:
ERPNext: v13.40.3 (version-13)
Frappe Framework: v13.42.0 (version-13)
I have followed the official documentation and have setup accordingly.
Documentation Link: E-Invoicing under GST
But after the setup, when I tried to generate the IRN, the system is giving me 3 different errors.
I addition to this when I searched through forum, I found something from the below links that we need to signup in Adaequare, wherein we will be provided with the information on how to setup an app and get the Client ID and Client Secret.
How to setup E-Invoicing
[E-Invoicing][India][Guide] Setup Adequare GSP’s E-Invoicing Services in ERPNext
Can anyone please let me know the link to the Adaequare site, and also would like to know if there is any charges related to their services.
If anyone has setup E-Invoicing successfully on v13, please help me with this issue. Also the steps which you have followed to achieve it.
Below are the errors that I got from the Error Log.
Error 1:
Error
'NoneType' object has no attribute 'get'
----------------------------------------------------------------------------------------------------
Data:
null
----------------------------------------------------------------------------------------------------
Exception:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 900, in make_request
res = make_post_request(url, headers=headers, data=data)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 42, in make_post_request
return make_request("POST", url, **kwargs)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 34, in make_request
raise exc
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 26, in make_request
frappe.flags.integration_request.raise_for_status()
File "/home/medtrix-frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: https://gsp.adaequare.com/gsp/authenticate?grant_type=token
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 946, in fetch_auth_token
res.get("token_type"), res.get("access_token")
AttributeError: 'NoneType' object has no attribute 'get'
Error 2:
Error
An error occurred while making e-invoicing request. Please check <a href="/app/error-log" target="_blank">Error Log</a> for more information.
----------------------------------------------------------------------------------------------------
Data:
{}
----------------------------------------------------------------------------------------------------
Exception:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 900, in make_request
res = make_post_request(url, headers=headers, data=data)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 42, in make_post_request
return make_request("POST", url, **kwargs)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 34, in make_request
raise exc
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 26, in make_request
frappe.flags.integration_request.raise_for_status()
File "/home/medtrix-frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: https://gsp.adaequare.com/gsp/authenticate?grant_type=token
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 946, in fetch_auth_token
res.get("token_type"), res.get("access_token")
AttributeError: 'NoneType' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 944, in fetch_auth_token
res = self.make_request("post", self.authenticate_url, headers)
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 906, in make_request
self.auto_refresh_token()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 915, in auto_refresh_token
self.fetch_auth_token()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 954, in fetch_auth_token
self.raise_error(True)
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 1366, in raise_error
frappe.msgprint(
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 479, in msgprint
_raise_exception()
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 436, in _raise_exception
raise ValidationError(msg)
frappe.exceptions.ValidationError: An error occurred while making e-invoicing request. Please check <a href="/app/error-log" target="_blank">Error Log</a> for more information.
Error 3:
Error
An error occurred while making e-invoicing request. Please check <a href="/app/error-log" target="_blank">Error Log</a> for more information.
----------------------------------------------------------------------------------------------------
Data:
{}
----------------------------------------------------------------------------------------------------
Exception:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 900, in make_request
res = make_post_request(url, headers=headers, data=data)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 42, in make_post_request
return make_request("POST", url, **kwargs)
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 34, in make_request
raise exc
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 26, in make_request
frappe.flags.integration_request.raise_for_status()
File "/home/medtrix-frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: https://gsp.adaequare.com/gsp/authenticate?grant_type=token
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 946, in fetch_auth_token
res.get("token_type"), res.get("access_token")
AttributeError: 'NoneType' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 944, in fetch_auth_token
res = self.make_request("post", self.authenticate_url, headers)
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 906, in make_request
self.auto_refresh_token()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 915, in auto_refresh_token
self.fetch_auth_token()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 954, in fetch_auth_token
self.raise_error(True)
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 1366, in raise_error
frappe.msgprint(
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 479, in msgprint
_raise_exception()
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 436, in _raise_exception
raise ValidationError(msg)
frappe.exceptions.ValidationError: An error occurred while making e-invoicing request. Please check <a href="/app/error-log" target="_blank">Error Log</a> for more information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 1002, in generate_irn
headers = self.get_headers()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 962, in get_headers
"authorization": self.get_auth_token(),
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 892, in get_auth_token
self.fetch_auth_token()
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 954, in fetch_auth_token
self.raise_error(True)
File "/home/medtrix-frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 1366, in raise_error
frappe.msgprint(
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 479, in msgprint
_raise_exception()
File "/home/medtrix-frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 436, in _raise_exception
raise ValidationError(msg)
frappe.exceptions.ValidationError: An error occurred while making e-invoicing request. Please check <a href="/app/error-log" target="_blank">Error Log</a> for more information.
Thanks & Regards,
Sujay