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.
Did a clean OS build and OS updates. No additions (except for the .bash_aliases file).
Reboot. Completed the Docker install, no errors reported.
Reboot. Completed the Teslamate install, no errors.
Reboot.
Open the WEB browser.....
IP:3000 Grafana OK
IP:4000 "This site can not be reached"
"192.xxx.yyy.zzz refused to connect"

Yes, the yml file has the "ports: - 4000:4000" config set within the teslamate section
.
pi@raspberrypi:~/Docker/Teslamate $ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cd8254c58f59 eclipse-mosquitto:2 "/docker-entrypoint.…" 18 minutes ago Up 12 minutes 0.0.0.0:1883->1883/tcp, :::1883->1883/tcp teslamate_mosquitto_1
1b1bc5bfebc2 postgres:13 "docker-entrypoint.s…" 18 minutes ago Up 12 minutes 5432/tcp teslamate_database_1
0cb581c312ca teslamate/teslamate:latest "tini -- /bin/sh /en…" 18 minutes ago Restarting (1) 15 seconds ago teslamate_teslamate_1
99ec61f9e253 teslamate/grafana:latest "/run.sh" 18 minutes ago Up 12 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp teslamate_grafana_1
pi@raspberrypi:~/Docker/Teslamate $
Still getting the 'restarting' What can you see in the logs?
 
