{"record":{"id":"8698d662e6f775c3","repo":"cloudflare/cloudflared","slug":"possible-conflicting-configuration-in-1-s-and","errorCode":null,"errorMessage":"possible conflicting configuration in %[1]s and %[2]s. Either remove %[2]s or run `cloudflared --config %[2]s service install`","messagePattern":"possible conflicting configuration in %\\[1\\]s and %\\[2\\]s\\. Either remove %\\[2\\]s or run `cloudflared --config %\\[2\\]s service install`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/linux_service.go","lineNumber":336,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tsrc, _, err := config.ReadConfigFile(c, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// can't use context because this command doesn't define \"credentials-file\" flag\n\tconfigPresent := func(s string) bool {\n\t\tval, err := src.String(s)\n\t\treturn err == nil && val != \"\"\n\t}\n\tif src.TunnelID == \"\" || !configPresent(tunnel.CredFileFlag) {\n\t\treturn nil, fmt.Errorf(\"configuration file %s must contain entries for the tunnel to run and its associated credentials (tunnel: TUNNEL-UUID, credentials-file: CREDENTIALS-FILE)\", src.Source())\n\t}\n\tif src.Source() != serviceConfigPath {\n\t\tif exists, err := config.FileExists(serviceConfigPath); err != nil || exists {\n\t\t\treturn nil, fmt.Errorf(\"possible conflicting configuration in %[1]s and %[2]s. Either remove %[2]s or run `cloudflared --config %[2]s service install`\", src.Source(), serviceConfigPath)\n\t\t}\n\n\t\tif err := copyFile(src.Source(), serviceConfigPath); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to copy %s to %s: %w\", src.Source(), serviceConfigPath, err)\n\t\t}\n\t}\n\n\treturn []string{\n\t\t\"--config\", \"/etc/cloudflared/config.yml\", \"tunnel\", \"run\",\n\t}, nil\n}\n\nfunc installSystemd(templateArgs *ServiceTemplateArgs, autoUpdate bool, log *zerolog.Logger) error {\n\tvar systemdTemplates []ServiceTemplate\n\tif autoUpdate {\n\t\tsystemdTemplates = []ServiceTemplate{\n\t\t\tsystemdAllTemplates[cloudflaredService],\n\t\t\tsystemdAllTemplates[cloudflaredUpdateService],","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/linux_service.go#L318-L354","documentation":"Thrown by buildArgsForConfig when installing the service with a --config file that differs from the canonical service config path (/etc/cloudflared/config.yml) while that path already exists (or its existence check errors). Two configs would conflict — the service unit always points at /etc/cloudflared/config.yml, so the installer refuses to create an ambiguous setup and tells you to remove the stale file or install using that exact path.","triggerScenarios":"`cloudflared --config /home/user/myconfig.yml service install` when /etc/cloudflared/config.yml already exists (e.g. from a previous install or package default), or when config.FileExists(serviceConfigPath) returns an error.","commonSituations":"Re-installing the service after previously installing with a different config; leftover /etc/cloudflared/config.yml from an old cloudflared version or manual setup; running service install as a different user pointing at a personal config while a system config remains.","solutions":["Remove or rename the stale /etc/cloudflared/config.yml, then re-run `cloudflared --config <your-config> service install` (the installer will copy your config there).","Or simply run `cloudflared --config /etc/cloudflared/config.yml service install` to use the existing file at the canonical path.","Edit /etc/cloudflared/config.yml directly if it already holds the desired tunnel/credentials entries.","Check that config.FileExists is not failing due to permissions on /etc/cloudflared (run the install with root/sudo)."],"exampleFix":"# before\n$ cloudflared --config ~/myconfig.yml service install\n# ERROR: possible conflicting configuration in /home/user/myconfig.yml and /etc/cloudflared/config.yml\n\n# after\n$ sudo rm /etc/cloudflared/config.yml\n$ sudo cloudflared --config ~/myconfig.yml service install","handlingStrategy":"validation","validationCode":"// Go: check for a conflicting service config before installing\nserviceConfigPath := \"/etc/cloudflared/config.yml\"\nif myConfigPath != serviceConfigPath {\n    exists, err := config.FileExists(serviceConfigPath)\n    if err != nil {\n        return fmt.Errorf(\"cannot stat %s: %w\", serviceConfigPath, err)\n    }\n    if exists {\n        return fmt.Errorf(\"remove %s or install with --config %s\", serviceConfigPath, serviceConfigPath)\n    }\n}","typeGuard":null,"tryCatchPattern":"// Go\nout, err := exec.Command(\"cloudflared\", \"--config\", cfg, \"service\", \"install\").CombinedOutput()\nif err != nil && strings.Contains(string(out), \"possible conflicting configuration\") {\n    // remove /etc/cloudflared/config.yml or reinstall against that exact path\n}","preventionTips":["Before reinstalling, check for and remove a stale /etc/cloudflared/config.yml","Always install the service using the canonical path: `cloudflared --config /etc/cloudflared/config.yml service install`","Use a configuration-management tool (Ansible/puppet) so only one source writes /etc/cloudflared/config.yml","Uninstall the service (`cloudflared service uninstall`) before switching config files"],"tags":["cli","configuration","service-install","conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}