Duplicate entries in mysql for no reason

Hi Everyone,

I am facing this issue randomly with no reason sometimes it works great sometime it just happens and no matter if i create duplicate workflow or copy nodes to new one it doesn’t goes away:

Describe the issue/error/question

The workflow portion i have pasted below, you can see, it has 2 insert nodes which are inserting data properly, but after everything is done somehow it inserts same data again(as duplicate entry).
This is totally random sometimes twice and sometime thrice.

have tried various scenarios connecting and removing various nodes but I can’t understand the logic why it would happen.

I even enabled execute once on both mysql nodes still no use.
duplicates get created in the table.

I created a screen record to describe the issue:

What is the error message (if any)?

No errors at all.

Please share the workflow

Share the output returned by the last node

Everything is just fine and it give me insert id and other information

Information on your n8n setup

  • n8n version: 0.196.0
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm

After lot of hit and trial connection and disconnection it pinpointed the issue at http node, if i remove the http node one step before the previous workflow portion i shared, it works wonderfully, but of course http node is a must have.

Why would a http node trigger unwanted mysql query ?

If i disconnect the Http node and join the workflow directly to other mysql nodes it creates normal entry but no duplicate.

Hi @mayanktiwari, I am sorry to hear you’re having trouble. Tbh I can’t see how the HTTP Request node would cause the behaviour you have reported but perhaps I am missing something here. I tried reproducing your problem using the below docker compose setup:

version: '2'
    image: n8nio/n8n:0.196.0
      - 5678:5678
      - ./n8n_data:/home/node/.n8n

    image: docker.io/library/mariadb:10.9
      - 3306:3306
      - ./mysql_data:/var/lib/mysql

    image: adminer
      - 8080:8080

I have then executed the below workflow based on your description with an added HTTP Request node against two dummy tables:

However, both tables included only a single row as expected after doing so.

Perhaps you can share the smallest possible workflow using which this problem can be reproduced with a simplified MySQL database structure and no additional dependencies?

Hi @MutedJam
Thank you for putting effort,
actually the issue is that i am also not sure what has caused this, i shared a screencast video link also in which you can see the issue.

This is happening only sometimes, i have 10-20 workflows but only in 2 of them i faced this issue.

I checked n8n logs also there also everything is in order and matching with what happens on UI.
But still this issue occurs in some case.

we are using PM2 to run n8n.
Have set up a new instance of latest n8n to see if there is some issue in current version only.

i also tried to reproduce even using exact http request which i am using for original node and not getting the issue.

The nodes in use in overall workflow are
there is no other node is used.

This is the strangest issue i have faced ever, I have no idea how to reproduce it’s just happening and overall not making any sense to me. I even checked if there may be some hidden function or trigger implemented in the mysql but none is there.

@MutedJam we found out the issue and it was neither in n8n, or any of other elements like mysql, nginx etc.
It was another workflow which was updating the data from another webhook trigger,
as soon as the entry was getting created in hubspot it would trigger the webhook which in turn would trigger another workflow. we had to do a lot of trials to find out the issue exactly.

It was completely on our end.

Thank you for trying out and testing in order to help out.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.