{"record":{"id":"101ded11f23ba45f","repo":"thanos-io/thanos","slug":"read-file","errorCode":null,"errorMessage":"read file","messagePattern":"read file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/reloader/reloader.go","lineNumber":364,"sourceCode":"\t\t}\n\n\t\t// Reset the watch timeout.\n\t\tapplyCancel()\n\t\tapplyCtx, applyCancel = context.WithTimeout(ctx, r.watchInterval)\n\n\t\tr.configApply.Inc()\n\t\tif err := r.apply(applyCtx); err != nil {\n\t\t\tr.configApplyErrors.Inc()\n\t\t\tlevel.Error(r.logger).Log(\"msg\", \"apply error\", \"err\", err)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc (r *Reloader) normalize(inputFile, outputFile string) error {\n\tb, err := os.ReadFile(inputFile)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read file\")\n\t}\n\n\t// Detect and extract gzipped file.\n\tif bytes.Equal(b[0:3], firstGzipBytes) {\n\t\tzr, err := gzip.NewReader(bytes.NewReader(b))\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"create gzip reader\")\n\t\t}\n\t\tdefer runutil.CloseWithLogOnErr(r.logger, zr, \"gzip reader close\")\n\n\t\tb, err = io.ReadAll(zr)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"read compressed config file\")\n\t\t}\n\t}\n\n\tb, err = r.expandEnv(b)\n\tif err != nil {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/reloader/reloader.go#L346-L382","documentation":"Wraps os.ReadFile in Reloader.normalize: the Prometheus/rule config input file cannot be read (missing, permission-denied, directory). The reloader cannot produce the normalized output file, so the apply cycle logs an apply error and retries on the next tick.","triggerScenarios":"Thrown at pkg/reloader/reloader.go:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input file path is mounted and readable.","Check configmap/secret mount timing in Kubernetes.","Inspect the wrapped OS error (ENOENT, EACCES)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}