{"record":{"id":"058261b99653e798","repo":"juanfont/headscale","slug":"path-is-a-directory-only-file-is-supported","errorCode":null,"errorMessage":"path is a directory, only file is supported","messagePattern":"path is a directory, only file is supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/dns/extrarecords.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"context\"\n\t\"crypto/sha256\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/cenkalti/backoff/v5\"\n\t\"github.com/fsnotify/fsnotify\"\n\t\"github.com/rs/zerolog/log\"\n\t\"tailscale.com/tailcfg\"\n\t\"tailscale.com/util/set\"\n)\n\n// ErrPathIsDirectory is returned when a directory path is provided where a file is expected.\nvar ErrPathIsDirectory = errors.New(\"path is a directory, only file is supported\")\n\ntype ExtraRecordsMan struct {\n\tmu      sync.RWMutex\n\trecords set.Set[tailcfg.DNSRecord]\n\twatcher *fsnotify.Watcher\n\tpath    string\n\n\tupdateCh chan []tailcfg.DNSRecord\n\tcloseCh  chan struct{}\n\thash     [32]byte\n}\n\n// NewExtraRecordsManager creates a new [ExtraRecordsMan] and starts watching the file at the given path.\nfunc NewExtraRecordsManager(path string) (*ExtraRecordsMan, error) {\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating watcher: %w\", err)\n\t}","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/dns/extrarecords.go#L2-L38","documentation":"Error \"path is a directory, only file is supported\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/dns/extrarecords.go:20 when the library encounters an invalid state.","commonSituations":"dns.extra_records_path must point to a JSON file, not a directory. Pass the full file path in the headscale configuration.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (path is a directory, only file is supported); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (path is a directory, only file is supported); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}