This page looks best with JavaScript enabled

How to fix Rudder error while attempting send and run n8n during boot

 ·  ☕ 2 min read  ·  🐧 sysadmin

How to solve the below problem:

[Rudder] error: got error while attempting send for 3 times, dropping 3 events

By default, a self-hosted n8n instance sends data to n8n’s servers. This allows n8n to send users notifications about available updates, allows access to workflow templates, and provides n8n with diagnostic information.

If you need to prevent your n8n instance from connecting with n8n’s servers, use environment variables to turn off the settings that cause your instance to connect with n8n’s servers.

Turn off diagnostics, notifications, and workflow templates.

You have to create .env file inside .n8n directory

1
vim /home/$USER/.n8n/.env

and paste the below content

1
2
3
N8N_DIAGNOSTICS_ENABLED=false
N8N_VERSION_NOTIFICATIONS_ENABLED=false
N8N_TEMPLATES_ENABLED=false

Save and exit.

Restart n8n

Source: Isolating n8n

How to start n8n during boot?

Create a script:

1
vim /home/$USER/start-n8n.sh

Paste the below content:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/bin/bash

# Start n8n in a detached screen session
screen -dmS n8n bash -c "npx n8n"

# Wait for a bit to ensure n8n is up and running
sleep 10

# Use xdotool commands within the same screen session
# Assuming xdotool commands are meant to interact with n8n
screen -S n8n -X stuff $'xdotool key ctrl+a\nxdotool key ctrl+d\nexit\n'

Save and exit.

Install xdotool
1
sudo apt install xdotool -y
Make the script executable:
1
chomod +x start-n8n.sh

Add the script to crontab:

1
crontab -e

Add the below entry:

1
@reboot /home/$USER/start-n8n.sh

Save and exit.

Run the script
1
2
cd ~
./start-n8n.sh

Done, great work.

Share on

sysadmin
WRITTEN BY
sysadmin
QA & Linux Specialist