{"record":{"id":"e6b5358a4ca39f85","repo":"duplicati/duplicati","slug":"get-failed","errorCode":null,"errorMessage":"Get failed","messagePattern":"Get failed","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Duplicati/Library/Backend/AliyunOSS/AliyunOSSBackend.cs","lineNumber":235,"sourceCode":"        }\n\n        public async Task GetAsync(string remotename, Stream stream, CancellationToken cancelToken)\n        {\n            var bucketName = _ossOptions.BucketName;\n            var objectName = $\"{_ossOptions.Path.TrimPath()}/{remotename}\".TrimPath();\n            var client = GetClient(false);\n\n            try\n            {\n                var obj = await Utility.Utility.WithTimeout(_timeouts.ShortTimeout, cancelToken, async ct\n                    => await Task.Factory.FromAsync(\n                        (cb, state) => client.BeginGetObject(bucketName, objectName, null, null),\n                        client.EndGetObject,\n                        null).ConfigureAwait(false)\n                    ).ConfigureAwait(false);\n\n                if (obj.HttpStatusCode != HttpStatusCode.OK)\n                    throw new Exception(\"Get failed\");\n\n                using (var requestStream = obj.Content)\n                using (var timeoutStream = stream.ObserveWriteTimeout(_timeouts.ReadWriteTimeout, false))\n                    await Utility.Utility.CopyStreamAsync(requestStream, timeoutStream, cancelToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                Logging.Log.WriteErrorMessage(LOGTAG, \"Get\", ex, \"Get failed: {0}\", ex.Message);\n                throw;\n            }\n        }\n\n        public async Task RenameAsync(string oldname, string newname, CancellationToken cancelToken)\n        {\n            var bucketName = _ossOptions.BucketName;\n\n            var sourceBucket = bucketName;\n","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/Duplicati/Library/Backend/AliyunOSS/AliyunOSSBackend.cs#L217-L253","documentation":"Thrown by AliyunOSSBackend.GetAsync when the Aliyun OSS BeginGetObject/EndGetObject call returns an HTTP status other than 200 OK. The download is rejected at the API level; the exception is then logged via Logging.Log and re-thrown unchanged.","triggerScenarios":"GetAsync awaits the FromAsync get and checks obj.HttpStatusCode != OK, throwing before copying the stream. Non-200 occurs when the object does not exist (404), credentials are invalid, or the path is wrong. The outer catch logs 'Get failed' and re-throws the original exception.","commonSituations":"Requested remote file does not exist in the bucket; wrong path prefix configured; expired credentials returning 403; object in a different storage class requiring restore before read.","solutions":["Confirm the remote object name exists in the bucket (list the folder/path prefix).","Verify the configured path prefix and credentials are correct for the bucket.","If the object is archived (e.g. IA/Archive class), restore it in OSS before attempting a read.","Check the OSS response status/error code in the server log to distinguish 404 from 403."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await backend.GetAsync(remotename, stream, cancelToken);\n}\ncatch (Exception ex) when (ex.Message == \"Get failed\")\n{\n    // Non-200; commonly 404 (missing) or 403 (auth). List the prefix to distinguish.\n    Log.Error(\"OSS get rejected (non-200) for {Name}; check existence and credentials\", remotename);\n    throw;\n}","preventionTips":["List the remote prefix before reading to confirm the object exists.","Keep credentials and the path prefix consistent between put and get operations.","Restore archived objects in OSS before attempting to read them."],"tags":["aliyun-oss","backend","download","object-storage","api"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}