{"record":{"id":"32384bed8da44f8b","repo":"ory/hydra","slug":"new-request-s","errorCode":null,"errorMessage":"new request: %s","messagePattern":"new request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/fetcher/fetcher.go","lineNumber":163,"sourceCode":"\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}()\n\t}\n\n\treq, err := retryablehttp.NewRequestWithContext(ctx, http.MethodGet, source, nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"new request: %s\", redactedSource(source))\n\t}\n\tres, err := f.hc.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, redactedSource(source))\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, errors.Errorf(\"expected http response status code 200 but got %d when fetching: %s\", res.StatusCode, redactedSource(source))\n\t}\n\n\tif f.limit > 0 {\n\t\tvar buf bytes.Buffer\n\t\tn, err := io.Copy(&buf, io.LimitReader(res.Body, f.limit+1))\n\t\tif n > f.limit {\n\t\t\treturn nil, bytes.ErrTooLarge\n\t\t}\n\t\tif err != nil {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/fetcher/fetcher.go#L145-L181","documentation":"Returned by fetchRemote when retryablehttp.NewRequestWithContext rejects the source URL — the URL is malformed for the HTTP client (bad control characters, invalid percent-encoding, or unparseable host), even though scheme dispatch accepted it. The source is redacted in the message to avoid leaking embedded credentials.","triggerScenarios":"Thrown at oryx/fetcher/fetcher.go:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["URL-encode or clean the source string so net/url can parse it","Validate the configured source URL at startup with url.ParseRequestURI","Check for stray whitespace, newlines, or unescaped characters in the URL"],"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"}