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

'Started at' timezone gets mixed in the executions view #3855

Closed
rafalkrupinski opened this issue Aug 8, 2022 · 12 comments
Closed

'Started at' timezone gets mixed in the executions view #3855

rafalkrupinski opened this issue Aug 8, 2022 · 12 comments

Comments

@rafalkrupinski
Copy link

Describe the bug
When one flow calls another, the task execution view shows that the triggered task was called 2 hours before or after the triggering task

To Reproduce

  1. Running n8n server with both TZ and GENERIC_TIMEZONE=Europe/Vienna
  2. prepare a simple flow
  3. prepare another flow, triggering the flow from the step 2.

Expected behavior
The execution time of flows should be seconds apart

Environment (please complete the following information):

  • n8n Version 168.1

Additional context
image

Also in some cases a task trigger by cron node will show execution time 2hrs earlier then the actual execution

@Joffcom
Copy link
Member

Joffcom commented Aug 11, 2022

Hey @rafalkrupinski,

What is your workflow doing and have you tried on a newer release? I have just given it a quick go here and I am seeing what I would expect, does it actually run the workflow when it is meant to?

image

@rafalkrupinski
Copy link
Author

What is your workflow doing

I just run a very simple workflow even without a call to another one and the time is wrong.
It's querying Airtable for a single value and making two HTTP requests querying for some simple data - API version and current account.

and have you tried on a newer release?

Yes, since I made the report I've updated to 0.189.1

I have just given it a quick go here and I am seeing what I would expect, does it actually run the workflow when it is meant to?

I just run it manually and the time is 2hrs back.

Sorry, I forgot to mention I'm running it in Docker from a custom image based on the official one:

FROM n8nio/n8n:0.189.1

RUN npm_config_user=root npm install -g date-fns date-fns-tz nanoid

docker compose

  n8n-dev:
    build: ...
    environment:
    - DB_POSTGRESDB_DATABASE=...
    - DB_POSTGRESDB_HOST=...
    - DB_POSTGRESDB_PASSWORD=...
    - DB_POSTGRESDB_USER=...
    - DB_TYPE=postgresdb
    - GENERIC_TIMEZONE=Europe/Vienna
    - N8N_BASIC_AUTH_ACTIVE=true
    - N8N_BASIC_AUTH_USER=...
    - N8N_BASIC_AUTH_PASSWORD=...
    - N8N_DIAGNOSTICS_ENABLED=false
    - N8N_ENCRYPTION_KEY=...
    - N8N_HOST=...
    - N8N_METRICS=true
    - N8N_VERSION_NOTIFICATIONS_ENABLED=false
    - NODE_FUNCTION_ALLOW_EXTERNAL=date-fns,date-fns-tz,nanoid
    - NODE_FUNCTION_ALLOW_BUILTIN=crypto
    - TZ=Europe/Vienna
    - WEBHOOK_URL=...
    - NODE_ENV=production

    - N8N_LOG_LEVEL=debug

@Joffcom
Copy link
Member

Joffcom commented Aug 11, 2022

Hey @rafalkrupinski,

I am not sure what else to check on this one, I can't reproduce it and I have just given it a bash with the same timezone you have set.

image

If you try with just the normal docker image does that have the same issue?

Could you try with maybe a workflow that just calls the sub workflow and in the workflow it calls just use a set node and see if that has the same issue. Could the database maybe have a different locale set on it?

@rafalkrupinski
Copy link
Author

Postgres is set to UTC, why should it matter? ;)

@Joffcom
Copy link
Member

Joffcom commented Aug 11, 2022

Hey @rafalkrupinski,

I wouldn't have thought it would matter unless it was trying to convert something but as I can't reproduce it from 3 different instances the only thing I can think of is it is outside of the application or it is a bug that has a very specific requirement to trigger which will make it tricky to track down.

I would start by using the image we provide with a SQLite database and see if you get the same issue then try your image with the SQLite database and see what happens then a new postgres database and we can work out at what point it breaks. If they all have the same issue we will need to have another think about what could be different.

@rafalkrupinski
Copy link
Author

I was able to reproduce the problem with a simple manually executed workflow.
Postgres is in UTC and n8n is in CEST

https://github.com/oeklo/n8n-tz

@Joffcom
Copy link
Member

Joffcom commented Aug 17, 2022

Hey @rafalkrupinski,

That has done it so using that compose file I get...

image

