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

not a tuple #4196

Closed
1 task done
brianmay opened this issue Sep 13, 2024 · 17 comments · Fixed by #4205
Closed
1 task done

not a tuple #4196

brianmay opened this issue Sep 13, 2024 · 17 comments · Fixed by #4205
Labels
area:teslamate Related to TeslaMate core dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code

Comments

@brianmay
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Seeing a not a tuple error periodically in my logs. Seems to be associated with TzData. Was happening once an hour, and last occurrance was 2024-09-13 03:20:06UTC.

Possibly a bug from tzdata, maybe there was some sort of error condition with its update.

Expected Behavior

Error should not appear.

Steps To Reproduce

Run teslamate for a while and look at the logs.

Relevant log output

Sep 11 11:19:55 iot2 teslamate[24319]:   * 2nd argument: not a tuple
Sep 11 11:19:55 iot2 teslamate[24319]:     :erlang.element(1, :error)
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:38: Tzdata.Parser.process_rule/1
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
Sep 11 11:19:55 iot2 teslamate[24319]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1

Screenshots

No response

Additional data

No response

Type of installation

Manual

Version

57acace

@JakobLichterfeld JakobLichterfeld added elixir Pull requests that update Elixir code area:teslamate Related to TeslaMate core labels Sep 15, 2024
@sdwalker
Copy link
Contributor

https://diff.hex.pm/diff/tzdata/1.1.1..1.1.2

Looks like the tzdata dep needs bumped to 1.1.2 to get the updated timezone database

@sdwalker
Copy link
Contributor

Full error

Sep 14 23:53:37 TeslaMate teslamate[26264]: 2024-09-14 23:53:37.115 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Thu, 05 Sep 2024 18:47:42 GMT.
Sep 14 23:53:37 TeslaMate teslamate[26264]: 2024-09-14 23:53:37.376 [error] GenServer :tzdata_release_updater terminating
Sep 14 23:53:37 TeslaMate teslamate[26264]: ** (ArgumentError) errors were found at the given arguments:
Sep 14 23:53:37 TeslaMate teslamate[26264]:   * 2nd argument: not a tuple
Sep 14 23:53:37 TeslaMate teslamate[26264]:     :erlang.element(1, :error)
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:38: Tzdata.Parser.process_rule/1
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
Sep 14 23:53:37 TeslaMate teslamate[26264]:     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Sep 14 23:53:37 TeslaMate teslamate[26264]: Last message: :check_if_time_to_update

@JakobLichterfeld
Copy link
Collaborator

JakobLichterfeld commented Sep 16, 2024

Nice find, although my logs don't show this behavior, presumably due to different time zones.

Edit: My log format is YYYY-MM-DD (for example: 2024-07-15 17:21:48.603, while yours is MM DD)

tzdata 1.1.2

can handle months being spelled out instead of abbreveated to 3 letters as happened in one place in 2024b. (Moxley Stratton)

Next release will have tzdata 1.1.2 "automatically"

@JakobLichterfeld JakobLichterfeld added the dependencies Pull requests that update a dependency file label Sep 16, 2024
@sdwalker
Copy link
Contributor

can handle months being spelled out instead of abbreveated to 3 letters as happened in one place in 2024b. (Moxley Stratton)

Yep, lau/tzdata#147

Local tzdata update and then rebuild

mix deps.update tzdata --only prod

@sdwalker
Copy link
Contributor

sdwalker commented Sep 16, 2024

Next release will have tzdata 1.1.2 automatically

Will the other ~1/2 of the dependencies get updated?

$ mix deps.update --only prod --all
Resolving Hex dependencies...
Resolution completed in 0.403s
Unchanged:
  certifi 2.12.0
  combine 0.10.0
  cowboy_telemetry 0.4.0
  decimal 2.1.1
  ex_cldr 2.37.5
  fuse 2.5.0
  gen_state_machine 3.0.0
  hackney 1.20.1
  idna 6.1.1
  metrics 1.0.1
  mimerl 1.3.0
  nimble_csv 1.2.0
  parse_trans 3.4.1
  phoenix_live_view 0.18.18
  phoenix_pubsub 2.1.3
  phoenix_template 1.0.4
  ranch 2.1.0
  srtm 0.8.0
  ssl_verify_fun 1.1.7
  timex 3.7.11
  tzdata 1.1.2
  unicode_util_compat 0.7.0
  websock 0.5.3
  websockex 0.4.3
