{"record":{"id":"17cee63ac80234b1","repo":"syncthing/syncthing","slug":"folder-is-paused","errorCode":null,"errorMessage":"folder is paused","messagePattern":"folder is paused","errorType":"exception","errorClass":"ErrFolderPaused","httpStatus":null,"severity":"warning","filePath":"lib/model/model.go","lineNumber":193,"sourceCode":"\thelloMessages                  map[protocol.DeviceID]protocol.Hello\n\tdeviceDownloads                map[protocol.DeviceID]*deviceDownloadState\n\tremoteFolderStates             map[protocol.DeviceID]map[string]remoteFolderState // deviceID -> folders\n\tindexHandlers                  *serviceMap[protocol.DeviceID, *indexHandlerRegistry]\n\n\t// for testing only\n\tfoldersRunning atomic.Int32\n}\n\nvar _ config.Verifier = &model{}\n\ntype folderFactory func(*model, *ignore.Matcher, config.FolderConfiguration, versioner.Versioner, events.Logger, *semaphore.Semaphore) service\n\nvar folderFactories = make(map[config.FolderType]folderFactory)\n\nvar (\n\terrDeviceUnknown    = errors.New(\"unknown device\")\n\terrDevicePaused     = errors.New(\"device is paused\")\n\tErrFolderPaused     = errors.New(\"folder is paused\")\n\tErrFolderNotRunning = errors.New(\"folder is not running\")\n\tErrFolderMissing    = errors.New(\"no such folder\")\n\terrNoVersioner      = errors.New(\"folder has no versioner\")\n\t// errors about why a connection is closed\n\terrStopped                            = errors.New(\"Syncthing is being stopped\") //nolint:staticcheck\n\terrEncryptionInvConfigLocal           = errors.New(\"can't encrypt outgoing data because local data is encrypted (folder-type receive-encrypted)\")\n\terrEncryptionInvConfigRemote          = errors.New(\"remote has encrypted data and encrypts that data for us - this is impossible\")\n\terrEncryptionNotEncryptedLocal        = errors.New(\"remote expects to exchange encrypted data, but is configured for plain data\")\n\terrEncryptionPlainForReceiveEncrypted = errors.New(\"remote expects to exchange plain data, but is configured to be encrypted\")\n\terrEncryptionPlainForRemoteEncrypted  = errors.New(\"remote expects to exchange plain data, but local data is encrypted (folder-type receive-encrypted)\")\n\terrEncryptionNotEncryptedUntrusted    = errors.New(\"device is untrusted, but configured to receive plain data\")\n\terrEncryptionPassword                 = errors.New(\"different encryption passwords used\")\n\terrEncryptionTokenRead                = errors.New(\"failed to read encryption token\")\n\terrEncryptionTokenWrite               = errors.New(\"failed to write encryption token\")\n\terrMissingRemoteInClusterConfig       = errors.New(\"remote device missing in cluster config\")\n\terrMissingLocalInClusterConfig        = errors.New(\"local device missing in cluster config\")\n)\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/syncthing/syncthing/blob/058bcd7334839663cf569501d3ac539034d45cb5/lib/model/model.go#L175-L211","documentation":"ErrFolderPaused is an exported model error (lib/model/model.go) returned by folder-facing APIs — ScanFolder, Pause/Resume side paths, index handling (indexhandler.go:366) and the folder-state dispatcher — when the target folder exists but is currently paused. Unlike ErrFolderMissing, it indicates a temporary administrative state: the folder configuration is loaded but its service is not running, so scans, pulls, and most REST operations on it are refused.","triggerScenarios":"Calling model.ScanFolder / ScanFolders / folder runtime methods (model.go:1177, 3239, folder_summary.go) while folder.Paused is true; requesting an index from a paused folder (indexhandler.go returns '%folder: %w' wrapping ErrFolderPaused).","commonSituations":"REST scripts triggering /rest/db/scan while the folder is paused; startup races where the API answers before the folder is resumed; users pausing folders to save bandwidth and forgetting before scripted syncs; automation pausing all folders on metered connections.","solutions":["Resume the folder first (PATCH /rest/config/folders with paused=false, or GUI), then retry the operation","In scripts, check GET /rest/config/folders for the paused flag before calling scan/pull endpoints","Treat ErrFolderPaused (via errors.Is) as retryable-with-user-action, distinct from ErrFolderMissing"],"exampleFix":"// before\nerr := model.ScanFolder(folderID)\n\n// after\nif err := model.ScanFolder(folderID); errors.Is(err, model.ErrFolderPaused) {\n    // resume folder, then retry\n}\n","handlingStrategy":"validation","validationCode":"// Check folder paused flag before folder operations:\nfor _, fcfg := range cfg.Folders() {\n    if fcfg.ID == folderID && fcfg.Paused {\n        return errors.New(\"folder is paused\")\n    }\n}","typeGuard":"func isFolderPaused(err error) bool {\n    return errors.Is(err, model.ErrFolderPaused)\n}","tryCatchPattern":"if isFolderPaused(err) {\n    // resume folder (config API), then retry the scan/pull operation\n}","preventionTips":["Scripts should check folder paused state via REST before acting","Treat as user-action-required, not transient","Model distinct handling for paused vs missing vs not-running"],"tags":["syncthing","folder","pause","api"],"backgroundTag":null,"analyzedSha":"058bcd7334839663cf569501d3ac539034d45cb5","analyzedAt":"2026-08-15T07:53:43.174Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}