Still getting the 'restarting' What can you see in the logs?
The first error:
[[36mteslamate_1 |^[[0m waiting for postgres at database:5432
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:45.844 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:45.844 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:47.394 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:48.267 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:48.773 [error] Could not create schema migrations table. This error usually happens due to the following:
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m * The database does not exist
^[[36mteslamate_1 |^[[0m * The "schema_migrations" table, which Ecto uses for managing
^[[36mteslamate_1 |^[[0m migrations, was defined by another library
^[[36mteslamate_1 |^[[0m * There is a deadlock while migrating (such as using concurrent
^[[36mteslamate_1 |^[[0m indexes with a migration_lock)
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m To fix the first issue, run "mix ecto.create".
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m To address the second, you can run "mix ecto.drop" followed by
^[[36mteslamate_1 |^[[0m "mix ecto.create". Alternatively you may configure Ecto to use
^[[36mteslamate_1 |^[[0m another table and/or repository for managing migrations:
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m config :teslamate, TeslaMate.Repo,
^[[36mteslamate_1 |^[[0m migration_source: "some_other_table_for_schema_migrations",
^[[36mteslamate_1 |^[[0m migration_repo: AnotherRepoForSchemaMigrations
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m The full error report is shown below.
^[[36mteslamate_1 |^[[0m


This means nothing to me. Is it "as simple" as following the 'To Fix' instructions? Why the conflict on a clean install?
 
The first error:
[[36mteslamate_1 |^[[0m waiting for postgres at database:5432
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:45.844 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:45.844 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:47.394 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:48.267 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name$
^[[36mteslamate_1 |^[[0m 2021-10-21 18:19:48.773 [error] Could not create schema migrations table. This error usually happens due to the following:
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m * The database does not exist
^[[36mteslamate_1 |^[[0m * The "schema_migrations" table, which Ecto uses for managing
^[[36mteslamate_1 |^[[0m migrations, was defined by another library
^[[36mteslamate_1 |^[[0m * There is a deadlock while migrating (such as using concurrent
^[[36mteslamate_1 |^[[0m indexes with a migration_lock)
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m To fix the first issue, run "mix ecto.create".
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m To address the second, you can run "mix ecto.drop" followed by
^[[36mteslamate_1 |^[[0m "mix ecto.create". Alternatively you may configure Ecto to use
^[[36mteslamate_1 |^[[0m another table and/or repository for managing migrations:
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m config :teslamate, TeslaMate.Repo,
^[[36mteslamate_1 |^[[0m migration_source: "some_other_table_for_schema_migrations",
^[[36mteslamate_1 |^[[0m migration_repo: AnotherRepoForSchemaMigrations
^[[36mteslamate_1 |^[[0m
^[[36mteslamate_1 |^[[0m The full error report is shown below.
^[[36mteslamate_1 |^[[0m


This means nothing to me. Is it "as simple" as following the 'To Fix' instructions? Why the conflict on a clean install?
can you post your docker-compose.yml (there should be nothing sensitive in there assuming you've just gone for the default setup)
 
  • Helpful
Reactions: pkeller
Not sure yet, either average or plotting all data points. Maybe something like this?
BT85_s85_May-August2019.png.b90db18239b2d30f567b0a550ffbe0d7.png
Best I could do.

JSON:
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 61,
  "iteration": 1634920327085,
  "links": [
    {
      "icon": "dashboard",
      "tags": [],
      "title": "TeslaMate",
      "tooltip": "",
      "type": "link",
      "url": "[[base_url:raw]]"
    },
    {
      "asDropdown": true,
      "icon": "external link",
      "tags": [
        "tesla"
      ],
      "title": "Dashboards",
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "datasource": "TeslaMate",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "left",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "graph": false,
              "legend": false,
              "tooltip": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "kwatth"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Batt Level"
            },
            "properties": [
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 22,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "links": [],
      "options": {
        "graph": {},
        "legend": {
          "calcs": [
            "mean",
            "max",
            "min"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltipOptions": {
          "mode": "single"
        }
      },
      "pluginVersion": "7.5.10",
      "targets": [
        {
          "alias": "",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\n  battery_level as \"Batt Level\",\n  \n  AVG(charger_power) as \"Average Charge Power\",\n  MAX(charger_power) as \"Max Charge Power\",\n  MIN(charger_power) as \"Min Charge Power\"\n  \nFROM  \n  charges \n  \nWHERE fast_charger_brand = 'Tesla'\n  AND $__timeFilter(date)\n  \nGROUP BY battery_level\nORDER BY battery_level\n\n\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Charger Power vs SOC",
      "transformations": [],
      "type": "timeseries"
    }
  ],
  "refresh": false,
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "Tonto",
          "value": "1"
        },
        "datasource": "TeslaMate",
        "definition": "SELECT name AS __text, id AS __value FROM cars;",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Car",
        "multi": false,
        "name": "car_id",
        "options": [],
        "query": "SELECT name AS __text, id AS __value FROM cars;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "https://teslamate.maclaren.org.uk",
          "value": "https://teslamate.maclaren.org.uk"
        },
        "datasource": "TeslaMate",
        "definition": "select base_url from settings limit 1;",
        "description": null,
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "base_url",
        "options": [],
        "query": "select base_url from settings limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1y",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Charger Power vs SOC",
  "uid": "1tsvnsd7k",
  "version": 5
}
 
Have a look at this:


1 line to add to the yml file so won't take long to see if it fixes the issue
Lots of errors: (appears to be data base 'teslamate" does not exist)
- Added "- DATABASE_POOL_SIZE=10" to the environment section of the yml file
- ran "docker-compose down -v && docker-compose up"
As soon as the installation process end, it seems to be in a loop...... I'll send the log files.
 
Lots of errors: (appears to be data base 'teslamate" does not exist)
- Added "- DATABASE_POOL_SIZE=10" to the environment section of the yml file
- ran "docker-compose down -v && docker-compose up"
As soon as the installation process end, it seems to be in a loop...... I'll send the log files.
I stopped (^c) the "installation" as it did not appear to be making any progress. Also I no longer have the graphics WEB page.
 

Attachments

  • Teslamate_Debug_2.zip
    4 KB · Views: 44
Last edited:
I stopped (^c) the "installation" as it did not appear to be making any progress. Also I no longer have the graphics WEB page.
Just noticed that I entered " DATABASE_POOLSIZE=10" missed the "_" in POOL_SIZE. Looks like the same failure though. Ctrl_C'd out.

from the screen
database_1 | 1970-01-01 00:00:00.000 UTC [33] FATAL: database "teslamate" does not exist
database_1 | 1970-01-01 00:00:00.000 UTC [34] FATAL: database "teslamate" does not exist
teslamate_1 | 2021-10-22 20:05:45.478 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate" does not exist

teslamate_1 | 2021-10-22 20:05:45.478 [error] Postgrex.Protocol (#PID<0.165.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "teslamate" does not exist
database_1 | 1970-01-01 00:00:00.000 UTC [35] FATAL: database "teslamate" does not exist
 
I tried adding the - DATABASE_POOL_SIZE=10 to the .yml file. No difference. The teslamate database is still not being created.

I also tried a pool size of 15, 20 and 25. Still doesn't work.

My log outputs are identical to Philpkeller's
 
Last edited: