teslamate icon indicating copy to clipboard operation
teslamate copied to clipboard

Backup not working

Open Luxa88 opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

when I want to launch a backup I use the following command: docker compose exec -T database pg_dump -U teslamate teslamate > /opt/teslamate.bck

Expected Behavior

Creating the Backup File

Steps To Reproduce

Running the command

Relevant log output

service "database" is not running

Screenshots

image

Additional data

No response

Type of installation

Docker

Version

Newest

Luxa88 avatar Jan 13 '24 13:01 Luxa88

Apparently somethng wrong with the database? What gives docker compose logs database?

DrMichael avatar Jan 13 '24 13:01 DrMichael

2024-01-13 12:44:33.483 UTC [61] LOG: checkpoint starting: time 2024-01-13 12:44:35.493 UTC [61] LOG: checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.006 s, sync=0.001 s, total=2.010 s; sync files=13, longest=0.001 s, average=0.001 s; distance=94 kB, estimate=272 kB 2024-01-13 12:49:33.566 UTC [61] LOG: checkpoint starting: time 2024-01-13 12:49:35.274 UTC [61] LOG: checkpoint complete: wrote 18 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.705 s, sync=0.002 s, total=1.709 s; sync files=15, longest=0.001 s, average=0.001 s; distance=60 kB, estimate=251 kB 2024-01-13 12:54:33.361 UTC [61] LOG: checkpoint starting: time 2024-01-13 12:54:34.067 UTC [61] LOG: checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.703 s, sync=0.002 s, total=0.706 s; sync files=8, longest=0.001 s, average=0.001 s; distance=27 kB, estimate=229 kB 2024-01-13 12:59:33.158 UTC [61] LOG: checkpoint starting: time 2024-01-13 12:59:34.266 UTC [61] LOG: checkpoint complete: wrote 12 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.103 s, sync=0.002 s, total=1.108 s; sync files=7, longest=0.001 s, average=0.001 s; distance=50 kB, estimate=211 kB 2024-01-13 13:02:02.732 UTC [1] LOG: received fast shutdown request 2024-01-13 13:02:02.733 UTC [1] LOG: aborting any active transactions 2024-01-13 13:02:02.733 UTC [79] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.734 UTC [20323] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.734 UTC [78] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.734 UTC [73] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.735 UTC [76] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.738 UTC [71] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.739 UTC [72] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.739 UTC [70] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.741 UTC [74] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.742 UTC [75] FATAL: terminating connection due to administrator command 2024-01-13 13:02:02.746 UTC [1] LOG: background worker "logical replication launcher" (PID 66) exited with exit code 1 2024-01-13 13:02:02.748 UTC [61] LOG: shutting down 2024-01-13 13:02:02.749 UTC [61] LOG: checkpoint starting: shutdown immediate 2024-01-13 13:02:02.751 UTC [61] LOG: checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.004 s; sync files=0, longest=0.000 s, average=0.000 s; distance=0 kB, estimate=190 kB 2024-01-13 13:02:02.777 UTC [1] LOG: database system is shut down PostgreSQL Database directory appears to contain a database; Skipping initialization 2024-01-13 13:02:03.286 UTC [1] LOG: starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit 2024-01-13 13:02:03.287 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2024-01-13 13:02:03.287 UTC [1] LOG: listening on IPv6 address "::", port 5432 2024-01-13 13:02:03.288 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2024-01-13 13:02:03.291 UTC [29] LOG: database system was shut down at 2024-01-13 13:02:02 UTC 2024-01-13 13:02:03.295 UTC [1] LOG: database system is ready to accept connections 2024-01-13 13:02:03.363 UTC [33] LOG: PID 72 in cancel request did not match any process 2024-01-13 13:02:03.363 UTC [34] LOG: PID 76 in cancel request did not match any process 2024-01-13 13:02:03.364 UTC [35] LOG: PID 79 in cancel request did not match any process 2024-01-13 13:02:03.365 UTC [37] LOG: PID 78 in cancel request did not match any process 2024-01-13 13:02:03.367 UTC [36] LOG: PID 20323 in cancel request did not match any process 2024-01-13 13:02:04.363 UTC [44] LOG: PID 74 in cancel request did not match any process 2024-01-13 13:02:04.363 UTC [43] LOG: PID 75 in cancel request did not match any process 2024-01-13 13:02:04.363 UTC [45] LOG: PID 71 in cancel request did not match any process 2024-01-13 13:02:04.364 UTC [47] LOG: PID 73 in cancel request did not match any process 2024-01-13 13:02:04.365 UTC [46] LOG: PID 70 in cancel request did not match any process 2024-01-13 13:07:03.390 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:07:03.395 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.005 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB 2024-01-13 13:22:03.638 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:22:10.458 UTC [27] LOG: checkpoint complete: wrote 70 buffers (0.4%); 0 WAL file(s) added, 0 removed, 0 recycled; write=6.816 s, sync=0.002 s, total=6.820 s; sync files=25, longest=0.002 s, average=0.001 s; distance=525 kB, estimate=525 kB 2024-01-13 13:27:03.523 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:27:07.837 UTC [27] LOG: checkpoint complete: wrote 44 buffers (0.3%); 0 WAL file(s) added, 0 removed, 1 recycled; write=4.309 s, sync=0.002 s, total=4.314 s; sync files=10, longest=0.001 s, average=0.001 s; distance=395 kB, estimate=512 kB 2024-01-13 13:32:03.868 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:32:13.397 UTC [27] LOG: checkpoint complete: wrote 96 buffers (0.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=9.524 s, sync=0.002 s, total=9.529 s; sync files=27, longest=0.001 s, average=0.001 s; distance=502 kB, estimate=511 kB 2024-01-13 13:37:03.452 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:37:04.159 UTC [27] LOG: checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.703 s, sync=0.002 s, total=0.707 s; sync files=8, longest=0.002 s, average=0.001 s; distance=25 kB, estimate=462 kB 2024-01-13 13:42:03.255 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:42:04.762 UTC [27] LOG: checkpoint complete: wrote 16 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.504 s, sync=0.001 s, total=1.508 s; sync files=13, longest=0.001 s, average=0.001 s; distance=61 kB, estimate=422 kB 2024-01-13 13:47:03.820 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:47:04.525 UTC [27] LOG: checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.702 s, sync=0.002 s, total=0.706 s; sync files=7, longest=0.001 s, average=0.001 s; distance=35 kB, estimate=383 kB 2024-01-13 13:57:03.702 UTC [27] LOG: checkpoint starting: time 2024-01-13 13:57:04.508 UTC [27] LOG: checkpoint complete: wrote 9 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.803 s, sync=0.002 s, total=0.807 s; sync files=7, longest=0.001 s, average=0.001 s; distance=34 kB, estimate=348 kB 2024-01-13 14:02:03.597 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:02:05.705 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.106 s, sync=0.001 s, total=2.109 s; sync files=13, longest=0.001 s, average=0.001 s; distance=99 kB, estimate=323 kB 2024-01-13 14:07:03.757 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:07:05.467 UTC [27] LOG: checkpoint complete: wrote 18 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.705 s, sync=0.002 s, total=1.710 s; sync files=13, longest=0.001 s, average=0.001 s; distance=78 kB, estimate=299 kB 2024-01-13 14:17:03.570 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:17:04.678 UTC [27] LOG: checkpoint complete: wrote 12 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.104 s, sync=0.002 s, total=1.109 s; sync files=7, longest=0.001 s, average=0.001 s; distance=47 kB, estimate=274 kB 2024-01-13 14:32:03.914 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:32:06.224 UTC [27] LOG: checkpoint complete: wrote 24 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.306 s, sync=0.001 s, total=2.310 s; sync files=13, longest=0.001 s, average=0.001 s; distance=113 kB, estimate=258 kB 2024-01-13 14:37:03.313 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:37:04.821 UTC [27] LOG: checkpoint complete: wrote 16 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.504 s, sync=0.001 s, total=1.508 s; sync files=8, longest=0.001 s, average=0.001 s; distance=74 kB, estimate=239 kB 2024-01-13 14:42:03.857 UTC [27] LOG: checkpoint starting: time 2024-01-13 14:42:04.863 UTC [27] LOG: checkpoint complete: wrote 11 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.003 s, sync=0.002 s, total=1.007 s; sync files=7, longest=0.001 s, average=0.001 s; distance=50 kB, estimate=220 kB 2024-01-13 15:02:04.108 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:02:09.622 UTC [27] LOG: checkpoint complete: wrote 56 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.511 s, sync=0.002 s, total=5.515 s; sync files=24, longest=0.001 s, average=0.001 s; distance=418 kB, estimate=418 kB 2024-01-13 15:07:04.715 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:07:09.529 UTC [27] LOG: checkpoint complete: wrote 50 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.810 s, sync=0.002 s, total=4.815 s; sync files=15, longest=0.002 s, average=0.001 s; distance=530 kB, estimate=530 kB 2024-01-13 15:12:04.570 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:12:13.092 UTC [27] LOG: checkpoint complete: wrote 86 buffers (0.5%); 0 WAL file(s) added, 0 removed, 0 recycled; write=8.519 s, sync=0.002 s, total=8.523 s; sync files=36, longest=0.001 s, average=0.001 s; distance=318 kB, estimate=509 kB 2024-01-13 15:17:04.173 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:17:06.885 UTC [27] LOG: checkpoint complete: wrote 28 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.708 s, sync=0.002 s, total=2.712 s; sync files=15, longest=0.001 s, average=0.001 s; distance=93 kB, estimate=467 kB 2024-01-13 15:22:04.968 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:22:06.978 UTC [27] LOG: checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.005 s, sync=0.002 s, total=2.010 s; sync files=15, longest=0.002 s, average=0.001 s; distance=66 kB, estimate=427 kB 2024-01-13 15:27:05.072 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:27:08.182 UTC [27] LOG: checkpoint complete: wrote 32 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.108 s, sync=0.002 s, total=3.111 s; sync files=19, longest=0.001 s, average=0.001 s; distance=118 kB, estimate=396 kB 2024-01-13 15:32:05.258 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:32:07.368 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.106 s, sync=0.002 s, total=2.110 s; sync files=15, longest=0.001 s, average=0.001 s; distance=74 kB, estimate=364 kB 2024-01-13 15:37:05.435 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:37:07.443 UTC [27] LOG: checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.005 s, sync=0.002 s, total=2.009 s; sync files=14, longest=0.002 s, average=0.001 s; distance=77 kB, estimate=335 kB 2024-01-13 15:42:05.464 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:42:07.574 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.106 s, sync=0.002 s, total=2.110 s; sync files=14, longest=0.001 s, average=0.001 s; distance=84 kB, estimate=310 kB 2024-01-13 15:47:05.665 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:47:07.574 UTC [27] LOG: checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.905 s, sync=0.002 s, total=1.910 s; sync files=14, longest=0.001 s, average=0.001 s; distance=78 kB, estimate=287 kB 2024-01-13 15:52:05.625 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:52:07.433 UTC [27] LOG: checkpoint complete: wrote 19 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.805 s, sync=0.002 s, total=1.808 s; sync files=14, longest=0.001 s, average=0.001 s; distance=78 kB, estimate=266 kB 2024-01-13 15:57:05.499 UTC [27] LOG: checkpoint starting: time 2024-01-13 15:57:07.608 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.105 s, sync=0.002 s, total=2.109 s; sync files=14, longest=0.001 s, average=0.001 s; distance=91 kB, estimate=248 kB 2024-01-13 16:02:05.698 UTC [27] LOG: checkpoint starting: time 2024-01-13 16:02:07.706 UTC [27] LOG: checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.005 s, sync=0.002 s, total=2.009 s; sync files=14, longest=0.001 s, average=0.001 s; distance=88 kB, estimate=232 kB 2024-01-13 16:07:05.770 UTC [27] LOG: checkpoint starting: time 2024-01-13 16:07:07.680 UTC [27] LOG: checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.906 s, sync=0.002 s, total=1.910 s; sync files=14, longest=0.002 s, average=0.001 s; distance=87 kB, estimate=218 kB

Luxa88 avatar Jan 13 '24 16:01 Luxa88

To create a backup, the docker compose stacks needs to be running, as you will export data out of the database, which needed to run in the first place. So before starting a backup, you need to do a docker compose up -d

JakobLichterfeld avatar Jan 19 '24 13:01 JakobLichterfeld

And take down the teslamate service before running the back command. docker compose stop teslamate

As described in https://docs.teslamate.org/docs/maintenance/backup_restore

DrMichael avatar Jan 19 '24 13:01 DrMichael

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 19 '24 01:02 github-actions[bot]