DATA_LOSS
gRPCERRORServer-SideHIGH confidence

Unrecoverable data loss or corruption has occurred

What this means

Indicates unrecoverable data loss or corruption was detected during the operation. This is a very serious error that requires immediate attention.

Why it happens
  1. 1A file being read by the server was found to be corrupt on disk.
  2. 2A hardware failure (e.g., disk or memory) caused data corruption.
  3. 3The server detected a consistency violation in its database that indicates data has been lost.
How to reproduce

A server attempts to read a record from a database, but the record is malformed or partially missing due to data corruption.

trigger — this will error
trigger — this will error
// Server-side handler detects corruption
async getUser(call, callback) {
  try {
    const userRecord = await db.read(call.request.userId);
    if (isCorrupt(userRecord)) {
      // This is a critical error.
      return callback({ code: grpc.status.DATA_LOSS });
    }
  } catch (err) {
    // ...
  }
}

expected output

StatusCode.DATA_LOSS: Unrecoverable data loss or corruption has occurred

Fix 1

Immediately Alert and Investigate

WHEN As soon as this error is detected.

Immediately Alert and Investigate
// This is a manual process, not a code fix.
// 1. Trigger a high-priority alert to the on-call engineer.
// 2. Isolate the affected system to prevent further damage.
// 3. Begin investigation using server logs and monitoring tools.

Why this works

DATA_LOSS is a critical failure that cannot be fixed by code. It requires immediate human intervention to assess the damage and restore from backups.

Fix 2

Restore from Backup

WHEN After the extent of the data loss is understood.

Restore from Backup
// This is a manual data-recovery process.
// Example: Restore a database from the last known good snapshot.
psql -U user db_name < /backups/last_good_snapshot.sql

Why this works

The only way to recover from permanent data loss is to restore the data from a trusted backup.

What not to do

Retry the operation

The data is gone or corrupt. Retrying the operation will not bring it back and will continue to fail.

Sources

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All gRPC errors