Application n8n won't start

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.21.2 (stable).
I have access to my server : through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
Not exactly yunohost but I have AMP panel by Cubecoders installed at the same time one the same VPS

Description of my issue

After restarting my vps, 2 of my applications stopped working(n8n and zipline) for no reason. When i try to go their page, it just sends me back to webadmin. I reinstalled zipline and it works fine, but I don’t want to reinstall n8n, because im scared ill lose my files. When I try too boot up n8n it can’t. Here are logs from n8n:
https://paste.yunohost.org/onulesecaf

Failed to locate executable /var/www/n8n/node_modules/n8n/bin/n8n: Permission denied

mokay so let’s check if it exists with sudo ls -l /var/www/n8n/node_modules/n8n/bin/n8n and what are the permissions with sudo namei -l /var/www/n8n/node_modules/n8n/bin/n8n

sudo ls -l /var/www/n8n/node_modules/n8n/bin/n8n:
-rw-r–r-- 1 www-data www-data 1584 Jul 12 16:23 /var/www/n8n/node_modules/n8n/bin/n8n

Permissions:
f: /var/www/n8n/node_modules/n8n/bin/n8n
drwxr-xr-x root root /
drwxr-xr-x root root var
drwxr-xr-x www-data www-data www
drwxr-xr-x www-data www-data n8n
drwxr-xr-x www-data www-data node_modules
drwxr-xr-x www-data www-data n8n
drwxr-xr-x www-data www-data bin
-rw-r–r-- www-data www-data n8n

Mokay, it really look like someone or something ran a recursive chown -R www-data on the entire /var/www/ directory … does that mean anything to you or …?

Yeah, i had a problem with not being able to access /var/www with sftp, read on this forum to do this :confused: , is there a way to fix that?

Yes and no … you can’t just “undo” the operation because each file/folder could have specific ownership and not just www-data, and there’s no simple way apriori to know what what the owner of each file or directory …

However, in the current case each /var/www/$app is often owned by $app (recursively I suppose)

So for n8n maybe running sudo chown -R n8n /var/www/n8n and restarting the corresponding service with systemctl restart n8n can fix the issue and maybe similar stuff for other apps

But yeah, running a chown recursively on the entire /var/www clearly ain’t a good idea

Sadly, n8n still won’t start, same error https://paste.yunohost.org/uvuciqewic .

I’m kinda confused because on that forum everyone said it helped them.

Can you point to the exact post ?

Mokay so let’s look again at the output of sudo namei -l /var/www/n8n/node_modules/n8n/bin/n8n

I will try to find it

f: /var/www/n8n/node_modules/n8n/bin/n8n
drwxr-xr-x root     root     /
drwxr-xr-x root     root     var
drwxr-xr-x www-data www-data www
drwxr-xr-x n8n      www-data n8n
drwxr-xr-x n8n      www-data node_modules
drwxr-xr-x n8n      www-data n8n
drwxr-xr-x n8n      www-data bin
-rw-r--r-- n8n      www-data n8n

Ah yes I see, you also need to chmod +x /var/www/n8n/node_modules/n8n/bin/n8n … which tends to say that you also ran a recursive chmod in addition to the chown … which is less straightforward to fix than the ownership … but at least for this specific case the chmod +x on n8n might unlock this specific situation …

Thank you so much! It works now, and you saved me hours, and hours of work :smile: . I will do my backups now :slight_smile:

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