N8n schedules never run, under any configuration

Describe the problem/error/question

When setting up a workflow with a schedule, it fails to run.
Hitting “Execute Workflow” results in it executing forever, and waiting for the trigger causes nothing to happen.

What is the error message (if any)?

None in the UI, n8n logs on the host say TypeError: moment_1.default.tz is not a function

Initializing n8n process
n8n ready on 0.0.0.0, port 5678
Version: 1.20.0
 ================================
   Start Active Workflows:
 ================================
   - "Schedule Test" (ID: P91zxoprlGpgjJbg)
     => Started

Editor is now accessible via:
http://localhost:5678/

Press "o" to open in Browser.
TypeError: moment_1.default.tz is not a function

Please share your workflow

Information on your n8n setup

  • n8n version: 1.20.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 22.04

I installed this simply by following the guide, and running npm install -g n8n then running n8n start

Is there any way to resolve this?
Simple stuff I tried isn’t working and it’s a brand new, clean install this is running on

Hi @ksaredfx, I am sorry you’re having trouble. This sounds like your n8n instance can’t access the expected functions provided by moment.js on your system.

May I suggest switching to the docker version of n8n here? Unlike the npm version, this packs all required dependencies in a single docker image, and as such should work regardless of the bare metal environment. You can find deployment information at Docker | n8n Docs

Hey! While I’d love to swap to docker containers, this particular fleet is using lxc containers instead. While they’re essentially the same thing as docker, they unfortunately aren’t interchangeable, nor can I just run docker inside one due to privilege limitations and I’m trying to build what essentially is a docker container for lxc…

I also tried n8n 1.22.1 and 1.20.0 with no luck :frowning:
Strangely enough, moment and moment-timezone are also both within the node_modules/n8n/node_modules folder…

This is a clean install of n8n via npm install -g n8n; Are the docker containers built in some other specific way that I could replicate?

Are npm installs just unsupported at this point?

Edit: npx also does not work

$ npx n8n
Initializing n8n process
n8n ready on 0.0.0.0, port 5678
Version: 1.20.0
 ================================
   Start Active Workflows:
 ================================
   - "Schedule Test" (ID: P91zxoprlGpgjJbg)
     => Started

Editor is now accessible via:
http://localhost:5678/

Press "o" to open in Browser.
TypeError: moment_1.default.tz is not a function
TypeError: moment_1.default.tz is not a function

Testing the install with yarn produces the same results…

I am having the very same error since this morning after upgrading the docker image from 1.22.1 to 1.22.3. For approx. 6 month I am upgrading to every version with renovate. This has never happened before.
All my scheduled workflows are not executed anymore, not even on manual runs. After downgrading to 1.22.1 the schedule is executed as expected.

Continuing this thread as I think this needs more awareness.

I didn’t have any issues when I set up n8n on my Windows device last month. Someone else I know who just installed n8n within the last week was getting this same error. I tried troubleshooting a number of things but had no luck helping them. I decided to update my version to 1.21.1 from 1.20.0 and I started getting this issue as well. I tried downgrading the install back to 1.20.0 but sadly still ran into the error. I then decided to uninstall n8n completely, delete my node_modules and other associated folders and had no success upon reinstalling. I then decided to uninstall n8n and node.js completely and reinstall and I still get the same error. I am speculating that there is a dependency update that is causing this error.

Again the error prevents any Timer trigger from executing and produces:
“TypeError: moment_1.default.tz is not a function” in the CLI.

When using the manual trigger to kickstart the workflow works fine.
image

Same issue for me: TypeError: moment_1.default.tz is not a function and no schedule triggers working, whatever I try. Used multiple versions, latest version tried 1.22.3. Downgrading to 1.22.1 as @vqu suggested does not work for me.

Seems to be fixed in 1.22.4: 1.22.3 scheduled job not running · Issue #8184 · n8n-io/n8n · GitHub

2 Likes

Can confirm. I installed it 1.22.4 and the scheduling works fine. Thanks!

Also confirmed, thanks!

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