TeslaMate Version 2.2.0 Fails to Start After Postgres Restore #5035
-
|
Hi all, I'm new here and first of all I would like to say thank you for this project and for the community's support. Keep up the excellent work! 😉 I have some issues when I try to update my TeslaMate container to version 2.2.0 after restoring a Postgres 18-trixie backup. The same happens if I use other Postgres version 17-trixe for example but only after restore... Version 2.2.0 works fine on an empty database (DB), but it crashes after the restore. See the logs below/here: (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3(elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2 The same restore works fine on the previous Container version 2.1.1. I followed the steps in the documentation step by step: https://docs.teslamate.org/docs/maintenance/backup_restore. I'm not an expert and I'm wondering why it didn't work with version 2.2.0. Any suggestions? Thanks a lot in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 14 replies
-
|
I might also encounter the same issue, upgrading from 1.31.1 straight to 2.2.0. teslamate logsubuntu@my-server:~/TeslaMate$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3ba9397ee858 teslamate/teslamate:latest "tini -- /bin/dash /…" 20 minutes ago Restarting (1) 9 seconds ago teslamate-teslamate-1
010bc4184999 postgres:18-trixie "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 5432/tcp teslamate-database-1
2f3666beae35 teslamate/grafana:latest "/run.sh" 20 minutes ago Up 20 minutes 3000/tcp teslamate-grafana-1
0375e87297d3 eclipse-mosquitto:2 "/docker-entrypoint.…" 20 minutes ago Up 20 minutes 127.0.0.1:1883->1883/tcp teslamate-mosquitto-1
b96cd0023e34 traefik:v3.6.1 "/entrypoint.sh --gl…" 20 minutes ago Up 20 minutes 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:443->443/udp, [::]:443->443/udp teslamate-proxy-1
ubuntu@my-server:~/TeslaMate$
ubuntu@my-server:~/TeslaMate$ sudo docker compose logs teslamate
teslamate-1 | 2025-11-14 01:34:52.217 [info] == Running 20250407155134 TeslaMate.Repo.Migrations.UpgradeEarthdistance.change/0 forward
teslamate-1 | 2025-11-14 01:34:52.220 [info] execute "ALTER EXTENSION earthdistance UPDATE"
teslamate-1 | 2025-11-14 01:34:52.220 [info] version "1.2" of extension "earthdistance" is already installed
teslamate-1 | 2025-11-14 01:34:52.221 [info] == Migrated 20250407155134 in 0.0s
teslamate-1 | 2025-11-14 01:34:52.253 [info] == Running 20250613133700 TeslaMate.Repo.Migrations.AddAndCalculateElevationChanges.up/0 forward
teslamate-1 | 2025-11-14 01:34:52.253 [info] alter table drives
teslamate-1 | 2025-11-14 01:34:52.254 [info] execute "WITH elevation_changes AS (\n SELECT\n drive_id,\n COALESCE(NULLIF(LEAST(SUM(CASE WHEN elevation_diff > 0 THEN elevation_diff ELSE 0 END), 32768), 32768), 0) as ascent,\n COALESCE(NULLIF(LEAST(SUM(CASE WHEN elevation_diff < 0 THEN ABS(elevation_diff) ELSE 0 END), 32768), 32768), 0) as descent\n FROM (\n SELECT\n drive_id,\n elevation - LAG(elevation) OVER (PARTITION BY drive_id ORDER BY date) as elevation_diff\n FROM positions\n WHERE elevation IS NOT NULL\n ) as changes\n GROUP BY drive_id\n)\nUPDATE drives d\nSET\n ascent = ec.ascent,\n descent = ec.descent\nFROM elevation_changes ec\nWHERE d.id = ec.drive_id;\n"
teslamate-1 | 2025-11-14 01:34:56.963 [info] == Migrated 20250613133700 in 4.7s
teslamate-1 | 2025-11-14 01:34:56.966 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:34:56.966 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:34:56.966 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:34:56.966 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:34:57.973 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:34:57.976 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:34:57.976 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:34:57.976 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:34:59.052 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:34:59.054 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:34:59.054 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:34:59.054 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:00.349 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:00.351 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:00.352 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:00.352 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:02.048 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:02.050 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:02.051 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:02.051 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:04.547 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:04.549 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:04.550 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:04.550 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:08.658 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:08.661 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:08.661 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:08.661 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:16.002 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:16.005 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:16.005 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:16.005 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:29.710 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:29.712 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:29.713 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:29.713 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:35:56.220 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:35:56.223 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:35:56.223 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:35:56.223 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:36:48.362 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:36:48.364 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:36:48.365 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:36:48.365 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:37:49.353 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:37:49.356 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:37:49.357 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:37:49.357 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:38:50.279 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:38:50.282 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:38:50.282 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:38:50.282 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:39:51.168 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:39:51.171 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:39:51.171 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:39:51.171 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:40:52.112 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:40:52.114 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:40:52.115 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:40:52.115 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:41:53.050 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:41:53.052 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:41:53.052 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:41:53.052 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:42:53.950 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:42:53.953 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:42:53.953 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:42:53.953 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:43:54.942 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:43:54.945 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:43:54.946 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:43:54.946 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:44:55.928 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:44:55.931 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:44:55.931 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:44:55.931 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:45:56.899 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:45:56.902 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:45:56.902 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:45:56.902 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:46:57.830 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:46:57.832 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:46:57.833 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:46:57.833 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:47:58.730 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:47:58.733 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:47:58.733 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:47:58.733 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:48:59.652 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:48:59.654 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:48:59.655 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:48:59.655 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:35.100 [info] == Running 20250407155134 TeslaMate.Repo.Migrations.UpgradeEarthdistance.change/0 forward
teslamate-1 | 2025-11-14 01:52:35.108 [info] execute "ALTER EXTENSION earthdistance UPDATE"
teslamate-1 | 2025-11-14 01:52:35.109 [info] version "1.2" of extension "earthdistance" is already installed
teslamate-1 | 2025-11-14 01:52:35.110 [info] == Migrated 20250407155134 in 0.0s
teslamate-1 | 2025-11-14 01:52:35.146 [info] == Running 20250613133700 TeslaMate.Repo.Migrations.AddAndCalculateElevationChanges.up/0 forward
teslamate-1 | 2025-11-14 01:52:35.146 [info] alter table drives
teslamate-1 | 2025-11-14 01:52:35.147 [info] execute "WITH elevation_changes AS (\n SELECT\n drive_id,\n COALESCE(NULLIF(LEAST(SUM(CASE WHEN elevation_diff > 0 THEN elevation_diff ELSE 0 END), 32768), 32768), 0) as ascent,\n COALESCE(NULLIF(LEAST(SUM(CASE WHEN elevation_diff < 0 THEN ABS(elevation_diff) ELSE 0 END), 32768), 32768), 0) as descent\n FROM (\n SELECT\n drive_id,\n elevation - LAG(elevation) OVER (PARTITION BY drive_id ORDER BY date) as elevation_diff\n FROM positions\n WHERE elevation IS NOT NULL\n ) as changes\n GROUP BY drive_id\n)\nUPDATE drives d\nSET\n ascent = ec.ascent,\n descent = ec.descent\nFROM elevation_changes ec\nWHERE d.id = ec.drive_id;\n"
teslamate-1 | 2025-11-14 01:52:40.083 [info] == Migrated 20250613133700 in 4.9s
teslamate-1 | 2025-11-14 01:52:40.087 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:40.087 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:40.087 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:40.087 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:41.678 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:41.680 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:41.681 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:41.681 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:42.848 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:42.850 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:42.851 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:42.851 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:44.178 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:44.181 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:44.181 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:44.181 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:45.934 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:45.936 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:45.937 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:45.937 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:48.483 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:48.485 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:48.486 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:48.486 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:52.630 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:52.633 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:52.633 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:52.633 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:52:59.965 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:52:59.968 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:52:59.968 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:52:59.968 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:53:13.675 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:53:13.678 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:53:13.678 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:53:13.678 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:53:40.177 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:53:40.180 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:53:40.180 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:53:40.180 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:54:32.273 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:54:32.275 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:54:32.276 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:54:32.276 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
teslamate-1 | 2025-11-14 01:55:33.207 [info] == Running 20250924215353 TeslaMate.Repo.Migrations.CreatePrivateSchema.up/0 forward
teslamate-1 | 2025-11-14 01:55:33.210 [info] execute "CREATE SCHEMA IF NOT EXISTS private;"
teslamate-1 | 2025-11-14 01:55:33.210 [info] schema "private" already exists, skipping
teslamate-1 | 2025-11-14 01:55:33.210 [info] execute "ALTER TABLE public.tokens SET SCHEMA private;"
teslamate-1 | ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "tokens" already exists in schema "private"
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1098: Ecto.Adapters.SQL.raise_sql_call_error/1
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1219: Ecto.Adapters.SQL.execute_ddl/4
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
teslamate-1 | (ecto_sql 3.13.2) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
ubuntu@my-server:~/TeslaMate$ |
Beta Was this translation helpful? Give feedback.
-
|
Somehow you have both a public.tokens table and a private.tokens table. Which is a bit weird, because moving it over is an atomic operation. Oh, I wonder if you haven't emptied the database successfully between runs. Yep. That would explain it. The instructions only talk about dropping/recreating the public schema, not the private schema. As such when you run the migration the table will already exist in the private schema, hence the error. I think the instructions need to be amended to tell you to delete the private schema as well as the public schema. DROP SCHEMA private CASCADE;
CREATE SCHEMA private;The extensions are not required for the private schema. |
Beta Was this translation helpful? Give feedback.
-
|
I think I figured it out. I deleted the 'private' table with the command "DROP SCHEMA private CASCADE;" after the restore. It's working fine with the Teslamate container version 2.2.0." Excellent. Thanks, guys, for your help! ;) |
Beta Was this translation helpful? Give feedback.
-
|
Came back here to say I just updated from v2.1.1 to v2.2.0 without issues. My process was:
I'm using the latest Docker Engine v29 from https://docs.docker.com/engine/install/ubuntu/ |
Beta Was this translation helpful? Give feedback.
-
|
I ran into the same issue and finally figured out the root cause. According to the official docs, after recreating the Postgres container you should only start the database container first: docker compose up -d databaseHowever, I mistakenly ran: docker compose up -dThis started Teslamate before restoring the backup, and the first launch of Teslamate 2.2.0 automatically created the new To fix it, I redid the upgrade process following the docs exactly:
After doing this, Teslamate started correctly and all migrations completed without errors. Hope this helps anyone who hits the same problem! |
Beta Was this translation helpful? Give feedback.
-
|
try add a the teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- ENCRYPTION_KEY=<you_key>
- DATABASE_USER=teslamate
- DATABASE_PASS=<password>
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
depends_on:
database:
condition: service_started
mosquitto:
condition: service_started
|
Beta Was this translation helpful? Give feedback.
-
|
Since I have the stack deployed via Portainer, I went ahead, created a psql dump, stopped the containers, removed the db volume, updated the stack definition in the UI, started the stack, all services came up. I then (prematurely) proceeded with the restore and I ran into the same error, token table already exists. Docs then say before restore I missed the detail where it said I think the docs contradict themselves a bit, it says to compose down everything on the upgrading postgres page, but in the backup restore page (which is separate to the upgrading postgres page), it says to stop the teslamate service, implying it was running before - but it shouldn't have been. Should've made sure teslamate doesn't start unless the restore is done. And since there's no easy way to bring a single service (database in this instance) via the Portainer UI, adding Before restoring the dump (in addition to the public schema creation) seems to do the trick. In my case correct order of events would've been |
Beta Was this translation helpful? Give feedback.
I think I figured it out. I deleted the 'private' table with the command "DROP SCHEMA private CASCADE;" after the restore. It's working fine with the Teslamate container version 2.2.0."
Excellent. Thanks, guys, for your help! ;)