{"record":{"id":"38f2db5b1779b8a4","repo":"ory/hydra","slug":"unsupported-dsn-type","errorCode":null,"errorMessage":"unsupported DSN type","messagePattern":"unsupported DSN type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"driver/registry.go","lineNumber":59,"sourceCode":"\tconsent.Registry\n\tjwk.Registry\n\ttrust.Registry\n\toauth2.Registry\n\totelx.Provider\n\tx.NetworkProvider\n\n\tkratos.Provider\n\n\tfosite.Transactional\n}\n\nfunc newRegistryWithoutInit(c *config.DefaultProvider, l *logrusx.Logger) (*RegistrySQL, error) {\n\tscheme, _, _ := strings.Cut(c.DSN(), \"://\")\n\tif !pop.DialectSupported(pop.CanonicalDialect(scheme)) {\n\t\tif dbal.IsSQLite(c.DSN()) {\n\t\t\treturn 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.\")\n\t\t}\n\t\treturn nil, errors.New(\"unsupported DSN type\")\n\t}\n\n\treturn &RegistrySQL{\n\t\tl:           l,\n\t\tconf:        c,\n\t\tinitialPing: defaultInitialPing,\n\t}, nil\n}\n\nfunc callRegistry(ctx context.Context, r *RegistrySQL) {\n\tr.ClientValidator()\n\tr.ClientManager()\n\tr.ClientHasher()\n\tr.ConsentManager()\n\tr.ConsentStrategy()\n\tr.KeyManager()\n\tr.KeyCipher()\n\tr.FlowCipher()","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/driver/registry.go#L41-L77","documentation":"When pop does not support the DSN's dialect (scheme prefix like mysql://, oracle://, typo://) and it is not a SQLite DSN, newRegistryWithoutInit fails with the generic 'unsupported DSN type' error. Hydra only supports postgres, mysql, cockroach (and sqlite when built in).","triggerScenarios":"Calling driver.New with a DSN whose scheme is not a pop-supported dialect — e.g. `mongodb://...`, `oracle://...`, an empty DSN string, or a typo like `postgresq://`.","commonSituations":"Using an unsupported database behind Hydra; typos in the DSN scheme; DSN environment variable empty or missing its scheme prefix; copy-paste from another app.","solutions":["Set ORY_HYDRA_DSN / config dsn to postgres://, mysql://, or cockroach:// URL","Fix typos in the DSN scheme and ensure the scheme prefix is present","If you intended SQLite, use a binary/image built with sqlite support (see the sqlite variant error)"],"exampleFix":"// before\n-e DSN=mongodb://localhost:27017/hydra\n// after\n-e DSN=postgres://user:pass@host:5432/hydra?sslmode=disable","handlingStrategy":"validation","validationCode":"var supported = map[string]bool{\"postgres\": true, \"postgresql\": true, \"mysql\": true, \"cockroach\": true, \"sqlite\": true}\nscheme, _, _ := strings.Cut(dsn, \"://\")\nif !supported[scheme] {\n    return fmt.Errorf(\"unsupported DSN scheme %q; use postgres, mysql or cockroach\", scheme)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the DSN at deploy time before starting Hydra","Never point Hydra at untested database engines","Keep DSNs in checked templates so typos are caught in review"],"tags":["database","dsn","config","hydra"],"backgroundTag":"unsupported-dsn-scheme","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"}