I wanted to set up a Node with ERPNext. The credentials get accepted but it does not display any DocType.
In the Documentation it says there sould be many options for Doctypes.
If i try with the default DocType “Customer” i get the following error:
Please fix them before executing:
ERPNext2: Parameter “DocType Name or ID” is required.
When i enter the Doctype “Customer” into Expression i get the following error:
ypeError: Cannot read properties of undefined (reading ‘length’)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ERPNext/ERPNext.node.js:123:52)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:598:51)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:557:68
at processTicksAndRejections (node:internal/process/task_queues:96:5)
So the dropdown isn’t showing any data? or just not the one you need?
If the dropdown doesn’t show any data the server can probably not be reached or the authentication is not correct. The logs should show you what is going on if that is the issue.
If you select the 3 dots next to Fixed and Select Refresh List does it pull them in? Does the user account for the API token have access to everything you want to access as well? It would be interesting to see what the logs for ERP Next say and if they show the connection attempt.
It looks like the log files might exist under ~/frappe-bench/logs already. Are you able to share the compose file / docker run command you used to set up ERP Next or if it is available to the public can you DM me some test credentials so I can test against your environment?
/home/frappe-user/frappe-bench/apps/frappe/frappe/database/query.py:197: UserWarning: The ‘filters_config’ hook used to add custom operators is not yet implemented in frappe.db.query engine. Use db_query (frapp>
warn(
web.log ist empty
according to this you need to enable the API logs but i dont get where i have to enter these commands
That looks like it might actually be if you were making your own app that sits inside ERPNext. As a test can you run the below workflow and see if it returns anything? It should be doing the same thing as the node but we will be able to see the response.
When sending the response back make sure you remove anything sensitive, To use it open the Set node and replace the 3 values for Host, API Key and API Secret.
Thank you. As far as i understand i created the site and from there i installed the ERPNext App.
when refering to http://192.168.200.216/app. this should be the right domain. When entering the API credentials in n8n it confirmed them to be working. this is also the url i can access ERPNext directly.
Error
HTTP Code
rejected
Cause
Data below may contain sensitive information. Proceed with caution when sharing.
{
“status”: “rejected”,
“reason”: {
“message”: “404 - “\n\n404 Not Found\n\n
Not Found
\n
The requested URL was not found on this server.
\n\nApache/2.4.38 (Debian) Server at 192.168.200.216 Port 80\n\n””,
“name”: “Error”,
“stack”: “Error: Request failed with status code 404 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”
}
}
Stack
NodeApiError: UNKNOWN ERROR - check the detailed error for more information
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/HttpRequest.node.js:1025:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:598:28)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:557:53
Cause
Data below may contain sensitive information. Proceed with caution when sharing.
{
“status”: “rejected”,
“reason”: {
“message”: “503 - {“code”:503,“success”:false,“message”:“API server disabled”,“time”:0}”,
“name”: “Error”,
“stack”: “Error: Request failed with status code 503 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”
}
}
Stack
NodeApiError: UNKNOWN ERROR - check the detailed error for more information
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/HttpRequest.node.js:1025:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:598:28)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:557:53
That is interesting, So in theory unless you have it installed in an app folder it should be the second address. Looking at the error it looks like something needs to be enabled in ERP Next for it to work.
Did you check the API server is enabled in ERPNext? Looking at the errors one is saying the URL is not found (this happens when using /app) and the other contains a message from ERP Next which says “API server disabled”.
I don’t think this is an issue with there api as such and is more likely to be a configuration issue, I can’t see an option in the ERP Next docs to enable an API server though so maybe the right question could be… how do I enable the api.
I´m Having the same issues as mentioned before, i used this code on my n8n and it did work. What should i do next to get those dropdown menus working? Could you help me?
I am a bit confused is it working or is it not working? If you are getting the same error message it would be worth checking to see if you need to enable the API in ERPNext.
Hello, @Jon
I’m using ERPnext v14 and I’m having the same issue of not being able to pull the list in the N8N node.
I did some tests here and found that:
Yes, on the ERPnext side, you need System User authorization on the user account to gain access. By having this role, access to the api is confirmed.
But on this side of the N8N, when using your workflow to test, it returns the message that it does not recognize the JSON and asks you to change it to Strings. Once changed just that, it returns correctly.