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

Wrong timezone in completed workflows in Workflow Executions since n8n:0.131.0 with PostgreSQL #2178

Closed
auntieyi opened this issue Sep 7, 2021 · 9 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@auntieyi
Copy link

auntieyi commented Sep 7, 2021

Describe the bug
When we set the timezone in env:
- GENERIC_TIMEZONE=Asia/Hong_Kong
- TZ=Asia/Hong_Kong

The timezone in the running workflows are correct (see first 2 rows in the screenshot below), but after completed it showing the time in wrong timezone (see 3nd row in screenshot below).

image

To Reproduce
Steps to reproduce the behavior:

  1. Set GENERIC_TIMEZONE, TZ in env
  2. Click on 'Executions'
  3. See error

Expected behavior
The completed workflows should keep in correct timezone.

Environment (please complete the following information):

  • OS: CentOS 7
  • n8n Version: 0.137.0
  • Docker version: 19.03.1
@marcofucito
Copy link

If I'm not mistaken, with an old version of n8n, it also marked an incorrect time zone to me despite having set the time zone in the docker.

With the latest current version, n8n@0.141.0, the time reported in the execution tab, correctly respects the set time zone.

@auntieyi
Copy link
Author

auntieyi commented Oct 3, 2021

@marcofucito
I tried n8n@0.141.0, the problem still persists.
The old version of n8n do not have this problem, the problem after I update the n8n to v0.137.0.
And I found that the wrong timezone issue if I use postgresdb in n8n.
environment:
- DB_TYPE=postgresdb
If I change back not to use PostgreSQL, the time can display properly.

@auntieyi auntieyi changed the title Wrong timezone in completed workflows in Workflow Executions Wrong timezone in completed workflows in Workflow Executions of n8n with PostgreSQL Oct 3, 2021
@auntieyi
Copy link
Author

auntieyi commented Oct 3, 2021

I tried the older version and can confirm that the problem happened since n8n:0.131.0.

@janober hope you have time to look into this. Thanks

@auntieyi auntieyi changed the title Wrong timezone in completed workflows in Workflow Executions of n8n with PostgreSQL Wrong timezone in completed workflows in Workflow Executions since n8n:0.136.0 with PostgreSQL Oct 3, 2021
@auntieyi auntieyi changed the title Wrong timezone in completed workflows in Workflow Executions since n8n:0.136.0 with PostgreSQL Wrong timezone in completed workflows in Workflow Executions since n8n:0.131.0 with PostgreSQL Oct 3, 2021
@auntieyi
Copy link
Author

auntieyi commented Oct 3, 2021

The datetime changed to use timestamptz that caused the problem since 0.131.0.
https://github.com/n8n-io/n8n/compare/n8n@0.130.0...n8n@0.131.0#diff-22fc99be9309a8b7f569bab560c0e04ce308a1200d724a6c748ee922b4e79117
image

@auntieyi
Copy link
Author

auntieyi commented Oct 3, 2021

@ivov Is it safe if I change back to use timestamp? I hope you can give me advice, thanks.

@ivov
Copy link
Contributor

ivov commented Oct 4, 2021

Column type was switched to timestamptz for UTC storage, so it is not advisable to revert. Timestamps are being correctly stored in UTC in PG; the issue seems to be caused during retrieval via TypeORM.

@auntieyi
Copy link
Author

auntieyi commented Oct 4, 2021

Thanks your advice @ivov.
I have altered all existing timestamp column to type timestamptz in PG.
The problem seems to be solved.

@Joffcom
Copy link
Member

Joffcom commented Jan 17, 2023

Just going to leave a note here to say that internally this has a tracking reference of n8n-2490.

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
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

5 participants