{"record":{"id":"cf6d937739904afc","repo":"apache/beam","slug":"failed-to-get-manifest","errorCode":null,"errorMessage":"failed to get manifest","messagePattern":"failed to get manifest","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/materialize.go","lineNumber":299,"sourceCode":"\t\tif _, err := w.Write(chunk.Data); err != nil {\n\t\t\treturn \"\", errors.Wrapf(err, \"chunk write failed\")\n\t\t}\n\t}\n\treturn hex.EncodeToString(sha256W.Sum(nil)), nil\n}\n\nfunc legacyMaterialize(ctx context.Context, endpoint string, rt string, dest string) ([]*pipepb.ArtifactInformation, error) {\n\tcc, err := grpcx.Dial(ctx, endpoint, 2*time.Minute)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer cc.Close()\n\n\tclient := jobpb.NewLegacyArtifactRetrievalServiceClient(cc)\n\n\tm, err := client.GetManifest(ctx, &jobpb.GetManifestRequest{RetrievalToken: rt})\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to get manifest\")\n\t}\n\tmds := m.GetManifest().GetArtifact()\n\n\tvar artifacts []*pipepb.ArtifactInformation\n\tvar list []retrievable\n\tfor _, md := range mds {\n\t\ttypePayload, err := proto.Marshal(&pipepb.ArtifactFilePayload{\n\t\t\tPath:   md.Name,\n\t\t\tSha256: md.Sha256,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create artifact type payload\")\n\t\t}\n\t\trolePayload, err := proto.Marshal(&pipepb.ArtifactStagingToRolePayload{\n\t\t\tStagedName: md.Name,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create artifact role payload\")","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/materialize.go#L281-L317","documentation":"Wraps a failure of GetManifest on the LegacyArtifactRetrievalService in legacyMaterialize, which is used when Materialize is called with no explicit dependencies and a legacy retrieval token. The manifest describes which artifacts exist under that token; failure means the RPC itself failed (transport or server error), with the cause wrapped under this message.","triggerScenarios":"Calling artifact.Materialize with empty dependencies and a non-empty retrieval token where the GetManifest RPC fails: endpoint unreachable, retrieval token expired/unknown, or the legacy artifact service not deployed on the runner endpoint.","commonSituations":"Reusing an old retrieval token after the staging service discarded it; pointing at the wrong Flink/Spark job manager port; runner upgraded away from the legacy service while client code still passes a token; network/firewall blocking the gRPC port.","solutions":["Re-submit the pipeline to obtain a fresh retrieval token — tokens are session-scoped and expire.","Verify the endpoint host:port hosts the LegacyArtifactRetrievalService (correct job manager port).","Ensure artifacts are actually staged: pass dependencies so Materialize uses the newer ResolveArtifacts path instead of the legacy token path.","Check network connectivity/firewall between client and endpoint (grpcx.Dial has a 2-minute timeout)."],"exampleFix":"// before: stale token from previous submission\nartifact.Materialize(ctx, endpoint, nil, \"old-expired-token\", dest)\n// after: use fresh token from current job, or prefer dependencies\nartifact.Materialize(ctx, endpoint, dependencies, freshToken, dest)","handlingStrategy":"retry","validationCode":"// Validate inputs before calling Materialize with legacy token path:\nif len(deps) == 0 && (rt == \"\" || rt == artifact.NoArtifactsStaged) {\n\treturn nil // nothing to do, skip RPC entirely\n}\nconn, err := net.DialTimeout(\"tcp\", strings.TrimPrefix(endpoint, \"\"), 5*time.Second)\nif err != nil { return fmt.Errorf(\"artifact endpoint unreachable: %w\", err) }\nconn.Close()","typeGuard":null,"tryCatchPattern":"if err := artifact.Materialize(ctx, endpoint, nil, token, dest); err != nil {\n\tif strings.Contains(err.Error(), \"failed to get manifest\") {\n\t\t// token may be expired or endpoint wrong; refresh token then retry\n\t\ttime.Sleep(5 * time.Second)\n\t\treturn artifact.Materialize(ctx, endpoint, nil, freshToken(), dest)\n\t}\n\treturn err\n}","preventionTips":["Always use a retrieval token from the current submission, never a cached old one.","Verify the endpoint hosts the legacy artifact retrieval service (correct port).","Prefer passing explicit dependencies so Materialize uses the modern ResolveArtifacts path.","Check firewall/network policies allow gRPC to the artifact service."],"tags":["go","grpc","beam-artifacts","legacy-api","network"],"backgroundTag":"api-error-response","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"}