Upgraded:
  castore 1.0.5 => 1.0.8
  cldr_utils 2.24.2 => 2.28.2
  cloak 1.1.2 => 1.1.4
  cloak_ecto 1.2.0 => 1.3.0
  cowboy 2.10.0 => 2.12.0
  cowlib 2.12.1 => 2.13.0
  db_connection 2.6.0 => 2.7.0
  ecto 3.10.3 => 3.12.3
  ecto_sql 3.10.2 => 3.12.0
  ex_cldr_plugs 1.3.1 => 1.3.3
  expo 0.4.1 => 1.1.0 (major)
  finch 0.16.0 => 0.19.0 (minor)
  floki 0.35.2 => 0.36.2 (minor)
  gettext 0.23.1 => 0.26.1 (minor)
  hpax 0.1.2 => 1.0.0 (major)
  jason 1.4.1 => 1.4.4
  mime 2.0.5 => 2.0.6
  mint 1.5.1 => 1.6.2
  nimble_options 1.0.2 => 1.1.1
  nimble_pool 1.0.0 => 1.1.0
  phoenix 1.7.10 => 1.7.14
  phoenix_ecto 4.4.3 => 4.6.2
  phoenix_html 3.3.3 => 3.3.4
  phoenix_view 2.0.3 => 2.0.4
  plug 1.15.2 => 1.16.1
  plug_cowboy 2.6.1 => 2.7.2
  plug_crypto 2.0.0 => 2.1.0
  postgrex 0.17.3 => 0.19.1 (minor)
  telemetry 1.2.1 => 1.3.0
  tesla 1.8.0 => 1.12.1
  tortoise311 0.11.7 => 0.12.0 (minor)
  websock_adapter 0.5.5 => 0.5.7
* Updating castore (Hex package)
* Updating ecto_sql (Hex package)
* Updating ex_cldr_plugs (Hex package)
* Updating finch (Hex package)
* Updating floki (Hex package)
* Updating gettext (Hex package)
* Updating jason (Hex package)
* Updating phoenix (Hex package)
* Updating phoenix_view (Hex package)
* Updating phoenix_ecto (Hex package)
* Updating phoenix_html (Hex package)
* Updating plug_cowboy (Hex package)
* Updating postgrex (Hex package)
* Updating tesla (Hex package)
* Updating tortoise311 (Hex package)
* Updating cloak_ecto (Hex package)
* Updating cloak (Hex package)
* Updating ecto (Hex package)
* Updating telemetry (Hex package)
* Updating mime (Hex package)
* Updating db_connection (Hex package)
* Updating cowboy (Hex package)
* Updating plug (Hex package)
* Updating plug_crypto (Hex package)
* Updating cowlib (Hex package)
* Updating websock_adapter (Hex package)
* Updating expo (Hex package)
* Updating mint (Hex package)
* Updating nimble_options (Hex package)
* Updating nimble_pool (Hex package)
* Updating hpax (Hex package)
* Updating cldr_utils (Hex package)

@JakobLichterfeld
Copy link
Collaborator

Will the other ~1/2 of the dependencies get updated?

I wonder since a while why Dependabot not saying anything. Seems like Adrian disabled it for mix 2 years ago:
6e876d7

@brianmay
Copy link
Collaborator Author

Shame Adrian didn't say why he disabled it. But I imagine it was because he couldn't keep up with the updates. Which is a problem that I regularly face with my projects.

@JakobLichterfeld
Copy link
Collaborator

But I imagine it was because he couldn't keep up with the updates. Which is a problem that I regularly face with my projects.

Yes, I assume the same, but anyway, will start with updating tzdata and then one step at a time.

@a1exus
Copy link

a1exus commented Sep 17, 2024

