{"record":{"id":"a04669643dda6599","repo":"juicedata/juicefs","slug":"open-s-s","errorCode":null,"errorMessage":"open %s: %s","messagePattern":"open (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/sql.go","lineNumber":186,"sourceCode":"\tvar searchPath string\n\tif driver == \"postgres\" {\n\t\turi = \"postgres://\" + uri\n\t\tdriver = \"pgx\"\n\n\t\tparse, err := url.Parse(uri)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parse url %s failed: %s\", uri, err)\n\t\t}\n\t\tsearchPath = parse.Query().Get(\"search_path\")\n\t\tif searchPath != \"\" {\n\t\t\tif len(strings.Split(searchPath, \",\")) > 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"currently, only one schema is supported in search_path\")\n\t\t\t}\n\t\t}\n\t}\n\tengine, err := xorm.NewEngine(driver, uri)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open %s: %s\", uri, err)\n\t}\n\tswitch logger.Level { // make xorm less verbose\n\tcase logrus.TraceLevel:\n\t\tengine.SetLogLevel(log.LOG_DEBUG)\n\tcase logrus.DebugLevel:\n\t\tengine.SetLogLevel(log.LOG_INFO)\n\tcase logrus.InfoLevel, logrus.WarnLevel:\n\t\tengine.SetLogLevel(log.LOG_WARNING)\n\tcase logrus.ErrorLevel:\n\t\tengine.SetLogLevel(log.LOG_ERR)\n\tdefault:\n\t\tengine.SetLogLevel(log.LOG_OFF)\n\t}\n\tif searchPath != \"\" {\n\t\tengine.SetSchema(searchPath)\n\t}\n\tengine.SetTableMapper(names.NewPrefixMapper(engine.GetTableMapper(), \"jfs_\"))\n\tif err := engine.Sync2(new(blob)); err != nil {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/sql.go#L168-L204","documentation":"xorm.NewEngine failed to construct the database engine for the given driver/URI. This wraps driver-registration and DSN validation failures — the database was never connected to; the URI is malformed for the chosen driver or the driver is unavailable in the build.","triggerScenarios":"newSQLStore called with a driver name xorm doesn't know (or that wasn't imported/registered), or a DSN string invalid for that driver (e.g. sqlite path with bad syntax, mysql DSN missing mandatory parameters).","commonSituations":"Typo in the driver part of the JuiceFS metadata URL (e.g. 'sqlite3://...' with lite build lacking the driver); malformed MySQL DSN options; unsupported scheme passed through.","solutions":["Check the metadata URL scheme matches a supported driver exactly: sqlite3://, mysql://, postgres://.","If using the juicefs.lite build, switch to the full binary — lite disables most SQL/KV drivers.","Validate the DSN against the driver's documented format (e.g. mysql: user:pass@tcp(host:3306)/db)."],"exampleFix":"// before\n./juicefs.lite format sqlite3://test.db myjfs   // driver not compiled in\n// after\n./juicefs format sqlite3://test.db myjfs        // full build registers sqlite3 driver","handlingStrategy":"try-catch","validationCode":"// ensure driver is registered in your build\nimport ( _ \"github.com/go-sql-driver/mysql\"; _ \"github.com/lib/pq\"; _ \"github.com/mattn/go-sqlite3\" )\nif !supportedDriver(driver) { return fmt.Errorf(\"driver %q not compiled in\", driver) }","typeGuard":null,"tryCatchPattern":"engine, err := xorm.NewEngine(driver, uri)\nif err != nil {\n    return fmt.Errorf(\"check driver name and DSN format for %q: %w\", driver, err)\n}","preventionTips":["Match the URL scheme to a supported driver exactly (sqlite3://, mysql://, postgres://).","Use the full juicefs binary when using SQL/KV metadata engines (lite build disables drivers).","Validate DSN against the driver's docs before deploying."],"tags":["sql","xorm","driver","config"],"backgroundTag":"invalid-url-format","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}