Hi, I have been running Teslamate for some time, and was setting it up on another machine and noticed that the docker-compose sample now shows v12 for postgres but mine was still v11. I didn't know when this changed from using v11 to v12.
When I changed my yml file to use v12, and restarted the containers, the database doesn't start and I think this sums up the issue - seems the internal formal have changed for the database. I do have the full log below.
database_1 | 2020-03-28 07:26:36.390 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:36.390 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
I did see this documentation that outlines how to upgrade, but I was curious on what the best way to do this is? Would a postgres upgrade like this work better? And what happens if I stick with v11.
BTW I only realized this when I got into this situation, maybe we can help make it a little more obvious. :)
Thanks,
Amit.
Attaching to teslamate_database_1, teslamate_mosquitto_1, teslamate_teslamate_1, teslamate_grafana_1
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
mosquitto_1 | 1585380396: mosquitto version 1.6.9 starting
mosquitto_1 | 1585380396: Config loaded from /mosquitto/config/mosquitto.conf.
mosquitto_1 | 1585380396: Opening ipv4 listen socket on port 1883.
mosquitto_1 | 1585380396: Opening ipv6 listen socket on port 1883.
database_1 | 2020-03-28 07:26:36.390 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:36.390 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
grafana_1 | installing pr0ps-trackmap-panel @ 2.0.4
grafana_1 | from: https://grafana.com/api/plugins/pr0ps-trackmap-panel/versions/2.0.4/download
grafana_1 | into: /var/lib/grafana/plugins
grafana_1 |
grafana_1 | ✔ Installed pr0ps-trackmap-panel successfully
grafana_1 |
grafana_1 | Restart grafana after installing plugins . <service grafana-server restart>
grafana_1 |
grafana_1 | installing natel-discrete-panel @ 0.0.9
grafana_1 | from: https://grafana.com/api/plugins/natel-discrete-panel/versions/0.0.9/download
grafana_1 | into: /var/lib/grafana/plugins
grafana_1 |
teslamate_1 | waiting for postgres at database:5432 (2sec)
grafana_1 | ✔ Installed natel-discrete-panel successfully
grafana_1 |
grafana_1 | Restart grafana after installing plugins . <service grafana-server restart>
grafana_1 |
grafana_1 | installing grafana-piechart-panel @ 1.4.0
grafana_1 | from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.4.0/download
grafana_1 | into: /var/lib/grafana/plugins
grafana_1 |
grafana_1 | ✔ Installed grafana-piechart-panel successfully
grafana_1 |
grafana_1 | Restart grafana after installing plugins . <service grafana-server restart>
grafana_1 |
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Starting Grafana" logger=server version=6.7.1 commit=ca6d08d5cb br
anch=HEAD compiled=2020-03-20T13:13:09+0000
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/d
efaults.ini
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.
paths.data=/var/lib/grafana"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.
paths.logs=/var/log/grafana"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.
paths.plugins=/var/lib/grafana/plugins"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.
paths.provisioning=/etc/grafana/provisioning"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.
log.mode=console"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_PATHS_DATA=/var/lib/grafana"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_PATHS_LOGS=/var/log/grafana"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_PATHS_PLUGINS=/var/lib/grafana/plugins"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_PATHS_PROVISIONING=/etc/grafana/provisioning"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_ANALYTICS_REPORTING_ENABLED=FALSE"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_SECURITY_ADMIN_USER=admin"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_SECURITY_ADMIN_PASSWORD=*********"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_SECURITY_DISABLE_GRAVATAR=true"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_SECURITY_ALLOW_EMBEDDING=true"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_USERS_ALLOW_SIGN_UP=false"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_AUTH_ANONYMOUS_ENABLED=true"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="
GF_AUTH_BASIC_ENABLED=false"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="App mode production" logger=settings
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing SqlStore" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Starting DB migration" logger=migrator
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing HTTPServer" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing BackendPluginManager" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing PluginManager" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Starting plugin search" logger=plugins
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Registering plugin" logger=plugins name="Pie Chart"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Registering plugin" logger=plugins name=Discrete
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Registering plugin" logger=plugins name=TrackMap
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing HooksService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing OSSLicensingService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing InternalMetricsService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing RemoteCache" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing RenderingService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing AlertEngine" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing QuotaService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing ServerLockService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing UserAuthTokenService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing DatasourceCacheService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing LoginService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing SearchService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing TracingService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing UsageStatsService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing CleanUpService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing NotificationService" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing provisioningServiceImpl" logger=server
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Backend rendering via phantomJS" logger=rendering renderer=phantom
JS
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=warn msg="phantomJS is deprecated and will be removed in a future release. Y
ou should consider migrating from phantomJS to grafana-image-renderer plugin. Read more at https://grafana.com/docs/grafan
a/latest/administration/image_rendering/" logger=rendering renderer=phantomJS
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="Initializing Stream Manager"
grafana_1 | t=2020-03-28T07:26:39+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=
http subUrl= socket=
teslamate_database_1 exited with code 0
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
database_1 | 2020-03-28 07:26:41.336 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:41.336 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
teslamate_1 | waiting for postgres at database:5432 (4sec)
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
database_1 | 2020-03-28 07:26:43.669 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:43.669 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
teslamate_database_1 exited with code 1
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
database_1 | 2020-03-28 07:26:46.211 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:46.211 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
teslamate_1 | waiting for postgres at database:5432 (8sec)
teslamate_database_1 exited with code 1
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
database_1 | 2020-03-28 07:26:49.482 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:49.482 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
teslamate_database_1 exited with code 1
database_1 |
database_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1 |
database_1 | 2020-03-28 07:26:54.422 UTC [1] FATAL: database files are incompatible with server
database_1 | 2020-03-28 07:26:54.422 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which
is not compatible with this version 12.2 (Debian 12.2-2.pgdg100+1).
teslamate_1 | waiting for postgres at database:5432 (16sec)
teslamate_database_1 exited with code 1
I did see this documentation that outlines how to upgrade, but I was curious on what the best way to do this is? Would a postgres upgrade like this work better?
What's wrong with following the five steps outlined in the documentation?
And what happens if I stick with v11.
Each major version of Postgres receives updates for 5 years after its initial release. Postgres 11 is supported until November 9, 2023. Until then you don't have to upgrade if you don't want to. In this case, you only need to change the docker-compose.yml file to use v11 again.
I am not sure if I can restore the backup - I tried to restore this on a windows machine (with docker running) but can't get the restore command running. Let me kick off another issue on backing up and restoring as I am seeing a lot of issues around that. And then will come back here and clean this up.
I did end up going with the documentation which had some bugs but seem to have been fixed in the new docs. Thanks.