N8n files corrupted - Docker container keeps restarting after power outage — "command start not found" error

Hi,

I’m running n8n in a Docker container on a local Linux server. After an abrubt power outage, my n8n container now repeatedly restarts every ~30 seconds. When I check the logs using docker logs n8n, I see repeated errors like:

makefile

CopyEdit

Error: command start not found

task: findCommand (start)

plugin: n8n

message: Invalid or unexpected token

There’s also a warning about .n8n/config permissions being too wide (0644), but I believe that’s not the root cause.

The container image was originally pulled from a private registry and it’s possible the image or file system got corrupted due to the abrupt shutdown.

Questions:

  1. What is the root cause of the command start not found error in n8n?
  2. Is there a way to repair the container or fix the corrupted CLI metadata?
  3. After backing up .n8n, is it safe to recreate the container using the official n8nio/n8n:latest image and mount the backup?
  4. Any suggestions to prevent this in future (e.g. better backup/volume strategies)?

Thanks in advance!

Having been through this (or similar) a few times, I would recommend the following actions before anything else.

  • Shut down / stop the n8n container and get a complete backup of the database. For instance, if you are using postgres, use pgdump to export everything. This will give you the best chance of restoring things later, regardless of what else you try.
  • Find and save a copy of the “encryption-key.” This may be in the .n8n/config file, or it could have been specified as an environment variable.
  • Find out what version of n8n you were previously running, and get things working again on the same version instead of updating to a newer version yet. Each version of n8n makes changes to the database through “migrations” so staying with the same version will help eliminate other things that could go wrong.

Good luck. Hope you are able to recover. When you get things running again, one of the things you can do to mitigate future loss is to set up a workflow from one of the templates to automatically back up workflows to a github repository or a gitlab repository.

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