{"record":{"id":"85696871e7c84826","repo":"duplicati/duplicati","slug":"list-verify-failed-for-file-f-name-size-was-f","errorCode":null,"errorMessage":"List verify failed for file: {f.Name}, size was {f.Size} but expected to be {size}","messagePattern":"List verify failed for file: (.+?), size was (.+?) but expected to be (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Duplicati/Library/Main/Backend/BackendManager.PutOperation.cs","lineNumber":332,"sourceCode":"\n            if (TrackedInDb)\n            {\n                Context.Database.LogRemoteVolumeUpdated(RemoteFilename, RemoteVolumeState.Uploaded, size, hash);\n                await OnDbUpdate().ConfigureAwait(false);\n            }\n\n            Context.Statwriter.SendEvent(BackendActionType.Put, BackendEventType.Completed, RemoteFilename, size);\n\n            if (Context.Options.ListVerifyUploads)\n            {\n                // The backend is bound to the file's folder (for non-folder backends) or\n                // the root (for folder-enabled backends using a flat verify), so the\n                // listing returns names comparable to the effective remote name.\n                var f = await backend.ListAsync(cancelToken).FirstOrDefaultAsync(n => n.Name.Equals(effectiveName, StringComparison.OrdinalIgnoreCase)).ConfigureAwait(false);\n                if (f == null)\n                    throw new Exception(string.Format($\"List verify failed, file was not found after upload: {RemoteFilename}\"));\n                else if (f.Size != size && f.Size >= 0)\n                    throw new Exception(string.Format($\"List verify failed for file: {f.Name}, size was {f.Size} but expected to be {size}\"));\n            }\n\n            // Create and upload a parity companion file (best-effort) while the\n            // just-uploaded local file is still on disk.\n            await MaybeCreateAndUploadParityAsync(backend, cancelToken).ConfigureAwait(false);\n\n            DeleteLocalFile();\n        }\n\n        /// <summary>\n        /// If parity is enabled and this operation is a data volume (block or fileset),\n        /// creates a parity companion file for the just-uploaded local file and uploads it.\n        /// This is best-effort: any failure is logged and does not fail the backup.\n        /// </summary>\n        /// <param name=\"backend\">The backend to upload to</param>\n        /// <param name=\"cancelToken\">The cancellation token</param>\n        private async Task MaybeCreateAndUploadParityAsync(IBackend backend, CancellationToken cancelToken)\n        {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/Duplicati/Library/Main/Backend/BackendManager.PutOperation.cs#L314-L350","documentation":"Thrown by PutOperation.ExecuteAsync during upload verification when ListVerifyUploads is true, the file IS found in the post-upload listing, but its reported size does not match the uploaded size (and the reported size is non-negative, since some backends report -1 for unknown). This catches cases where the upload reported success but the backend stored a different number of bytes — indicating corruption, truncation, or a backend-level modification.","triggerScenarios":"Executing a PutOperation with ListVerifyUploads enabled, the file is found in the listing (f != null), but f.Size != size (the uploaded byte count) and f.Size >= 0. Causes: backend applied server-side compression or encoding; upload was truncated; backend dedup stored only a partial object; backend reports metadata size vs actual size; concurrent modification of the same remote key.","commonSituations":"S3 lifecycle rules or CloudFront transforming objects; backend with server-side encryption adding/altering size metadata; compression enabled at the storage layer; backend returning Content-Length header from metadata rather than actual stored size; race with another uploader overwriting the same key.","solutions":["Verify no server-side processing (compression, encoding) is altering the stored object","Check the backend's reported size mechanism — some backends report metadata size, not object size","Disable ListVerifyUploads if the backend has known size-reporting quirks and rely on download-hash verification","Ensure no concurrent processes are overwriting the same remote key","Compare the uploaded size (local file length) with what the backend management console shows"],"exampleFix":"// before: list verify size mismatch on S3 with lifecycle transform\n// options: --list-verify-uploads=true\nawait putOp.ExecuteAsync(backend, token); // throws [453]\n\n// after: disable size verify for backends with known metadata quirks\nif (backendHasSizeMetadataQuirk)\n    Context.Options.ListVerifyUploads = false;\n// Rely on download + hash verification during restore instead","handlingStrategy":"validation","validationCode":"// Pre-check: verify backend does not transform objects server-side\nif (BackendHasServerSideTransform(backendUrl))\n{\n    logger.LogWarning(\"Backend may alter object sizes; disabling ListVerifyUploads\");\n    options.ListVerifyUploads = false;\n}","typeGuard":null,"tryCatchPattern":"try { await putOp.ExecuteAsync(backend, token); }\ncatch (Exception ex) when (ex.Message.Contains(\"List verify failed\") && ex.Message.Contains(\"size was\"))\n{\n    logger.LogWarning(\"Post-upload size mismatch — backend may report metadata size. \" +\n        \"Consider disabling ListVerifyUploads for this backend.\");\n    throw;\n}","preventionTips":["Disable ListVerifyUploads for backends with known size-reporting quirks","Verify no server-side compression, encoding, or lifecycle rules alter objects","Confirm the backend's listing reports actual object size, not metadata size","Rely on hash verification during download as the primary integrity check"],"tags":["backend","upload","verification","size-mismatch","listing","list-verify"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}