i STILL get the same error even w/ latest 1.30.1(

# docker compose logs teslamate
teslamate-1  | 2024-09-17 14:08:24.574 [info] Migrations already up
teslamate-1  | 2024-09-17 14:08:25.561 [info] No tzdata release files found in custom data dir. Copying release file from tzdata priv dir.
teslamate-1  | 2024-09-17 14:08:25.619 [info] System Info: Erlang/OTP 26 (jit)
teslamate-1  | 2024-09-17 14:08:25.619 [info] Version: 1.30.1
teslamate-1  | 2024-09-17 14:08:25.646 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
teslamate-1  | 2024-09-17 14:08:25.647 [info] Access TeslaMateWeb.Endpoint at http://X.X.X
teslamate-1  | 2024-09-17 14:08:25.650 [info] MQTT connection has been established
teslamate-1  | 2024-09-17 14:08:28.750 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Thu, 05 Sep 2024 18:47:42 GMT.
teslamate-1  | 2024-09-17 14:08:28.896 [error] GenServer :tzdata_release_updater terminating
teslamate-1  | ** (ArgumentError) errors were found at the given arguments:
teslamate-1  |
teslamate-1  |   * 2nd argument: not a tuple
teslamate-1  |
teslamate-1  |     :erlang.element(1, :error)
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:38: Tzdata.Parser.process_rule/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  | Last message: :check_if_time_to_update
#

Please advise)
Thanks!

@sdwalker
Copy link
Contributor

But I imagine it was because he couldn't keep up with the updates. Which is a problem that I regularly face with my projects.

Yes, I assume the same, but anyway, will start with updating tzdata and then one step at a time.

The WIP changes needed to bump to Phoenix HTML 4.1 are at https://gist.github.com/sdwalker/a057d9f8f3425efb746f6805ce087beb

@JakobLichterfeld
Copy link
Collaborator

JakobLichterfeld commented Sep 18, 2024

i STILL get the same error even w/ latest 1.3.1

It is not fixed in TeslaMate 1.30.1, so this is expected behavior till a new version is released.

@JakobLichterfeld
Copy link
Collaborator

JakobLichterfeld commented Sep 18, 2024

I wonder since a while why Dependabot not saying anything. Seems like Adrian disabled it for mix 2 years ago:
6e876d7

Yes, I assume the same, but anyway, will start with updating tzdata and then one step at a time.

---> dependabot will be re-enabled with #4207

@a1exus
Copy link

a1exus commented Sep 18, 2024

i STILL get the same error even w/ latest 1.3.1

It is not fixed in TeslaMate 1.30.1, so this is expected behavior till a new version is released.

ok, is there ETA for new version? or is there another known version that works? i tried to rollback few version behind, however still couldn't get it to work due to same error, also why is this issue closed if this still isn't resolved..

@JakobLichterfeld
Copy link
Collaborator

ok, is there ETA for new version? or is there another known version that works? i tried to rollback few version behind, however still couldn't get it to work due to same error.

This issue described by OP is cosmetic nature. As the dependency always had the issue a rollback does not result in different behavior.

@a1exus
Copy link

a1exus commented Sep 19, 2024

ok, is there ETA for new version? or is there another known version that works? i tried to rollback few version behind, however still couldn't get it to work due to same error.

This issue described by OP is cosmetic nature. As the dependency always had the issue a rollback does not result in different behavior.

it's not cosmetic nature, as i can't start Teslamate inside of the docker container because of that issue though..

whenever i try to access my url, I get

Error establishing a database connection

and when I look into the logs of Teslamate, I See this error

teslamate-1  | 2024-09-18 20:08:35.289 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Thu, 05 Sep 2024 18:47:42 GMT.
teslamate-1  | 2024-09-18 20:08:35.447 [error] GenServer :tzdata_release_updater terminating
teslamate-1  | ** (ArgumentError) errors were found at the given arguments:
teslamate-1  |
teslamate-1  |   * 2nd argument: not a tuple
teslamate-1  |
teslamate-1  |     :erlang.element(1, :error)
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:38: Tzdata.Parser.process_rule/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
teslamate-1  |     (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
teslamate-1  | Last message: :check_if_time_to_update

@JakobLichterfeld
Copy link
Collaborator

JakobLichterfeld commented Sep 19, 2024

it's not cosmetic nature, as i can't start Teslamate inside of the docker container because of that issue though..

The issue described by OP is cosmetic nature.

If your instance is not starting, please check your tz config in your docker-compose.yml and open a separate issue if still present after comparing to https://docs.teslamate.org/docs/installation/docker. Especially check your TZ environment variable, see https://docs.teslamate.org/docs/configuration/environment_variables

@JakobLichterfeld
Copy link
Collaborator

The WIP changes needed to bump to Phoenix HTML 4.1 are at https://gist.github.com/sdwalker/a057d9f8f3425efb746f6805ce087beb

-> #4277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:teslamate Related to TeslaMate core dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants