ory/hydra · error

unable to load remote file

Error message

unable to load remote file

What it means

Returned by readFile when the configured HTTP client's GET request for an http(s):// source fails at the transport level — DNS failure, connection refused, TLS error, or timeout. The remote file was never fetched; the wrapped error identifies the network cause.

Source

Thrown at oryx/osx/file.go:181

			return nil, errors.Wrap(err, "unable to read the file")
		}
	case "file":
		if o.disableFileLoader {
			return nil, errors.New("file loader disabled")
		}

		//#nosec G304 -- false positive
		bytes, err = os.ReadFile(parsed.Host + parsed.Path)
		if err != nil {
			return nil, errors.Wrap(err, "unable to read the file")
		}
	case "http", "https":
		if o.disableHTTPLoader {
			return nil, errors.New("http(s) loader disabled")
		}
		resp, err := o.hc.Get(parsed.String())
		if err != nil {
			return nil, errors.Wrap(err, "unable to load remote file")
		}
		defer resp.Body.Close()

		bytes, err = io.ReadAll(resp.Body)
		if err != nil {
			return nil, errors.Wrap(err, "unable to read the HTTP response body")
		}
	case "base64":
		if o.disableBase64Loader {
			return nil, errors.New("base64 loader disabled")
		}

		if o.disableResilientBase64Loader {
			bytes, err = o.base64enc.DecodeString(strings.TrimPrefix(source, "base64://"))
			if err != nil {
				return nil, errors.Wrap(err, "unable to base64 decode the location")
			}
			return bytes, nil

View on GitHub (pinned to 4174065ffb)

Solutions

  1. Check network connectivity, DNS, and the URL's host for typos
  2. If TLS fails, verify certificates or configure the custom HTTP client via WithHTTPClient
  3. Retry transient network failures; consider a client with retry policy
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at oryx/osx/file.go:181 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ory/hydra@4174065ffb (2026-09-03). Data as JSON: /api/errors/0fda36ffdfcc0ed8. Report an issue: GitHub.