{"record":{"id":"f38811ee633e5b17","repo":"wtfutil/wtf","slug":"failed-to-read-query-config-file-s-w","errorCode":null,"errorMessage":"failed to read query config file %s: %w","messagePattern":"failed to read query config file (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/azurelogs/config.go","lineNumber":48,"sourceCode":"\t\tconfigFile, err = readQueryFileContent(queryPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsess.QueryFile = configFile\n\t} else {\n\t\treturn fmt.Errorf(\"invalid query file format: %s, expected .yaml\", filename)\n\t}\n\n\treturn nil\n}\n\n// readQueryFileContent reads a single config file and returns a QueryFile struct\nfunc readQueryFileContent(filePath string) (QueryFile, error) {\n\tvar configFile QueryFile\n\tdata, err := os.ReadFile(filePath)\n\tif err != nil {\n\t\treturn configFile, fmt.Errorf(\"failed to read query config file %s: %w\", filePath, err)\n\t}\n\n\terr = yaml.Unmarshal(data, &configFile)\n\tif err != nil {\n\t\treturn configFile, fmt.Errorf(\"failed to parse YAML in config file %s: %w\", filePath, err)\n\t}\n\n\treturn configFile, nil\n}\n","sourceCodeStart":30,"sourceCodeEnd":58,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/azurelogs/config.go#L30-L58","documentation":"Wraps the os.ReadFile failure inside readQueryFileContent: the Azure Log Analytics query config file at filePath could not be opened or read (typically the path does not exist, has wrong permissions, or is a directory). This is a wrapped sentinel-style error — the %w carries the underlying os error. The caller readQueryFile propagates it, aborting session configuration; fix by pointing the query file path at an existing, readable .yaml config.","triggerScenarios":"Thrown at modules/azurelogs/config.go:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the query file path in the azurelogs config is correct and absolute if needed","Verify the file exists and is readable by the process user","Check file permissions and that no symlink is broken"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}