Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
Hi all,

I have managed to completely destroy my Raspberry Pi Teslamate install, but updating to the latest version, before installing Bullseye. I have now updated to bullseye, but it is a mess, with a horrendous log file, with hundreds of lines saying: "teslamate_1 | waiting for postgres at database:5432"

Does anyone know the best way to completely remove the teslamate install, so I can start again and reinstate my last good backup?

Thanks
 
Hi all,

I have managed to completely destroy my Raspberry Pi Teslamate install, but updating to the latest version, before installing Bullseye. I have now updated to bullseye, but it is a mess, with a horrendous log file, with hundreds of lines saying: "teslamate_1 | waiting for postgres at database:5432"

Does anyone know the best way to completely remove the teslamate install, so I can start again and reinstate my last good backup?

Thanks
 
Thanks @init6

I don't know what I have done to be honest. I have deleted by teslamate files, and started from scratch, but I still have the issue with not being able to connect to port 4000. The log file just says: "[36mteslamate_1 |[0m waiting for postgres at db:5432"

Any suggestions
 
Thanks @init6

I don't know what I have done to be honest. I have deleted by teslamate files, and started from scratch, but I still have the issue with not being able to connect to port 4000. The log file just says: "[36mteslamate_1 |[0m waiting for postgres at db:5432"

Any suggestions
Let's start from the beginning.

Did you upgrade to bullseye or do a fresh install?
What versions of Teslamate have you installed?
Have you upgraded the DB separately? (IIRC there was a problem a while back where a newer version of the DB corrupted some of the teslamate components)

can you show us the results of a docker ps please?

and the contents of your docker-compose.yml please.
 
Let's start from the beginning.

Did you upgrade to bullseye or do a fresh install?
I did an update, using this guide: The Idiot-Proof Guide to Upgrading Raspberry Pi from Buster to Bullseye

Code:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

What versions of Teslamate have you installed?
I have pulled the latest version using "docker-compose pull", so I am assuming it is 1.26.1. I have manually set the version to "1.26.1" in the docker-compose.vml, rather than "latest" because I had read that this was a work-around for some issues with the update.

Have you upgraded the DB separately? (IIRC there was a problem a while back where a newer version of the DB corrupted some of the teslamate components)
No, I haven't done this.

can you show us the results of a docker ps please?
Code:
CONTAINER ID   IMAGE                        COMMAND                  CREATED         STATUS                          PORTS                                       NAMES
2a8937624062   postgres:13                  "docker-entrypoint.s…"   3 minutes ago   Restarting (1) 25 seconds ago                                               pi_database_1
2324a67f94f7   teslamate/grafana:latest     "/run.sh"                3 minutes ago   Up 3 minutes                    0.0.0.0:3000->3000/tcp, :::3000->3000/tcp   pi_grafana_1
a203d0baf9ed   eclipse-mosquitto:2          "/docker-entrypoint.…"   3 minutes ago   Up 3 minutes                    1883/tcp                                    pi_mosquitto_1
577ffc11af72   teslamate/teslamate:1.26.1   "tini -- /bin/sh /en…"   3 minutes ago   Up 3 minutes                    0.0.0.0:4000->4000/tcp, :::4000->4000/tcp   pi_teslamate_1


and the contents of your docker-compose.yml please.
Code:
version: "3"

services:
  teslamate:
    image: teslamate/teslamate:1.26.1
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto
    ports:
      - 4000:4000
    volumes:
      - ./import:/opt/app/import
    cap_drop:
      - all

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

  grafana:
    image: teslamate/grafana:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - 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:

Thanks again @init6 for your help with this, I really appreciate it.
 
