{"record":{"id":"ab49c6d268aa210c","repo":"apache/beam","slug":"no-job-service-endpoint-specified-use-endpoint-endpoint","errorCode":null,"errorMessage":"no job service endpoint specified. Use --endpoint=<endpoint>","messagePattern":"no job service endpoint specified\\. Use --endpoint=<endpoint>","errorType":"validation","errorClass":"missingFlagError","httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/options/jobopts/options.go","lineNumber":116,"sourceCode":"\t// Parallelisn flag to set the degree of parallelism. If not set, the configured Flink default is used, or 1 if none can be found.\n\tParallelism = flag.Int(\"parallelism\", -1, \"The degree of parallelism to be used when distributing operations onto Flink workers.\")\n\n\t// ResourceHints flag takes whole pipeline hints for resources.\n\tResourceHints stringSlice\n\n\t// ElementProcessingTimeout flag to set the timeout for processing an element in a PTransform operation. If set to -1, there is no timeout.\n\tElementProcessingTimeout = flag.Duration(\"element_processing_timeout\", -1,\n\t\t\"The time limit (in minutes) for any PTransform to finish processing a single element. If exceeded, \"+\n\t\t\t\"the SDK worker process self-terminates and processing may be restarted by a runner. There is no time limit if the value is set to -1.\")\n)\n\ntype missingFlagError error\n\n// GetEndpoint returns the endpoint, if non empty and exits otherwise. Runners\n// such as Dataflow set a reasonable default. Convenience function.\nfunc GetEndpoint() (string, error) {\n\tif *Endpoint == \"\" {\n\t\treturn \"\", missingFlagError(errors.New(\"no job service endpoint specified. Use --endpoint=<endpoint>\"))\n\t}\n\treturn *Endpoint, nil\n}\n\nvar unique int32\n\n// GetJobName returns the specified job name or, if not present, a fresh\n// autogenerated name. Convenience function.\nfunc GetJobName() string {\n\tif *JobName == \"\" {\n\t\tid := atomic.AddInt32(&unique, 1)\n\t\treturn fmt.Sprintf(\"go-job-%v-%v\", id, time.Now().UnixNano())\n\t}\n\treturn *JobName\n}\n\n// GetEnvironmentUrn returns the specified EnvironmentUrn used to run the SDK Harness,\n// if not present, returns the docker environment urn \"beam:env:docker:v1\".","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/options/jobopts/options.go#L98-L134","documentation":"jobopts.GetEndpoint reads the --endpoint flag for the Beam job service and returns this error when the flag value is empty. Runners like Dataflow set a reasonable default, but direct/other submission paths require an explicit endpoint. The error is a typed missingFlagError so callers can distinguish it.","triggerScenarios":"Calling jobopts.GetEndpoint() (directly or via job submission code paths like Execute) without registering or setting the --endpoint flag, or the user not passing --endpoint=<host:port> on the command line.","commonSituations":"Running a Go Beam pipeline against a Flink/Spark/SMEE job server without --endpoint; forgetting to call jobopts flags registration in a custom main; CI invoking the binary without the flag.","solutions":["Pass --endpoint=<host:port> when launching the pipeline (e.g. --endpoint=localhost:8099)","Set the flag programmatically before calling GetEndpoint, e.g. flag.Set(\"endpoint\", \"localhost:8099\") or jobopts.Endpoint = &val","Check for missingFlagError in the caller and print usage guidance"],"exampleFix":"// before\nendpoint, err := jobopts.GetEndpoint() // empty --endpoint\n// after\nflag.Parse()\nif *jobopts.Endpoint == \"\" {\n    flag.Set(\"endpoint\", \"localhost:8099\")\n}\nendpoint, err := jobopts.GetEndpoint()","handlingStrategy":"try-catch","validationCode":"if *jobopts.Endpoint == \"\" {\n    return errors.New(\"--endpoint is required\")\n}","typeGuard":null,"tryCatchPattern":"ep, err := jobopts.GetEndpoint()\nif err != nil {\n    var mf jobopts.MissingFlagError\n    if errors.As(err, &mf) {\n        log.Fatal(\"provide --endpoint=<host:port>\")\n    }\n    return err\n}","preventionTips":["Always pass --endpoint when targeting a non-Dataflow runner","Register jobopts flags in every custom main via jobopts flags registration","Document required flags in your launch wrapper and validate before submit"],"tags":["go","cli-flag","configuration"],"backgroundTag":"missing-required-flag","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}