Giter VIP home page Giter VIP logo

Comments (22)

brianmay avatar brianmay commented on June 20, 2024 2

I think it might help if the time displayed the timezone offset, that would help verify that the timezone is correct.

from teslamate.

brianmay avatar brianmay commented on June 20, 2024 2

I kind of think we need to be able display configuration errors - such as invalid TZ - somewhere on the website. Which in turn means the website shouldn't crash if it is invalid, but maybe resort to some sort of fallback behaviour.

The idea of looking at the logs - is a sensible one - but I think our users who are not programmers can struggle with this. So maybe we need to try to simplify the errors as much as possible and make them accessible by putting them on the website, where everyone can see them without needing to learn about logs.

It doesn't help when the invalid TZ only error only happens when the car is charging either. Perhaps we should be trying to load the timezone at startup.

from teslamate.

brianmay avatar brianmay commented on June 20, 2024 1

Note the referenced instructions set TZ=${TM_TZ} in the docker-compose file.

So doing in this way makes sense. TeslaMate is reading the TZ value, which is set from the TM_TZ value.

But there is nothing in TeslaMate - that I am aware of - that reads the TM_TZ environment variable directly.

The docker-compose file quoted above does not have the TZ=${TM_TZ} line.

from teslamate.

touchton avatar touchton commented on June 20, 2024 1

Just to add another data point, my .yml file has the following:
TZ=America/Chicago

Nothing about TM_TZ in the file at all. I'm not having a problem; time is being displayed correctly in both the Teslamate page and Grafana pages.

I don't know if this information helps or hurts... I'm running the container locally in a Photon VM on an ESX host.

from teslamate.

brianmay avatar brianmay commented on June 20, 2024 1

That does make sense. If TZ is wrong, then TeslaMate will see it and this will create the error. If TM_TZ is wrong, it doesn't matter, TeslaMate won't look at that and continue working using whatever the system default timezone is.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024 1

database:
image: postgres:13
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=redacted
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data

Even if it is not related to the issue here, you need to update your postgres database container, please do a backup and follow https://docs.teslamate.org/docs/maintenance/upgrading_postgres

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024 1
  • TZ="America/Indiana/Indianapolis"

The issue are the ". Please remove the unneeded TM_TZ and replace with - TZ=America/Indiana/Indianapolis in your case

from teslamate.

Olyts avatar Olyts commented on June 20, 2024 1

The issue was fixed when I replaced to TZ by TM_TZ. As mentioned by @cwanja Now the web page is coming up while charging (no more 500 server error), but the time is 5.5 hours off. Although my TZ is set to America/Toronto? Grafana info is spot on about drive time and charge time, it is not just not showing up right on the Teslamate homepage.(+5,5 hours), As an example, at an expected local 8h15 finish time, it was showing 13h45. Iā€™m not worried much, just want to report here.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024

@TSJasonH please share your docker-compose file (without your secrets). The name of the environment variable is TZwithout any TM_

from teslamate.

TSJasonH avatar TSJasonH commented on June 20, 2024

sure...

version: "3"

services:
  teslamate:
    image: teslamate/teslamate:latest
    restart: always
    environment:
      - ENCRYPTION_KEY=*redacted*
      - DATABASE_USER=teslamate
      - DATABASE_PASS=*redacted*
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto
      - TZ="America/Indiana/Indianapolis"      
      - TM_TZ="America/Indiana/Indianapolis"   
    ports:
      - 4000:4000
    volumes:
      - ./import:/opt/app/import
    cap_drop:
      - all

  database:
    image: postgres:13
    restart: always
    environment:
      - POSTGRES_USER=teslamate
      - POSTGRES_PASSWORD=*redacted*
      - POSTGRES_DB=teslamate
    volumes:
      - teslamate-db:/var/lib/postgresql/data  

  grafana:
    image: teslamate/grafana:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=*redacted*
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
    ports:
      - 3000:3000
    volumes:
      - teslamate-grafana-data:/var/lib/grafana

  mosquitto:
    image: eclipse-mosquitto:2
    restart: always
    command: mosquitto -c /mosquitto-no-auth.conf
    # ports:
    #   - 1883:1883
    volumes:
      - mosquitto-conf:/mosquitto/config
      - mosquitto-data:/mosquitto/data

volumes:
  teslamate-db:
  teslamate-grafana-data:
  mosquitto-conf:
  mosquitto-data:

from teslamate.

brianmay avatar brianmay commented on June 20, 2024

Random thought: I would like to be able to see the current timezone that is in use when the car is not charging. Maybe something to print the last refresh date/time in the live view or something like that would be a good idea. This probably would help debug this issue as well.

from teslamate.

maxhac03 avatar maxhac03 commented on June 20, 2024

Been using TM_TZ in the .env file since 2019. Both TeslaMate and Grafana reported the correct time since.

Here the instruction for the .env file does mention TM_TZ:
https://docs.teslamate.org/docs/guides/traefik

All i did was change the zone and kept the same variable to fix the issue.

Screenshot_20240215-180146
screenshot 21
screenshot 22

from teslamate.

cwanja avatar cwanja commented on June 20, 2024

For what it is worth, a user on TMC changed the variable from TZ to TM_TZ and their internal server error on TeslaMate webpage during charging went away.
https://teslamotorsclub.com/tmc/threads/teslamate-megathread.191537/page-164#post-8088719

from teslamate.

TSJasonH avatar TSJasonH commented on June 20, 2024

Looks good. Quotes...who knew :-/

Also thanks for the db upgrade tip. Completed the upgrade to pg 15 smoothly with the provided instructions.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024

Looks good. Quotes...who knew :-/

So issue is resolved with only TZ=... correct?

from teslamate.

ampersandru avatar ampersandru commented on June 20, 2024

was getting internal server errors, tried TM_TZ and it still didnt fix it.

Rolled back to teslamate/teslamate:1.28.2 and its working fine again with just the TZ env

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024

was getting internal server errors,

If you ask for help, please share your docker-compose (without credentials)

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 20, 2024

Total agree. Not only valid for TZ

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.