{"record":{"id":"931636c9c0b679cb","repo":"apache/beam","slug":"getjobmetrics-unknown-jobid-v","errorCode":null,"errorMessage":"GetJobMetrics: unknown jobID: %v","messagePattern":"GetJobMetrics: unknown jobID: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/jobservices/management.go","lineNumber":510,"sourceCode":"\t\t\tcurState = job.stateIdx + 1\n\t\t\tjob.streamCond.L.Unlock()\n\t\t\tstream.Send(&jobpb.JobMessagesResponse{\n\t\t\t\tResponse: &jobpb.JobMessagesResponse_StateResponse{\n\t\t\t\t\tStateResponse: &jobpb.JobStateEvent{\n\t\t\t\t\t\tState: state,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t})\n\t\t\tjob.streamCond.L.Lock()\n\t\t}\n\t}\n}\n\n// GetJobMetrics Fetch metrics for a given job.\nfunc (s *Server) GetJobMetrics(ctx context.Context, req *jobpb.GetJobMetricsRequest) (*jobpb.GetJobMetricsResponse, error) {\n\tj := s.getJob(req.GetJobId())\n\tif j == nil {\n\t\treturn nil, fmt.Errorf(\"GetJobMetrics: unknown jobID: %v\", req.GetJobId())\n\t}\n\treturn &jobpb.GetJobMetricsResponse{\n\t\tMetrics: &jobpb.MetricResults{\n\t\t\tAttempted: j.metrics.Results(tentative),\n\t\t\tCommitted: j.metrics.Results(committed),\n\t\t},\n\t}, nil\n}\n\n// GetJobs returns the set of active jobs and associated metadata.\nfunc (s *Server) GetJobs(context.Context, *jobpb.GetJobsRequest) (*jobpb.GetJobsResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tresp := &jobpb.GetJobsResponse{}\n\tfor key, job := range s.jobs {\n\t\tresp.JobInfo = append(resp.JobInfo, &jobpb.JobInfo{\n\t\t\tJobId:           key,","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/jobservices/management.go#L492-L528","documentation":"Error returned by the Prism job server's GetJobMetrics gRPC handler when the request's job ID does not match any job known to the server (getJob returned nil). Typically means the job already expired from the store, was submitted to a different Prism instance, or the ID is malformed.","triggerScenarios":"Calling the GetJobMetrics RPC with a GetJobMetricsRequest whose JobId matches no prepared/running job (unknown or expired ID).","commonSituations":"Polling metrics after job completion once the server dropped it; querying metrics from a different prism instance than the one that ran the job; typo'd job ID from logs.","solutions":["Use the job ID returned by the current run, not one copied from stale output.","Query metrics while the job still exists on the same server instance.","Confirm you're connected to the prism server that executed the job.","Wrap the call to handle 'unknown jobID' by re-creating or re-running the job."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if jobID == \"\" || jobID != runningJobID {\n    return errors.New(\"cannot fetch metrics: unknown job id\")\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.GetJobMetrics(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"unknown jobID\") {\n    return nil, fmt.Errorf(\"job %s no longer available on this server: %w\", req.GetJobId(), err)\n}","preventionTips":["Poll metrics while the job is still tracked by the same server instance.","Store the job ID from the Run response rather than parsing logs.","Point metric queries at the server that actually executed the job."],"tags":["go","beam-prism","grpc","metrics","job-management"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}