Teslamate: FATAL: database "teslamate" does not exist

Created on 9 Dec 2019  路  7Comments  路  Source: adriankumpf/teslamate

I just installed teslamate using the docker-compose file in your guide:
https://github.com/adriankumpf/teslamate/blob/master/docs/installation/docker.md.

All installations go fine, but the database teslamate is not created. How can I fix this? The error is as follows:

FATAL: database "teslamate" does not exist

question

All 7 comments

What's the output of docker-compose down && docker-compose up?

the docker-compose file contains:

version: '3'

services:
  teslamate:
    image: teslamate/teslamate:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=db
      - MQTT_HOST=mosquitto
    ports:
      - 4000:4000
    cap_drop:
      - all

  db:
    image: postgres:11
    restart: always
    environment:
      - POSTGRES_USER=teslamate
      - POSTGRES_PASSWORD=secret
    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=db
    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:

The generated output is:

root@DS918:/volume2/@docker# docker-compose down && docker-compose up
Removing network docker_default
Creating network "docker_default" with the default driver
Creating docker_teslamate_1 ... done
Creating docker_db_1        ... done
Creating docker_grafana_1   ... done
Creating docker_mosquitto_1 ... done
Attaching to docker_teslamate_1, docker_db_1, docker_mosquitto_1, docker_grafana_1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
db_1         | WARNING: no logs are available with the 'db' log driver
mosquitto_1  | WARNING: no logs are available with the 'db' log driver
grafana_1    | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1
teslamate_1  | WARNING: no logs are available with the 'db' log driver
docker_teslamate_1 exited with code 1

and this keeps going.

Any news on this issue?

Based on your https://github.com/adriankumpf/teslamate/issues/300#issuecomment-565810900, have you solved the problem? Please provide the full logs. If you're running it on a synology you might have to check out its Docker UI.

I uploaded my logs in the #300 section

Thanks! Do you get the same error if - DATABASE_POOL_SIZE=10 is added to the teslamate service in _docker-compose.yml_ and you run docker-compose down -v && docker-compose up?

Seems that that addition to the docker-compose.yml did the trick. Now installs the dockers and I can now login. Thanks for that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netkruzer picture netkruzer  路  6Comments

virtualm2000 picture virtualm2000  路  4Comments

spacecosmos picture spacecosmos  路  5Comments

DrMichael picture DrMichael  路  4Comments

petariga picture petariga  路  5Comments