{"record":{"id":"ff7e9ba007fd7655","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-parse-relabel-configs-for-job-name-q","errorCode":null,"errorMessage":"cannot parse `relabel_configs` for `job_name` %q: %w","messagePattern":"cannot parse `relabel_configs` for `job_name` %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/promscrape/config.go","lineNumber":980,"sourceCode":"\t}\n\tparams := sc.Params\n\tac, err := sc.HTTPClientConfig.NewConfig(baseDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot parse auth config for `job_name` %q: %w\", jobName, err)\n\t}\n\tproxyAC, err := sc.ProxyClientConfig.NewConfig(baseDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot parse proxy auth config for `job_name` %q: %w\", jobName, err)\n\t}\n\trcs := sc.RelabelConfigs\n\tif len(globalCfg.RelabelConfigs) > 0 {\n\t\trcs = make([]promrelabel.RelabelConfig, 0, len(globalCfg.RelabelConfigs)+len(sc.RelabelConfigs))\n\t\trcs = append(rcs, globalCfg.RelabelConfigs...)\n\t\trcs = append(rcs, sc.RelabelConfigs...)\n\t}\n\trelabelConfigs, err := promrelabel.ParseRelabelConfigs(rcs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot parse `relabel_configs` for `job_name` %q: %w\", jobName, err)\n\t}\n\tmrcs := sc.MetricRelabelConfigs\n\tif len(globalCfg.MetricRelabelConfigs) > 0 {\n\t\tmrcs = make([]promrelabel.RelabelConfig, 0, len(globalCfg.MetricRelabelConfigs)+len(sc.MetricRelabelConfigs))\n\t\tmrcs = append(mrcs, globalCfg.MetricRelabelConfigs...)\n\t\tmrcs = append(mrcs, sc.MetricRelabelConfigs...)\n\t}\n\tmetricRelabelConfigs, err := promrelabel.ParseRelabelConfigs(mrcs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot parse `metric_relabel_configs` for `job_name` %q: %w\", jobName, err)\n\t}\n\tsampleLimit := sc.SampleLimit\n\tif sampleLimit <= 0 {\n\t\tsampleLimit = globalCfg.SampleLimit\n\t}\n\texternalLabels := globalCfg.ExternalLabels\n\tnoStaleTracking := *noStaleMarkers\n\tif sc.NoStaleMarkers != nil {","sourceCodeStart":962,"sourceCodeEnd":998,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/promscrape/config.go#L962-L998","documentation":"The merged (global + per-job) relabel_configs are compiled via promrelabel.ParseRelabelConfigs, which validates labels, regexes, and actions. Parse failures are wrapped with the job name and abort loading.","triggerScenarios":"A relabel_config with invalid `action`, invalid `regex` (uncompilable RE2), missing source_labels for actions that need them, or an empty `target_label` where required.","commonSituations":"Regex typos like '(.+' (unbalanced); unsupported action names copied from other systems; YAML lists accidentally merged so an entry is a scalar instead of a map.","solutions":["Fix the regex/action reported by the wrapped inner error for the given job_name","Check each relabel_config has valid action and required source_labels/target_label","Run -dryRun to see the full validation error before restart"],"exampleFix":"// before\nrelabel_configs:\n  - source_labels: [__name__]\n    regex: '(.+'\n    action: replace\n// after\nrelabel_configs:\n  - source_labels: [__name__]\n    regex: '(.*)'\n    action: replace\n","handlingStrategy":"validation","validationCode":"// Validate relabel rules compile before deploy\nif _, err := promrelabel.ParseRelabelConfigs(sc.RelabelConfigs); err != nil {\n\treturn fmt.Errorf(\"job %q: bad relabel_configs: %w\", sc.JobName, err)\n}","typeGuard":null,"tryCatchPattern":"if err := promscrape.CheckConfig(); err != nil {\n\tlogger.Fatalf(\"error when checking -promscrape.config: %s\", err)\n}","preventionTips":["Test every regex in a RE2 playground before adding it to config","Keep actions limited to supported ones (replace, keep, drop, labelmap, etc.)","Use single-quoted YAML strings to avoid escaping surprises in regexes"],"tags":["config","promscrape","relabeling","regex"],"backgroundTag":"relabel-config-parse-failed","analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}