{"record":{"id":"5ff412651253ab21","repo":"AlistGo/alist","slug":"failed-to-copy-file-w","errorCode":null,"errorMessage":"failed to copy file: %w","messagePattern":"failed to copy file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/azure_blob/util.go","lineNumber":320,"sourceCode":"\t\t\t\treturn fmt.Errorf(\"failed to create directory [%s]: %w\", dstPath, err)\n\t\t\t}\n\t\t}\n\n\t\t// Delete source directory and its contents\n\t\tif err := d.deleteFolder(ctx, srcPath); err != nil {\n\t\t\tlog.Warnf(\"failed to delete source directory [%s]: %v\\n, and try again\", srcPath, err)\n\t\t\t// Retry deletion once more and ignore the result\n\t\t\tif err := d.deleteFolder(ctx, srcPath); err != nil {\n\t\t\t\tlog.Errorf(\"Retry deletion of source directory [%s] failed: %v\", srcPath, err)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// Single file move or rename operation\n\tif err := d.copyFile(ctx, srcPath, dstPath); err != nil {\n\t\treturn fmt.Errorf(\"failed to copy file: %w\", err)\n\t}\n\n\t// Delete source file after successful copy\n\tif err := d.deleteFile(ctx, srcPath, false); err != nil {\n\t\tlog.Errorf(\"Error deleting source file [%s]: %v\", srcPath, err)\n\t}\n\treturn nil\n}\n\n// optimizedUploadOptions returns the optimal upload options based on file size\nfunc optimizedUploadOptions(fileSize int64) *azblob.UploadStreamOptions {\n\toptions := &azblob.UploadStreamOptions{\n\t\tBlockSize:   4 * 1024 * 1024, // 4MB block size\n\t\tConcurrency: 4,               // Default concurrency\n\t}\n\n\t// For large files, increase block size and concurrency\n\tif fileSize > 256*1024*1024 { // For files larger than 256MB","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/azure_blob/util.go#L302-L338","documentation":"Error \"failed to copy file: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/azure_blob/util.go:320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}