syncthing/syncthing · error
not found (folder/file not in database)
Error message
not found (folder/file not in database)
What it means
Produced by the CLI's indexDumpOutput when the db endpoint GET returns 404 (mapped from errNotFound). It means the REST call succeeded but the daemon has no database entry for the requested folder ID (db/status) or folder/file path (db/file).
Source
Thrown at cmd/syncthing/cli/utils.go:52
}
_, err = client.Post(url, "")
return err
}
func indexDumpOutputWrapper(apiClientFactory *apiClientFactory) func(url string) error {
return func(url string) error {
return indexDumpOutput(url, apiClientFactory)
}
}
func indexDumpOutput(url string, apiClientFactory *apiClientFactory) error {
client, err := apiClientFactory.getClient()
if err != nil {
return err
}
response, err := client.Get(url)
if errors.Is(err, errNotFound) {
return errors.New("not found (folder/file not in database)")
}
if err != nil {
return err
}
return prettyPrintResponse(response)
}
func saveToFile(url string, apiClientFactory *apiClientFactory) error {
client, err := apiClientFactory.getClient()
if err != nil {
return err
}
response, err := client.Get(url)
if err != nil {
return err
}
_, params, err := mime.ParseMediaType(response.Header.Get("Content-Disposition"))
if err != nil {View on GitHub (pinned to 058bcd7334)
Solutions
- List actual folder IDs: syncthing cli config folders
- Trigger a rescan and retry: syncthing cli operations scan <folderID>
- For db/file, pass the path relative to the folder root exactly as stored (case-sensitive on Linux)
- Confirm the folder is shared and has synced at least once (syncthing cli show index db/status)
Example fix
# before syncthing cli show index db/file documents /home/user/Documents/report.txt # -> not found (folder/file not in database) # after: path relative to folder root syncthing cli show index db/file documents report.txt
Defensive patterns
Strategy: validation
Validate before calling
// verify the folder exists before dumping its index
folders, err := client.GetJSON("rest/config/folders")
if !folderExists(folders, folderID) {
return fmt.Errorf("unknown folder %q; run 'syncthing cli config folders'", folderID)
} Try / catch
err := indexDumpOutput(url, factory)
if errors.Is(err, errNotFound) || strings.Contains(err.Error(), "not found (folder/file not in database)") {
// wrong ID or path: list folders / rescan, do not retry unchanged
} Prevention
- Always enumerate valid folder IDs from config instead of guessing
- Rescan newly added folders before querying db/file
- Pass file paths relative to the folder root, matching the OS case sensitivity
When it happens
Trigger: 'syncthing cli show index db/status <folderID>' or 'db/file <folderID> <path>' where the folder ID is not in the daemon's config, the folder exists but was never scanned into the database, or the file path does not match any indexed item.
Common situations: Folder ID typo (case-sensitive); folder just added and not yet scanned; querying db/file with a path relative to the wrong root; querying a paused/unshared folder with an empty index.
Related errors
- Failed to override changes\nStatus code: {status}\nBody: {bo
- Both --gui-address and --gui-apikey should be specified
- could not find GUI Address
- could not find GUI API key
- invalid endpoint or API call
AI-assisted analysis of syncthing/syncthing@058bcd7334 (2026-08-15).
Data as JSON: /api/errors/8967d382f44cf24e.
Report an issue: GitHub.