{"record":{"id":"56415642b7a90721","repo":"signalapp/Signal-Server","slug":"failed-to-delete-backup","errorCode":null,"errorMessage":"Failed to delete backup","messagePattern":"Failed to delete backup","errorType":"exception","errorClass":"SecureValueRecoveryException","httpStatus":null,"severity":"error","filePath":"service/src/main/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecoveryClient.java","lineNumber":93,"sourceCode":"    final HttpRequest request = HttpRequest.newBuilder()\n        .uri(deleteUri)\n        .DELETE()\n        .header(HttpHeaders.AUTHORIZATION, basicAuthHeader(credentials))\n        .build();\n\n    return httpClient.sendAsync(request, HttpResponse.BodyHandlers.ofString()).thenApply(response -> {\n      if (HttpUtils.isSuccessfulResponse(response.statusCode())) {\n        return null;\n      }\n\n      final List<Integer> allowedErrors = allowedDeletionErrorStatusCodes.get();\n      if (allowedErrors.contains(response.statusCode())) {\n        logger.warn(\"Ignoring failure to delete svr entry for identifier {} with status {}\",\n            userIdentifier, response.statusCode());\n        return null;\n      }\n      logger.warn(\"Failed to delete svr entry for identifier {} with status {}\", userIdentifier, response.statusCode());\n      throw new SecureValueRecoveryException(\"Failed to delete backup\", String.valueOf(response.statusCode()));\n    });\n  }\n\n}\n","sourceCodeStart":75,"sourceCodeEnd":98,"githubUrl":"https://github.com/signalapp/Signal-Server/blob/100ab61c82627582c867d19e1c0561ba2781e927/service/src/main/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecoveryClient.java#L75-L98","documentation":"SecureValueRecoveryClient.removeData DELETEs a user's SVR backup and expects a success status. On failure, it throws SecureValueRecoveryException('Failed to delete backup', status) after logging; only explicitly allowed error codes are swallowed and treated as success. Callers (account deletion flows) get this exception whenever the SVR service rejects the deletion.","triggerScenarios":"Calling removeData (e.g. during account deletion) when the SVR service returns a non-success HTTP status not in allowedErrors — service outage, unknown account/backup id, or authentication failure against the SVR peer.","commonSituations":"SVR backend down or degraded during bulk account deletions, mismatched credentials/config for the remote SVR service, or new status codes (e.g. 410 Gone, 404) not yet added to allowedErrors.","solutions":["Check the logged status code ('Failed to delete svr entry ... with status <code>') to identify the SVR rejection reason.","If the status is benign (e.g. 404 for an already-deleted backup), add it to allowedErrors in removeData.","Verify connectivity/credentials to the Secure Value Recovery service.","Retry the deletion if the failure was transient (5xx); account deletion jobs typically retry.","Catch SecureValueRecoveryException in the deletion flow and proceed/degrade appropriately per product policy."],"exampleFix":"// before\nthrow new SecureValueRecoveryException(\"Failed to delete backup\", String.valueOf(response.statusCode()));\n\n// after: treat 404 as already-deleted\nSet<Integer> allowedErrors = Set.of(401, 403, 404);\nif (allowedErrors.contains(response.statusCode())) {\n  return null;\n}\nthrow new SecureValueRecoveryException(\"Failed to delete backup\", String.valueOf(response.statusCode()));","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  svrClient.removeData(accountIdentifier);\n} catch (SecureValueRecoveryException e) {\n  logger.warn(\"SVR delete failed with status {} — continuing account deletion\", e.getStatus());\n  // decide per policy: retry later, or proceed since local deletion is authoritative\n}","preventionTips":["Keep allowedErrors current as SVR service statuses evolve (e.g. treat 404/410 as success).","Make account-deletion jobs idempotent and retrying so transient SVR failures self-heal.","Alert on sustained 'Failed to delete svr entry' warnings indicating SVR outages or auth misconfig."],"tags":["http","backup","account-deletion","svr"],"backgroundTag":"http-error-response","analyzedSha":"100ab61c82627582c867d19e1c0561ba2781e927","analyzedAt":"2026-09-09T13:29:47.883Z","contentChangedAt":"2026-09-09T13:29:47.883Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}