{"record":{"id":"15e0878d84490ab0","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-parse-response-from-q-w-data-q-15e087","errorCode":null,"errorMessage":"cannot parse response from %q: %w; data=%q","messagePattern":"cannot parse response from %q: %w; data=%q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/promscrape/discovery/nomad/watch.go","lineNumber":218,"sourceCode":")\n\n// getBlockingServiceNames obtains service names via blocking request to Nomad.\n//\n// It returns an empty serviceNames list if response contains the same index.\nfunc (cw *nomadWatcher) getBlockingServiceNames(index int64) ([]string, int64, error) {\n\tpath := \"/v1/services\" + cw.serviceNamesQueryArgs\n\tdata, newIndex, err := getBlockingAPIResponse(cw.client.Context(), cw.client, path, index)\n\tif err != nil {\n\t\treturn nil, index, err\n\t}\n\tif index == newIndex {\n\t\t// Nothing changed - return an empty serviceNames list.\n\t\treturn nil, index, nil\n\t}\n\n\tvar svcs []ServiceList\n\tif err := json.Unmarshal(data, &svcs); err != nil {\n\t\treturn nil, index, fmt.Errorf(\"cannot parse response from %q: %w; data=%q\", path, err, data)\n\t}\n\n\tserviceNames := make([]string, 0, len(svcs))\n\tfor _, svc := range svcs {\n\t\tfor _, s := range svc.Services {\n\t\t\tserviceNames = append(serviceNames, s.ServiceName)\n\t\t}\n\t}\n\n\treturn serviceNames, newIndex, nil\n}\n\n// getServiceSnapshot returns a snapshot of discovered Services.\nfunc (cw *nomadWatcher) getServiceSnapshot() map[string][]Service {\n\tcw.servicesLock.Lock()\n\tsns := make(map[string][]Service, len(cw.services))\n\tfor svc, sw := range cw.services {\n\t\tsns[svc] = sw.services","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/promscrape/discovery/nomad/watch.go#L200-L236","documentation":"Raised in nomadWatcher.getBlockingServiceNames when the JSON body of the Nomad /v1/services blocking query fails to unmarshal into []ServiceList; %q includes the raw data to reveal error pages or schema changes.","triggerScenarios":"Thrown at lib/promscrape/discovery/nomad/watch.go:218 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the echoed data — a Nomad error payload indicates ACL/auth problems","Verify the Nomad API version matches the expected services schema"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}