{"record":{"id":"923ea5c6c8045291","repo":"ory/hydra","slug":"unable-to-base64-decode-the-location","errorCode":null,"errorMessage":"unable to base64 decode the location","messagePattern":"unable to base64 decode the location","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/osx/file.go","lineNumber":197,"sourceCode":"\t\tresp, err := o.hc.Get(parsed.String())\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to load remote file\")\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tbytes, err = io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to read the HTTP response body\")\n\t\t}\n\tcase \"base64\":\n\t\tif o.disableBase64Loader {\n\t\t\treturn nil, errors.New(\"base64 loader disabled\")\n\t\t}\n\n\t\tif o.disableResilientBase64Loader {\n\t\t\tbytes, err = o.base64enc.DecodeString(strings.TrimPrefix(source, \"base64://\"))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"unable to base64 decode the location\")\n\t\t\t}\n\t\t\treturn bytes, nil\n\t\t}\n\n\t\tfor _, enc := range []*base64.Encoding{\n\t\t\tbase64.StdEncoding,\n\t\t\tbase64.URLEncoding,\n\t\t\tbase64.RawURLEncoding,\n\t\t\tbase64.RawStdEncoding,\n\t\t} {\n\t\t\tbytes, err = enc.DecodeString(strings.TrimPrefix(source, \"base64://\"))\n\t\t\tif err == nil {\n\t\t\t\treturn bytes, nil\n\t\t\t}\n\t\t}\n\n\t\treturn nil, errors.Wrap(err, \"unable to base64 decode the location\")\n\tdefault:","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/osx/file.go#L179-L215","documentation":"Returned by readFile in strict base64 mode (WithDisabledResilientBase64Loader set) when the payload after base64:// fails standard base64 decoding. The encoded payload contains invalid characters, wrong padding, or line breaks that strict StdEncoding rejects; the resilient RawStdEncoding path that tolerates some of these is disabled.","triggerScenarios":"Thrown at oryx/osx/file.go:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the payload with standard base64 (padding included, no newlines)","Remove whitespace/newlines from the embedded base64 string","Re-enable the resilient base64 loader if the source cannot be re-encoded"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}