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

TeslaMate Super Thread

This site may earn commission on affiliate links.
Formatting got butchered... might fix later but make sure you space it properly

Back everything up before you try this, but I would imagine...

A new teslamate section like so

I have tried to extend the docker-compose.yml with the sections you described, and I end up with being able to start all. But, the TeslaMate frontend on <ip-address>:4001 is not accessable, and when looking to 'docker ps' I see NAME 'pi_teslamate2_1 trying to restart. When having all activated newly, it does show up at ports with 0.0.0.0:4001->4000/tcp for less than a minute and then blanks out with status 'Restarting (1) 5 seconds ago'.

docker-compose.yml looks now as follows:
Code:
version: "3"

services:
  teslamate:
    image: teslamate/teslamate:latest
    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

  teslamate2:
    image: teslamate/teslamate:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate2
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto2
    ports:
      - 4001: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

  grafana2:
    image: teslamate/grafana:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate2
      - DATABASE_HOST=database
    ports:
      - 3001:3000
    volumes:
      - teslamate-grafana2-data:/var/lib/grafana

  mosquitto:
    image: eclipse-mosquitto:1.6
    restart: always
    ports:
      - 1883:1883
    volumes:
      - mosquitto-conf:/mosquitto/config
      - mosquitto-data:/mosquitto/data

  mosquitto2:
    image: eclipse-mosquitto:1.6
    restart: always
    ports:
      - 1884:1883
    volumes:
      - mosquitto2-conf:/mosquitto/config
      - mosquitto2-data:/mosquitto/data

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

What is working:
* 1st instance of TeslaMate works and no data lost
* 1st Grafana instance works
* 2nd Grafance instance works
* folder / directory import2 gets created

Output from 'docker ps' command:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5c4cd1bc9ef5 teslamate/grafana:latest "/run.sh" 19 minutes ago Up 19 minutes 0.0.0.0:3001->3000/tcp pi_grafana2_1
b4eaeda289e4 teslamate/teslamate:latest "tini -- /bin/sh /en…" 28 minutes ago Restarting (1) 9 seconds ago pi_teslamate2_1
00642f04724e eclipse-mosquitto:1.6 "/docker-entrypoint.…" 36 minutes ago Up 26 minutes 0.0.0.0:1884->1883/tcp pi_mosquitto2_1
815590b01191 teslamate/grafana:latest "/run.sh" 51 minutes ago Up 26 minutes 0.0.0.0:3000->3000/tcp pi_grafana_1
5e23627bc525 teslamate/teslamate:latest "tini -- /bin/sh /en…" 51 minutes ago Up 26 minutes 0.0.0.0:4000->4000/tcp pi_teslamate_1
d0e4f28b56dd postgres:13 "docker-entrypoint.s…" 51 minutes ago Up 26 minutes 5432/tcp pi_database_1
bd7e5bfebdec eclipse-mosquitto:1.6 "/docker-entrypoint.…" 51 minutes ago Up 26 minutes 0.0.0.0:1883->1883/tcp pi_mosquitto_1

I have even tried to put another database2 section in, but that did not help either.

Learned a little from all the fiddling around, but could not get it so far up and running.
 
Last edited:
I would try to get some logs from it. Try stopping it so it doesn't restart and then starting it up attached.

Code:
docker-compose stop teslamate2
docker-compose up teslamate2

Thank you for the suggestion. It confirmed what I suspected and saw in the 2nd instance of Grafana; database teslamate2 does not get created. Here the log which was shown:

