{"record":{"id":"0fe26dd815545263","repo":"docker/compose","slug":"none-of-the-selected-services-is-configured-for-wa","errorCode":null,"errorMessage":"none of the selected services is configured for watch, see https://docs.docker.com/compose/how-tos/file-watch/","messagePattern":"none of the selected services is configured for watch, see https://docs\\.docker\\.com/compose/how-tos/file-watch/","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/compose/watch.go","lineNumber":78,"sourceCode":"func NewWatcher(project *types.Project, options api.UpOptions, w WatchFunc, consumer api.LogConsumer) (*Watcher, error) {\n\tfor i := range project.Services {\n\t\tservice := project.Services[i]\n\n\t\tif service.Develop != nil && service.Develop.Watch != nil {\n\t\t\tbuild := options.Create.Build\n\t\t\treturn &Watcher{\n\t\t\t\tproject: project,\n\t\t\t\toptions: api.WatchOptions{\n\t\t\t\t\tLogTo: consumer,\n\t\t\t\t\tBuild: build,\n\t\t\t\t},\n\t\t\t\twatchFn: w,\n\t\t\t\terrCh:   make(chan error),\n\t\t\t}, nil\n\t\t}\n\t}\n\t// none of the services is eligible to watch\n\treturn nil, fmt.Errorf(\"none of the selected services is configured for watch, see https://docs.docker.com/compose/how-tos/file-watch/\")\n}\n\n// ensure state changes are atomic\nvar mx gsync.Mutex\n\nfunc (w *Watcher) Start(ctx context.Context) error {\n\tmx.Lock()\n\tdefer mx.Unlock()\n\tctx, cancelFunc := context.WithCancel(ctx)\n\tw.stopFn = cancelFunc\n\twait, err := w.watchFn(ctx, w.project, w.options)\n\tif err != nil {\n\t\tgo func() {\n\t\t\tw.errCh <- err\n\t\t}()\n\t\treturn err\n\t}\n\tgo func() {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/watch.go#L60-L96","documentation":"The watch command tries to build watch rules for the selected services and only succeeds if at least one has a develop section with watch entries (or legacy x-develop). If no eligible service remains after filtering, it returns this error pointing at the file-watch documentation.","triggerScenarios":"Running docker compose watch with no service in scope having a develop.watch configuration — either no develop blocks at all, or the services named in the command all lacking watch rules.","commonSituations":"Running watch on a stack authored only for deployment (no develop sections); invoking watch with a service selector that excludes the one watched service; compose file authored for an older compose version using x-develop unsupported in this path.","solutions":["Add a develop: section with watch: rules to at least one service you intend to watch.","If using a selector, include the service that actually has develop.watch configured.","Verify the compose file being used is the intended one (docker compose config shows develop blocks).","Follow the linked documentation (https://docs.docker.com/compose/how-tos/file-watch/) for the supported develop schema."],"exampleFix":"# before\nservices:\n  web:\n    build: .\n    # no develop section\n\n# after\nservices:\n  web:\n    build: .\n    develop:\n      watch:\n        - action: sync\n          path: ./src\n          target: /app/src","handlingStrategy":"validation","validationCode":"func anyServiceWatchable(project *types.Project) bool {\n\tfor _, svc := range project.Services {\n\t\tif svc.Develop != nil && len(svc.Develop.Watch) > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","typeGuard":null,"tryCatchPattern":"if _, err := composeService.Watch(ctx, projectName, opts); err != nil {\n    if strings.Contains(err.Error(), \"none of the selected services is configured for watch\") {\n        // add a develop.watch block or stop calling watch for this stack\n    }\n    return err\n}","preventionTips":["Only invoke watch on stacks authored with develop.watch sections.","Validate compose files contain develop.watch before starting watch in dev scripts.","Keep watch config in the same file as the service it applies to."],"tags":["compose","watch","develop","configuration"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}