I have just done some playing with it and it looks like the Starting At time is initially correct but then when it finishes the time changes. Seems to be ok with SQLite and only an issue with Postgres so far, I am not sure why this isn't an issue on my main install though.

I will pass this one over to the core team.

@rafalkrupinski
Copy link
Author

Glad we could find the problem. I wouldn't have thought of postgres time zone if you hadn't mentioned the database locale. This compose file is literally the first thing I tried :D

@Joffcom
Copy link
Member

Joffcom commented Jan 18, 2023

Hey @rafalkrupinski,

Is everything still looking good on this one with the change to the database locale?

@rafalkrupinski
Copy link
Author

@Joffcom

All my databases' time zone is UTC. I've changed N8N TZ & GENERIC_TIMEZONE to UTC, and while it fixed the docker sample I've linked earlier, it didn't fix my development environment. No idea why.

@Joffcom
Copy link
Member

Joffcom commented Jun 14, 2023

Hey @rafalkrupinski,

Did you ever get to the bottom of this madness?

netroy added a commit that referenced this issue Sep 28, 2023
# [1.9.0](https://github.com/n8n-io/n8n/compare/n8n@1.8.0...n8n@1.9.0)
(2023-09-28)


### Bug Fixes

* **Airtable Node:** Attachments field type fix
([#7227](#7227))
([2af967c](2af967c))
* **core:** Change WorkflowHistory nodes/connections columns to be json
([#7282](#7282))
([a80abad](a80abad))
* **core:** Fix binary data manager check on pruning
([#7251](#7251))
([484035e](484035e))
* **core:** Fix missing execution ID in webhook-based workflow producing
binary data ([#7244](#7244))
([33991e9](33991e9))
* **core:** Handle filename* with quotes in Content-Disposition header
([#7229](#7229))
([67b985f](67b985f))
* **core:** Make DNS resolution order configurable
([#7272](#7272))
([5b3121c](5b3121c))
* **core:** Make senderId required for all command messages
([#7252](#7252))
([4b01428](4b01428))
* **core:** Prevent executions from displaying Running status
incorrectly ([#7261](#7261))
([861cac5](861cac5))
* **core:** Use consistent timezone-aware timestamps in postgres
([#6948](#6948))
([0132514](0132514)),
closes [#2178](#2178)
[#2810](#2810)
[#3855](#3855)
[#2813](#2813)
* **editor:** Add debug feature docs link
([#7240](#7240))
([4614e1e](4614e1e))
* **editor:** Fix SQL editor issue
([#7236](#7236))
([647fc6c](647fc6c))
* **editor:** Ensure new Set node is on top of search list
([#7215](#7215))
([2491ccf](2491ccf))
* **editor:** Forbid password reset when cloud account is limited in the
number of users [7188](#7188)
([303bc8e](303bc8e))
* **HTTP Request Node:** Add suggestion how to fix '429 - too many
requests' errors ([#7293](#7293))
([0bc33b1](0bc33b1))
* **Item Lists Node:** Concatenate operation pairedItems fix
([#7286](#7286))
([cde23a1](cde23a1))
* **Respond to Webhook Node:** JSON output from expression fix
([#7294](#7294))
([8bc369d](8bc369d))


### Features

* Add onboarding flow
([#7212](#7212))
([01e9340](01e9340))
* **core:** Add secrets provider reload and refactor
([#7277](#7277))
([53a7502](53a7502))
* **core:** Add Tournament as the new default expression evaluator
([#6964](#6964))
([bf74f09](bf74f09))
* **core:** Initial workflow history API
([#7234](#7234))
([0083a9e](0083a9e))
* **core:** Introduce object store service
([#7225](#7225))
([fa84545](fa84545))
* **editor:** Add user cloud ID to telemetry
[#7232](#7232)
([60c152d](60c152d))
* **editor:** Rework banners framework and add email confirmation banner
([#7205](#7205))
([b0e98b5](b0e98b5))
* **MISP Node:** Update credential to support HTTP Request node
([#7268](#7268))
([e4c302c](e4c302c))


### Performance Improvements

* **core:** Skip unneeded calls on every pruning cycle
([#7260](#7260))
([db01164](db01164))

Co-authored-by: netroy <netroy@users.noreply.github.com>
@Joffcom
Copy link
Member

Joffcom commented Sep 28, 2023

Good news, This should now be fixed in 1.9.0. For now I am going to mark this as closed if you are still seeing this let me know and we can open it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants