Docs / EventSourcingDB / Errors / backup-incomplete

backup-incomplete

A part of the backup ends without its end item, so it was cut.

  • Route: restore-backup
  • Description: backup is incomplete: a part ends without its end item, so it was cut short
  • Details: part, the place of the part in the backup, counting from 0, with the full backup as part 0.

Why It Happens#

Creating a backup ends each part with an end item, unless it breaks off. A restore checks for it: if the request body ends while a part is still open, the end of that part is missing, and possibly some of its events with it. Usually, creating the backup broke off, for example because the connection dropped, and what had arrived was kept anyway, or the file was cut later.

A part that was cut in the middle of a line is reported as backup-malformed for that line instead. A backup that the v1 API created has no end item, so it is not checked for one.

How to Fix It#

Create the backup again from that part on, and keep a part only once its stream has ended with the end item. EventSourcingDB has removed what it restored so far, so the database is empty again. Resending the request unchanged fails the same way.

Example#

For a restore whose full backup ends without its end item, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:

{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/backup-incomplete",
    "description": "backup is incomplete: a part ends without its end item, so it was cut short",
    "details": {
      "part": 0
    }
  }
}