Snapshot errors
If you are having trouble dealing with an error, please let us know on the Discord.
Errorsβ
- Couldn't ensure that exactly {} snapshots exist because an error occurred: {}. For more information about snapshots, visit: memgr.ph/snapshots.
- Couldn't ensure that only the absolutely necessary WAL files exist because an error occurred: {}. For more details, visit: memgr.ph/snapshots.
What are snapshots?β
Database snapshots are like a view of a database as it was at a certain point in time. It is a read-only copy of the data that can be used for backup or data persistence. Memgraph will try to load the newest snapshot file on startup.
What to do with corrupt snapshots?β
Because snapshots are read-only, any modifications will result in corrupt files that won't be loaded. The solution is to delete the snapshot files and to start Memgraph again.
Why is data lost when Memgraph is restarted?β
- Docker π³
- Linux
Docker containers donβt persist data by default (all changes are lost when the
container is stopped). You need to use local volumes to store the data
permanently which is why Memgraph is started with the -v
flags:
docker run -p 7687:7687 -v mg_lib:/var/lib/memgraph memgraph/memgraph
More information on Docker Volumes can be found here.
Make sure that Memgraph is searching for the snapshot files in the right
directory. The Memgraph configuration is available in
/etc/memgraph/memgraph.conf
and you can specify the directory with the
--data-directory
flag. If the configuration file is altered, Memgraph needs to
be restarted. The default directory is /var/lib/memgraph
. To learn about all the
configuration options, check out the Reference
guide.
If you weren't able to find the error, please submit it through a Support Ticket so we can look into it and get back to you.