Code:
pi@raspberrypi:~ $ docker-compose stop teslamate2
Stopping pi_teslamate2_1 ... done
pi@raspberrypi:~ $ docker-compose up teslamate2
Starting pi_teslamate2_1 ... done
Attaching to pi_teslamate2_1
teslamate2_1  | 2021-02-14 08:30:05.207 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:05.207 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:06.910 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:08.050 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:08.138 [error] Could not create schema migrations table. This error usually happens due to the following:
teslamate2_1  | 
teslamate2_1  |   * The database does not exist
teslamate2_1  |   * The "schema_migrations" table, which Ecto uses for managing
teslamate2_1  |     migrations, was defined by another library
teslamate2_1  |   * There is a deadlock while migrating (such as using concurrent
teslamate2_1  |     indexes with a migration_lock)
teslamate2_1  | 
teslamate2_1  | To fix the first issue, run "mix ecto.create".
teslamate2_1  | 
teslamate2_1  | To address the second, you can run "mix ecto.drop" followed by
teslamate2_1  | "mix ecto.create". Alternatively you may configure Ecto to use
teslamate2_1  | another table and/or repository for managing migrations:
teslamate2_1  | 
teslamate2_1  |     config :teslamate, TeslaMate.Repo,
teslamate2_1  |       migration_source: "some_other_table_for_schema_migrations",
teslamate2_1  |       migration_repo: AnotherRepoForSchemaMigrations
teslamate2_1  | 
teslamate2_1  | The full error report is shown below.
teslamate2_1  | 
teslamate2_1  | ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2958ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
teslamate2_1  | 
teslamate2_1  |   1. Tracking down slow queries and making sure they are running fast enough
teslamate2_1  |   2. Increasing the pool_size (albeit it increases resource consumption)
teslamate2_1  |   3. Allowing requests to wait longer by increasing :queue_target and :queue_interval
teslamate2_1  | 
teslamate2_1  | See DBConnection.start_link/2 for more information
teslamate2_1  | 
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate2_1  |     (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
teslamate2_1  |     (teslamate 1.21.3) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0
teslamate2_1  | 2021-02-14 08:30:12.125 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:12.126 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:14.790 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:14.832 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:15.044 [error] Could not create schema migrations table. This error usually happens due to the following:
teslamate2_1  | 
teslamate2_1  |   * The database does not exist
teslamate2_1  |   * The "schema_migrations" table, which Ecto uses for managing
teslamate2_1  |     migrations, was defined by another library
teslamate2_1  |   * There is a deadlock while migrating (such as using concurrent
teslamate2_1  |     indexes with a migration_lock)
teslamate2_1  | 
teslamate2_1  | To fix the first issue, run "mix ecto.create".
teslamate2_1  | 
teslamate2_1  | To address the second, you can run "mix ecto.drop" followed by
teslamate2_1  | "mix ecto.create". Alternatively you may configure Ecto to use
teslamate2_1  | another table and/or repository for managing migrations:
teslamate2_1  | 
teslamate2_1  |     config :teslamate, TeslaMate.Repo,
teslamate2_1  |       migration_source: "some_other_table_for_schema_migrations",
teslamate2_1  |       migration_repo: AnotherRepoForSchemaMigrations
teslamate2_1  | 
teslamate2_1  | The full error report is shown below.
teslamate2_1  | 
teslamate2_1  | ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2953ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
teslamate2_1  | 
teslamate2_1  |   1. Tracking down slow queries and making sure they are running fast enough
teslamate2_1  |   2. Increasing the pool_size (albeit it increases resource consumption)
teslamate2_1  |   3. Allowing requests to wait longer by increasing :queue_target and :queue_interval
teslamate2_1  | 
teslamate2_1  | See DBConnection.start_link/2 for more information
teslamate2_1  | 
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate2_1  |     (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
teslamate2_1  |     (teslamate 1.21.3) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0
pi_teslamate2_1 exited with code 1
teslamate2_1  | 2021-02-14 08:30:19.347 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:19.347 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:20.626 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:21.389 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:22.233 [error] Could not create schema migrations table. This error usually happens due to the following:
teslamate2_1  | 
teslamate2_1  |   * The database does not exist
teslamate2_1  |   * The "schema_migrations" table, which Ecto uses for managing
teslamate2_1  |     migrations, was defined by another library
teslamate2_1  |   * There is a deadlock while migrating (such as using concurrent
teslamate2_1  |     indexes with a migration_lock)
teslamate2_1  | 
teslamate2_1  | To fix the first issue, run "mix ecto.create".
teslamate2_1  | 
teslamate2_1  | To address the second, you can run "mix ecto.drop" followed by
teslamate2_1  | "mix ecto.create". Alternatively you may configure Ecto to use
teslamate2_1  | another table and/or repository for managing migrations:
teslamate2_1  | 
teslamate2_1  |     config :teslamate, TeslaMate.Repo,
teslamate2_1  |       migration_source: "some_other_table_for_schema_migrations",
teslamate2_1  |       migration_repo: AnotherRepoForSchemaMigrations
teslamate2_1  | 
teslamate2_1  | The full error report is shown below.
teslamate2_1  | 
teslamate2_1  | ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2911ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
teslamate2_1  | 
teslamate2_1  |   1. Tracking down slow queries and making sure they are running fast enough
teslamate2_1  |   2. Increasing the pool_size (albeit it increases resource consumption)
teslamate2_1  |   3. Allowing requests to wait longer by increasing :queue_target and :queue_interval
teslamate2_1  | 
teslamate2_1  | See DBConnection.start_link/2 for more information
teslamate2_1  | 
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate2_1  |     (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
teslamate2_1  |     (teslamate 1.21.3) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0
pi_teslamate2_1 exited with code 0
teslamate2_1  | 2021-02-14 08:30:26.197 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:26.198 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:28.445 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:28.866 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:30:29.140 [error] Could not create schema migrations table. This error usually happens due to the following:
teslamate2_1  | 
teslamate2_1  |   * The database does not exist
teslamate2_1  |   * The "schema_migrations" table, which Ecto uses for managing
teslamate2_1  |     migrations, was defined by another library
teslamate2_1  |   * There is a deadlock while migrating (such as using concurrent
teslamate2_1  |     indexes with a migration_lock)
teslamate2_1  | 
teslamate2_1  | To fix the first issue, run "mix ecto.create".
teslamate2_1  | 
teslamate2_1  | To address the second, you can run "mix ecto.drop" followed by
teslamate2_1  | "mix ecto.create". Alternatively you may configure Ecto to use
teslamate2_1  | another table and/or repository for managing migrations:
teslamate2_1  | 
teslamate2_1  |     config :teslamate, TeslaMate.Repo,
teslamate2_1  |       migration_source: "some_other_table_for_schema_migrations",
teslamate2_1  |       migration_repo: AnotherRepoForSchemaMigrations
teslamate2_1  | 
teslamate2_1  | The full error report is shown below.
teslamate2_1  | 
teslamate2_1  | ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2959ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
teslamate2_1  | 
teslamate2_1  |   1. Tracking down slow queries and making sure they are running fast enough
teslamate2_1  |   2. Increasing the pool_size (albeit it increases resource consumption)
teslamate2_1  |   3. Allowing requests to wait longer by increasing :queue_target and :queue_interval
teslamate2_1  | 
teslamate2_1  | See DBConnection.start_link/2 for more information
teslamate2_1  | 
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate2_1  |     (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
teslamate2_1  |     (teslamate 1.21.3) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0
pi_teslamate2_1 exited with code 1

When googling around I found that sometimes the DATABASE_POOL_SIZE increase to 10 helped people with issues in which the database does not get created. So I added that to the teslamate2 service, and it did not solve the issue but it did reduce the lenght of the log to below.

Code:
pi@raspberrypi:~ $ docker-compose stop teslamate2
Stopping pi_teslamate2_1 ... done
pi@raspberrypi:~ $ docker-compose up teslamate2
Starting pi_teslamate2_1 ... done
Attaching to pi_teslamate2_1
teslamate2_1  | 2021-02-14 08:56:53.139 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:56:53.139 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:56:54.632 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:56:55.542 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate2" does not exist
teslamate2_1  | 2021-02-14 08:56:56.073 [error] Could not create schema migrations table. This error usually happens due to the following:
teslamate2_1  | 
teslamate2_1  |   * The database does not exist
teslamate2_1  |   * The "schema_migrations" table, which Ecto uses for managing
teslamate2_1  |     migrations, was defined by another library
teslamate2_1  |   * There is a deadlock while migrating (such as using concurrent
teslamate2_1  |     indexes with a migration_lock)
teslamate2_1  | 
teslamate2_1  | To fix the first issue, run "mix ecto.create".
teslamate2_1  | 
teslamate2_1  | To address the second, you can run "mix ecto.drop" followed by
teslamate2_1  | "mix ecto.create". Alternatively you may configure Ecto to use
teslamate2_1  | another table and/or repository for managing migrations:
teslamate2_1  | 
teslamate2_1  |     config :teslamate, TeslaMate.Repo,
teslamate2_1  |       migration_source: "some_other_table_for_schema_migrations",
teslamate2_1  |       migration_repo: AnotherRepoForSchemaMigrations
teslamate2_1  | 
teslamate2_1  | The full error report is shown below.
teslamate2_1  | 
teslamate2_1  | ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2948ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
teslamate2_1  | 
teslamate2_1  |   1. Tracking down slow queries and making sure they are running fast enough
teslamate2_1  |   2. Increasing the pool_size (albeit it increases resource consumption)
teslamate2_1  |   3. Allowing requests to wait longer by increasing :queue_target and :queue_interval
teslamate2_1  | 
teslamate2_1  | See DBConnection.start_link/2 for more information
teslamate2_1  | 
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate2_1  |     (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
teslamate2_1  |     (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
teslamate2_1  |     (teslamate 1.21.3) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0
pi@raspberrypi:~ $

I hope this helps to get closer to a resolution.
Big thank you in advance for your help!
 
I'd recommend looking at the Github project (adriankumpf/teslamate), including the Discussions there. The project author has clearly stated support for multiple Tesla accounts won't be coming in the core project (Support for multiple Tesla Accounts? · Issue #661 · adriankumpf/teslamate) but you might find better help for solving this particular challenge directly there.

I have raised it there too with the progress so far.
In case anything comes out of that which works, I will cross-post here.
 
I'd recommend looking at the Github project (adriankumpf/teslamate), including the Discussions there. The project author has clearly stated support for multiple Tesla accounts won't be coming in the core project (Support for multiple Tesla Accounts? · Issue #661 · adriankumpf/teslamate) but you might find better help for solving this particular challenge directly there.

I have given up on the option to have 2 instances of TeslaMate via Docker running on 1 Raspberry Pi; I did not get it working and there was no further hints how to resolve ... also logically I tried different paths with even separate databases, but without success.
So I will go for a 2nd Raspberry Pi 4 Model B with another Samsung T5 SSD.
 
I would try to get some logs from it. Try stopping it so it doesn't restart and then starting it up attached.

Code:
docker-compose stop teslamate2
docker-compose up teslamate2

With your help, and that of another person on TeslaMate's GitHub I managed to get it working! So thank you!

After fiddling a little around I got it working! Let me share my steps and things which did not work for those who want to do the same.

I first tried to rename the docker-compose.yml file in the home folder for the first Tesla & Tesla account to docker-compose-1.yml, and create a new docker-compose-2.yml in the same home folder for the second Tesla & Tesla account. But with this both docker-compose files became disabled to be executed from the terminal.

As a next try I kept the docker-compose.yml for the first Tesla & Tesla account in the home folder, and created in a separate folder (TeslaMate2) the docker-compose.yml for the second Tesla & Tesla account. And that did the job. Just to be sure I also defined a separate database for the 2nd Tesla & Tesla account.

So in my home directory I had following content in the docker-compose.yml:
Code:
version: "3"

services:
  teslamate:
   image: teslamate/teslamate:latest
   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:1.6
   restart: always
   ports:
     - 1883:1883
   volumes:
     - mosquitto-conf:/mosquitto/config
     - mosquitto-data:/mosquitto/data

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

In the folder TeslaMate2 I have created a docker-compose.yml file with following content:
Code:
version: "3"

services:
  teslamate2:
   image: teslamate/teslamate:latest
   restart: always
   environment:
     - DATABASE_USER=teslamate
     - DATABASE_PASS=secret
     - DATABASE_NAME=teslamate2
     - DATABASE_HOST=database2
     - MQTT_HOST=mosquitto2
   ports:
     - 4001:4000
   volumes:
     - ./import:/opt/app/import
   cap_drop:
     - all

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

  grafana2:
   image: teslamate/grafana:latest
   restart: always
   environment:
     - DATABASE_USER=teslamate
     - DATABASE_PASS=secret
     - DATABASE_NAME=teslamate2
     - DATABASE_HOST=database2
   ports:
     - 3001:3000
   volumes:
     - teslamate-grafana2-data:/var/lib/grafana

  mosquitto2:
   image: eclipse-mosquitto:1.6
   restart: always
   ports:
     - 1884:1883
   volumes:
     - mosquitto2-conf:/mosquitto/config
     - mosquitto2-data:/mosquitto/data

volumes:
  teslamate-db2:
  teslamate-grafana2-data:
  mosquitto2-conf:
  mosquitto2-data:

And with that I got 2 instances of TeslaMate working on 1 Raspberry Pi. I can now access both Tesla's via following url's from a browser:
One tweak I can suggest in case you want to import data from for instance TeslaFi into TeslaMate. Please run in a terminal "sudo chmod 777 import" in both home folder as in the folder in which the docker-compose.yml of the 2nd Tesla is located. If you do not do this, then you are not able to import TeslaFi data put in the import folder ... at least that happened to me.
 
  • Like
Reactions: focher
Is there a way to delete a location from my history? I did a factory reset on my newly-acquired 85D and then installed Teslamate, but the car thought it was in Palo Alto ... I followed the instructions here to delete the 'drive' from Tesla HQ to my house, but the location still shows up on the 'Locations' and 'Trips' dashboards.

TIA

JB
 
Very, very cool app. I've been using it locally since June running off a Raspberry PI (dockerized) and just upgraded to the Traefik/Let'sEncrypt configuration this evening. All my data is preserved. The automatic SSL cert issuance is very sweet!
@oscarfish, I am looking to externalize my Teslamate instance. What was the basic approach you took to add Traefik/Let'sEncrypt? A full rebuild, or edit your docker-compose.yml? I use Let's Encrypt for other servers, but I'm don't know how to best modify my existing docker container to layer these in?

TIA,

Toneus
 
@oscarfish, I am looking to externalize my Teslamate instance. What was the basic approach you took to add Traefik/Let'sEncrypt? A full rebuild, or edit your docker-compose.yml? I use Let's Encrypt for other servers, but I'm don't know how to best modify my existing docker container to layer these in?
I used pivpn to get remote access to my pi running TeslaMate - I opted for OpenVPN instead of WireGuard. Works great from my Android phone and laptop using an OpenVPN client. A bit harder to get access to since you have to establish the VPN first, but I consider it a bit more secure than allowing direct access to the TeslaMate/Grafana web servers. As a bonus, I also get VPN access if I want to secure traffic over public WiFi or other untrusted networks.
 
I used pivpn to get remote access to my pi running TeslaMate - I opted for OpenVPN instead of WireGuard. Works great from my Android phone and laptop using an OpenVPN client. A bit harder to get access to since you have to establish the VPN first, but I consider it a bit more secure than allowing direct access to the TeslaMate/Grafana web servers. As a bonus, I also get VPN access if I want to secure traffic over public WiFi or other untrusted networks.
This is a good point. I want to access the reports from the car, so I was thinking direct would be the natural way since I host my own domain. I haven't researched VPN through the car browser, so you've now given me something to do for the next hour. ;)
 
I use nginx to reverse proxy it. That includes a Let’s Encrypt certificate with nginx‘s automatic renewal configuration. All Docker containers, of course.

I do have a VPN into my home network, but nginx let’s me give access to a few things to friends that I don’t want on my network.
 
This is a good point. I want to access the reports from the car, so I was thinking direct would be the natural way since I host my own domain. I haven't researched VPN through the car browser, so you've now given me something to do for the next hour. ;)
Yeah, if you want to access TeslaMate from the in-car browser, you'll have to set up some sort of https/ssl/basic-auth.
 
Does anyone know of any reading from TeslaMate that can tell you your usable pack size? E.g.

1632337509585.jpeg
 
Teslamate is fantastic software. Ever wondered what happens to your car when you take it in for service? Well, wonder no longer. For example, if you wanted to know how often Tesla's technicians floor the accelerator when they test drive your car - and exactly where they drive it - Teslamate will record everything for you. I have to warn you, though - You might be better off not knowing. :)
 
  • Like
Reactions: WilliamG
Teslamate is fantastic software. Ever wondered what happens to your car when you take it in for service? Well, wonder no longer. For example, if you wanted to know how often Tesla's technicians floor the accelerator when they test drive your car - and exactly where they drive it - Teslamate will record everything for you. I have to warn you, though - You might be better off not knowing. :)
Yep. Agreed.
 
So, apparently, I still own a web site that I have been paying for. No web hosting atm.

Could I just follow these instructions to get Teslamate up and running for me?

 
So, apparently, I still own a web site that I have been paying for. No web hosting atm.

Could I just follow these instructions to get Teslamate up and running for me?

I self host on my Mac mini that's running 24/7.
 
Teslamate is fantastic software. Ever wondered what happens to your car when you take it in for service? Well, wonder no longer. For example, if you wanted to know how often Tesla's technicians floor the accelerator when they test drive your car - and exactly where they drive it - Teslamate will record everything for you. I have to warn you, though - You might be better off not knowing. :)

Interestingly, Tesla seems to have a way to bypass this data upload so you can't see it. My car was in service, and almost all of their test-drive trips were logged, but - curiously, an 8-mile trip wasn't. It's simply not logged. Very odd. My odometer just has a blank where it's missing those miles.