Last edited:
Code:
CONTAINER ID   IMAGE                        COMMAND                  CREATED         STATUS                          PORTS                                       NAMES
2a8937624062   postgres:13                  "docker-entrypoint.s…"   3 minutes ago   Restarting (1) 25 seconds ago                                               pi_database_1
2324a67f94f7   teslamate/grafana:latest     "/run.sh"                3 minutes ago   Up 3 minutes                    0.0.0.0:3000->3000/tcp, :::3000->3000/tcp   pi_grafana_1
a203d0baf9ed   eclipse-mosquitto:2          "/docker-entrypoint.…"   3 minutes ago   Up 3 minutes                    1883/tcp                                    pi_mosquitto_1
577ffc11af72   teslamate/teslamate:1.26.1   "tini -- /bin/sh /en…"   3 minutes ago   Up 3 minutes                    0.0.0.0:4000->4000/tcp, :::4000->4000/tcp   pi_teslamate_1
Looks like your database isn't starting, hence Teslamate will get errors.
What do you see in the db logs?

docker-compose logs database
 
Just read this guide. What did you do when you got to this part:

Upgrading Caveats​

Before you begin, I can’t stress enough that the best (and frankly, supported) way to upgrade to Bullseye is to backup all of your critical files and perform a clean install using the Raspberry Pi Imager. However, if you’re like me and choose to live dangerously, be sure to backup your files anyway and buckle up for the ride.

Did you do the clean install or buckle up? :)
 
If they're big feel free to DM them to me.

Not much in there, basically a continual repeat of this:



Code:
Attaching to pi_database_1
[36mdatabase_1   |[0m
[36mdatabase_1   |[0m PostgreSQL Database directory appears to contain a database; Skipping initialization
[36mdatabase_1   |[0m
[36mdatabase_1   |[0m 2022-04-03 07:16:58.321 UTC [1] FATAL:  database files are incompatible with server
[36mdatabase_1   |[0m 2022-04-03 07:16:58.321 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.6 (Debian 13.6-1.pgdg110+1).
 
  • Funny
Reactions: robbo100
@init6 - AMAZING

Thanks for your help. I had to do a little bit more fiddling, but after running that update of the PostgreSQL, it has all come back to life again. My last backup was on Friday night at 03:00, so I have missed out on collecting a couple of days of data, but in the grand scheme of things, no harm done.

Cheers 🍻
 
  • Like
Reactions: cwanja and init6
Hey guys,
So I've had to re-setup Teslamate on my Raspberry Pi from scratch -which is all done and working, however, now i am trying to setup the Gdrive backups using Dave's guide on How to perform an automated TeslaMate backup to Google Drive - TeslaEV.co.uk

I'm running into an issue where it will not start the web browser to create the token (on the step highlighted below). I have even tried to launch a web browser and point to http://127.0.0.1:53682/auth but again, I get a page not found error :(

Any ideas where i'm going wrong? i've done this directly on the Pi and also tried via ssh on another computer. Same issue :(

1649015675126.png
 
Hey guys,
So I've had to re-setup Teslamate on my Raspberry Pi from scratch -which is all done and working, however, now i am trying to setup the Gdrive backups using Dave's guide on How to perform an automated TeslaMate backup to Google Drive - TeslaEV.co.uk

I'm running into an issue where it will not start the web browser to create the token (on the step highlighted below). I have even tried to launch a web browser and point to http://127.0.0.1:53682/auth but again, I get a page not found error :(

Any ideas where i'm going wrong? i've done this directly on the Pi and also tried via ssh on another computer. Same issue :(

View attachment 789622
Does your pi have a browser installed?

Edit: I ran the commands on my teslamate server and then ran the rclone authorise command on my mac. This fired up a browser window which let me continue with the instructions.

See also:

 
Last edited:
Does your pi have a browser installed?

Edit: I ran the commands on my teslamate server and then ran the rclone authorise command on my mac. This fired up a browser window which let me continue with the instructions.

See also:

Hi init6, yep, Pi has a browser installed, but still wont auto launch the browser. Sorry im a newbie to this - How do i run the rclone authorise command on my PC? what program am i using to do that? if you have step by step for that part i would really appreciate that :)