Unrecoverable data loss or corruption has occurred
Indicates unrecoverable data loss or corruption was detected during the operation. This is a very serious error that requires immediate attention.
- 1A file being read by the server was found to be corrupt on disk.
- 2A hardware failure (e.g., disk or memory) caused data corruption.
- 3The server detected a consistency violation in its database that indicates data has been lost.
A server attempts to read a record from a database, but the record is malformed or partially missing due to data corruption.
// 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.
// 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.
// 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.
✕ Retry the operation
The data is gone or corrupt. Retrying the operation will not bring it back and will continue to fail.
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev