n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
45.79k stars 6.4k forks source link

If you try to give nodes the same name, the application hangs and there is no error. #917

Closed dima-takoy-zz closed 3 years ago

dima-takoy-zz commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a node named "node 1"
  2. Create a node and name it "node 1"
  3. n8n interface completely hungs. And when I try to open the workflow again, the situation repeats.

Expected behavior I want to see a warning or error.

Environment (please complete the following information):

janober commented 4 years ago

Very strange. I am not able to reproduce that. For me, it does simply not allow that. If I create "node 1" then create a second node that I also call "node 1" it then automatically changes it to "node". If I then create another node and rename that one to "node 1" it then automatically changes the name of that node to "node2".

Are there any other things required to reproduce that?

dima-takoy-zz commented 4 years ago

This happens when I click on the check.

After that the process takes 100% of CPU

Screenshot 2020-09-02 at 17 37 01
dima-takoy-zz commented 4 years ago

It is strange. This does not happen in the test workflow. In mine, it happens. I will try to prepare a more reproducible example.

janober commented 4 years ago

Thanks a lot. That would be great. As soon as we can reproduce it (must be some kind of edge case) it will be much easier to fix.

dima-takoy-zz commented 4 years ago

Yeah, the error occurs if I give a node name in a language other than English. To reproduce the error in a test workflow you should try to rename a node several times but In my workflow, the error occurs immediately.

Way to reproduce

  1. Copy name "Функция"
  2. Rename node Function1 → Функция (Notice the name became NaN)
  3. Rename node NaN → Функция
  4. hang here
{
  "name": "BUG",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {},
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {},
      "name": "Функция",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Функция",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Функция": {
      "main": [
        [
          {
            "node": "Function1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "8"
}
dima-takoy-zz commented 4 years ago

Relevant error.

If you copy a node with a Cyrillic(maybe any non latin) name then we get NaN instead of the name + number.

krynble commented 3 years ago

Thanks for reporting this @mecurc

I was looking into this issue and managed to both reproduce and fix it. Here is a link to the PR: https://github.com/n8n-io/n8n/pull/1429

Closing it now. Feel free to reopen or report any other issues.

janober commented 3 years ago

Got released with n8n@0.108.0