{"record":{"id":"90bb9b6a2c02f56d","repo":"ory/hydra","slug":"errunknownscheme","errorCode":"ErrUnknownScheme","errorMessage":"unknown scheme in source: ","messagePattern":"unknown scheme in source: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/fetcher/fetcher.go","lineNumber":140,"sourceCode":"\t\treturn nil, errors.WithStack(fmt.Errorf(\"%w: in source %q: allowed schemes: %s\", ErrUnknownScheme, redactedSource(source), strings.Join(f.schemes, \", \")))\n\t}\n\tswitch {\n\tcase strings.HasPrefix(source, \"http://\"), strings.HasPrefix(source, \"https://\"):\n\t\treturn f.fetchRemote(ctx, source)\n\tcase strings.HasPrefix(source, \"file://\"):\n\t\tb, err := os.ReadFile(strings.TrimPrefix(source, \"file://\"))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"read file: %s\", redactedSource(source))\n\t\t}\n\t\treturn b, nil\n\tcase strings.HasPrefix(source, \"base64://\"):\n\t\tsrc, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(source, \"base64://\"))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"base64decode: %s\", redactedSource(source))\n\t\t}\n\t\treturn src, nil\n\tdefault:\n\t\treturn nil, errors.Wrap(ErrUnknownScheme, \"unknown scheme in source: \"+redactedSource(source))\n\t}\n}\n\nfunc (f *Fetcher) fetchRemote(ctx context.Context, source string) (b []byte, err error) {\n\tif f.cache != nil {\n\t\tcacheKey := sha256.Sum256([]byte(source))\n\t\tif v, ok := f.cache.Get(cacheKey[:]); ok {\n\t\t\tb = make([]byte, len(v))\n\t\t\tcopy(b, v)\n\t\t\treturn b, nil\n\t\t}\n\t\tdefer func() {\n\t\t\tif err == nil && len(b) > 0 {\n\t\t\t\ttoCache := make([]byte, len(b))\n\t\t\t\tcopy(toCache, b)\n\t\t\t\tf.cache.SetWithTTL(cacheKey[:], toCache, int64(len(toCache)), f.ttl)\n\t\t\t}\n\t\t}()","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/fetcher/fetcher.go#L122-L158","documentation":"Returned by FetchBytes when the source string matches none of the allowed schemes (http://, https://, file://, base64://, inline passthrough). The scheme is not on the fetcher's allow-list, so the source is rejected before any I/O happens.","triggerScenarios":"Thrown at oryx/fetcher/fetcher.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the allowed scheme prefixes: http://, https://, file://, or base64://","Extend the fetcher's allowed schemes configuration if the scheme is legitimately needed","Check the source string for a missing or mistyped scheme prefix"],"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"}