ERP Next Doctype Dropdown missing

Hi,

i really love n8n so far.

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)

Running n8n in Docker and ERPNext selfhosted

Best Reagards

Hi @tec4

Welcome to the community!

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.

1 Like

Hey @tec4,

Welcome to the community :tada:

I am just trying to work out how to get ERP Next running in Docker, Once I have it working I will take a look and get back to you.

2 Likes

Hey @tec4,

It took a while but I finally have ERPNext running, It looks like when I click on the dropdown though I am getting a lot of items back.

image

What versions of n8n and ERPNext are you using?

Hi @Jon,

my Versions are:

ERPNext: v14.0.2 (version-14)

Frappe Framework: v14.4.1 (version-14)

n8n Version 0.193.3

ERPNext is installed on a Ubuntu Host

n8n ist running in Docker.

Hey @tec4,

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.

i tried to refresh but nothing happens. The user i generated the API token with has admin rights.

i looked up how to get logs from the api in ERPNext but i dont really understand where to run these commands: link

Hey @tec4,

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?

hi @Jon ,

i checked all .log in the directory but nothing about api calls as far as i can tell.

i run the ERPNext on a Ubuntu host no Docker here only for n8n.

i used this Guide to install ERPNext

Hey @tec4,

Does web.log or web.error.log show the connection coming in?

web.error.log has this error very often:

/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 :frowning:

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

if i change to http://192.168.200.216/

Error

HTTP Code

rejected

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

Hey @tec4,

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.

Hey @tec4,

I have the same problem.

Credentials give success. /app

Did you manage to solve it?

hey @Vinicius_Teotonio_Gu ,

sadly i did not manage to solve it.

i created a thread on the ERPNext Forum as it seem not to be a n8n problem.

but unfortunately i didt get much help there

Hey @tec4,

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.