{"record":{"id":"3e91afb0001b5ef1","repo":"benbjohnson/litestream","slug":"database-does-not-exist-s","errorCode":null,"errorMessage":"database does not exist: %s","messagePattern":"database does not exist: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/reset.go","lineNumber":69,"sourceCode":"\t\t\treturn fmt.Errorf(\"cannot read config: %w\", configErr)\n\t\t}\n\n\t\t// Find database config\n\t\tfor _, dbc := range config.DBs {\n\t\t\texpandedPath := dbc.Path\n\t\t\tif !filepath.IsAbs(expandedPath) {\n\t\t\t\texpandedPath, _ = filepath.Abs(expandedPath)\n\t\t\t}\n\t\t\tif expandedPath == dbPath {\n\t\t\t\tdbConfig = dbc\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// If no config found, check if database file exists\n\tif _, err := os.Stat(dbPath); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"database does not exist: %s\", dbPath)\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"cannot access database: %w\", err)\n\t}\n\n\t// Create DB instance\n\tvar db *litestream.DB\n\tif dbConfig != nil {\n\t\tdb, err = NewDBFromConfig(dbConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot create database from config: %w\", err)\n\t\t}\n\t} else {\n\t\tdb = litestream.NewDB(dbPath)\n\t}\n\n\t// Check if meta path exists\n\tmetaPath := db.MetaPath()\n\tif _, err := os.Stat(metaPath); os.IsNotExist(err) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/reset.go#L51-L87","documentation":"Guard in 'litestream reset' Run: os.Stat reports the database file does not exist at the given path and no matching config entry provides it. Fires when the user passes a path to a non-existent SQLite database; reset only operates on existing databases.","triggerScenarios":"Thrown at cmd/litestream/reset.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the database path spelling (it is made absolute before checking)","Pass -config so the database is matched via its configured path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}