ory/hydra · error

The DSN connection string looks like a SQLite connection, bu

Error message

The DSN connection string looks like a SQLite connection, but SQLite support was not built into the binary. Please check if you have downloaded the correct binary or are using the correct Docker Image. Binary archives and Docker Images indicate SQLite support by appending the -sqlite suffix.

What it means

newRegistryWithoutInit inspects the DSN's scheme and checks whether pop (the ORM) supports that dialect. When the scheme looks like SQLite (dbal.IsSQLite matches) but the binary was compiled without SQLite support (no `-sqlite` build tag), it returns this explanatory error instead of a generic failure.

Source

Thrown at driver/registry.go:57

	x.RegistryCookieStore
	client.Registry
	consent.Registry
	jwk.Registry
	trust.Registry
	oauth2.Registry
	otelx.Provider
	x.NetworkProvider

	kratos.Provider

	fosite.Transactional
}

func newRegistryWithoutInit(c *config.DefaultProvider, l *logrusx.Logger) (*RegistrySQL, error) {
	scheme, _, _ := strings.Cut(c.DSN(), "://")
	if !pop.DialectSupported(pop.CanonicalDialect(scheme)) {
		if dbal.IsSQLite(c.DSN()) {
			return nil, errors.New("The DSN connection string looks like a SQLite connection, but SQLite support was not built into the binary. Please check if you have downloaded the correct binary or are using the correct Docker Image. Binary archives and Docker Images indicate SQLite support by appending the -sqlite suffix.")
		}
		return nil, errors.New("unsupported DSN type")
	}

	return &RegistrySQL{
		l:           l,
		conf:        c,
		initialPing: defaultInitialPing,
	}, nil
}

func callRegistry(ctx context.Context, r *RegistrySQL) {
	r.ClientValidator()
	r.ClientManager()
	r.ClientHasher()
	r.ConsentManager()
	r.ConsentStrategy()
	r.KeyManager()

View on GitHub (pinned to 4174065ffb)

Solutions

  1. Use a DSN for a fully supported database (postgres, mysql, cockroach) matching your deployment
  2. Download/build a binary or Docker image with the -sqlite suffix for local development, e.g. oryd/hydra:-sqlite variant or build with the sqlite build tag
  3. Set the DSN via ORY_HYDRA_DSN to the correct database URL

Example fix

// before (docker run)
-e DSN=sqlite:///var/lib/sqlite/db.sqlite
// after (postgres)
-e DSN=postgres://user:pass@host:5432/hydra?sslmode=disable
Defensive patterns

Strategy: validation

Validate before calling

func dsnSupportsBinary(dsn string) error {
    if strings.HasPrefix(dsn, "sqlite") || strings.HasPrefix(dsn, "file:") {
        if !sqliteBuildTagEnabled {
            return errors.New("this binary lacks sqlite support; use the -sqlite image/binary or a postgres/mysql DSN")
        }
    }
    return nil
}

Prevention

When it happens

Trigger: Starting Hydra (driver.New) with a DSN like `sqlite://foo.db` or `file:foo.db` while the binary/Docker image was built without the sqlite build tag — e.g. the standard `oryd/hydra` image (non-sqlite variant).

Common situations: Using the default oryd/hydra Docker image for local development with sqlite; downloading the plain binary release instead of the -sqlite one; following an old tutorial that predates the image split.

Related errors


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