Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting Executions do not work correctly when changing time zone #8548

Closed
directpromo opened this issue Feb 5, 2024 · 8 comments
Closed
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@directpromo
Copy link

directpromo commented Feb 5, 2024

Describe the bug
With the default time zone GMT 0, everything works correctly.

For time zones from GMT - 1 to GMT - 11 workflow freezes. In waiting status.

For time zones from GMT +1 to GMT +14 workflow goes to status successful within about 1 minute. Even if you need to wait for an hour or 5 minutes.

To Reproduce

  1. create a workflow for waiting
  2. set the time zone in the workflow settings
  3. run
  4. see the result in the executions
  5. repeat several times with different time zones

Environment:

  • OS: Ubuntu Linux 22.04
  • n8n Version 1.27.2
  • Database POSTGRES
  • EXECUTIONS_MODE=regular

Additional context
The bug also occurs if you set the timezone in .env via:
GENERIC_TIMEZONE=your time zone
TZ=your time zone

@Joffcom
Copy link
Member

Joffcom commented Feb 5, 2024

Hey @directpromo,

Just to check is this changing the timezone for a workflow that is already waiting or is this setting a timezone that is not GMT 0 then setting a wait?

@directpromo
Copy link
Author

directpromo commented Feb 5, 2024

Hi @Joffcom,

I don't quite understand the question.

I made a screencast. It shows this bug.

2024-02-05_n8n_wait_timezone.mp4

@Joffcom
Copy link
Member

Joffcom commented Feb 5, 2024

Hey @directpromo,

I have done a bit of testing and I managed to reproduce it as my database was still using the UTC timezone, I have not done a lot of testing around starting a new database with the correct timezone configuration but I do wonder if that is linked.

For now I have created an internal ticket which we will be tracking as PAY-1341.

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Feb 5, 2024
@stwonary
Copy link
Contributor

I am experiencing a similar issue with my workflows in n8n, particularly around the handling of different time zones. It seems there is a discrepancy in how workflows proceed or freeze based on the time zone settings, which mirrors the problem described.

To reproduce this issue, I've been using the following Docker Compose file:

version: '3.1'

services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    environment:
      - N8N_PROTOCOL=http
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - NODE_ENV=production
      - WEBHOOK_TUNNEL_URL=http://localhost:5678/
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=n8n
      - DB_POSTGRESDB_PASSWORD=password
    depends_on:
      - postgres

  postgres:
    image: postgres:16
    environment:
      - POSTGRES_DB=n8n
      - POSTGRES_USER=n8n
      - POSTGRES_PASSWORD=password
    ports:
      - "5432:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data

volumes:
  postgres-data:
image

And in my workflows, I've observed that a 3-minute Wait node is incorrectly storing timestamps in the database 5 hours in the future, potentially due to the default GENERIC_TIMEZONE setting, which is America/New_York (GMT-5).

I am running this with n8n version 1.29.1, utilizing a PostgreSQL database. The issue persists regardless of setting the time zone in the workflow settings or via the .env file using GENERIC_TIMEZONE and TZ variables.

Current time:
image

Workflow waitTill in database:

image

@stwonary
Copy link
Contributor

@Joffcom, I hope you find my findings useful. I have traced the bug back to version 1.25.0, and it may be related to this PR: #8340.

@Joffcom
Copy link
Member

Joffcom commented Feb 21, 2024

@stwonary I believe we have actually fixed this in #8578 which is available in 1.29.0 which you can access now.

@stwonary
Copy link
Contributor

stwonary commented Feb 21, 2024

You are correct. After conducting a test, I can confirm that everything is functioning perfectly with version 1.29.1. It appears I mistakenly believed I was using version 1.29.1 as the latest release on Docker Hub, when in fact, I was actually using version 1.27.3.

Thank you for your response!

@Joffcom
Copy link
Member

Joffcom commented Feb 21, 2024

Hey @stwonary,

No worries I will get this one marked as closed and update everyone else that had this issue as well. Thanks for sticking with us during this 👍🏻

@Joffcom Joffcom closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

3 participants