Error: Command "worker" not found

I’ve been running n8n for a while in Kubernetes. I’m trying to switch to queue/worker mode. The main pod starts OK with this

      containers:
        - name: n8n
          image: docker.n8n.io/n8nio/n8n:1.107.4
          imagePullPolicy: IfNotPresent
          command: ["/usr/local/bin/n8n"]

but the worker pods will not start with this, or anything else I try

      containers:
        - name: n8n-worker
          image: docker.n8n.io/n8nio/n8n:1.107.4
          imagePullPolicy: IfNotPresent
          command: ["/usr/local/bin/n8n","worker"]

It generates this error

Error: Command "worker" not found

This appears to be being generated by n8n here - n8n/packages/cli/src/command-registry.ts at master · n8n-io/n8n · GitHub

I’ve tried lots of different formats and still get the same error.

Any help greatly appreciated!

Hey @matt_1234 welcome to the community.

The issue might be related to the command format or the image version. Try updating the command in the worker pod to:

containers:

Notice the difference in the command format. Instead of `“/usr/local/bin/n8n”,“worker”`, try using `“n8n”, “worker”`.

Hey @Zelite

Thanks for taking the time to respond. I’ve tried the following but still with the same result

          command: ["n8n","worker"]
          command: ["n8n"]
          args: ["worker"]
          command: ["/usr/local/bin/docker-entrypoint.sh"]
          args: ["n8n", "worker"]

If I change the workers to

command: ["n8n","start"]

they do start up then, but things don’t work properly

Hey @Zelite

Sorry to waste your time. It looks like this error was actually caused by an issue with my postrges setup. When moving to queue mode I also implemented postgres for the DB and there was something wrong with that part of the config. The error about worker not found was throwing me off. I’ve now got the main pod and worker pods going too

Good to here that bud

Since you resolved the problem kindly mark thsi as the solution to help others.