{"record":{"id":"79ec1aa3332a6c9a","repo":"apache/beam","slug":"unable-to-install-a-local-of-prism-s-likely-go-is-not","errorCode":null,"errorMessage":"Unable to install a local of Prism: \"%s\";\nLikely Go is not installed, or a local change to Prism did not compile.\nPlease install Go (see https://go.dev/doc/install) to enable automatic local builds.\nAlternatively provide a binary with the --prism_location flag.\nCaptured output:\n %s","messagePattern":"Unable to install a local of Prism: \"(.+?)\";\nLikely Go is not installed, or a local change to Prism did not compile\\.\nPlease install Go \\(see https://go\\.dev/doc/install\\) to enable automatic local builds\\.\nAlternatively provide a binary with the --prism_location flag\\.\nCaptured output:\n (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/prism_runner.py","lineNumber":422,"sourceCode":"                             env=envdict,\n                             check=False)\n    if process.returncode == 0:\n      # Successfully installed\n      return '%s/prism' % (PrismJobServer.BIN_CACHE)\n\n    # We failed to build for some reason.\n    output = process.stdout.decode(\"utf-8\")\n    if (\"not in a module\" not in output) and (\"no required module provides\"\n                                              not in output):\n      # This branch handles two classes of failures:\n      # 1. Go isn't installed, so it needs to be installed by the Beam SDK\n      #   developer.\n      # 2. Go is installed, and they are building in a local version of Prism,\n      #    but there was a compile error that the developer should address.\n      # Either way, the @latest fallback either would fail, or hide the error,\n      # so fail now.\n      _LOGGER.info(output)\n      raise ValueError(\n          'Unable to install a local of Prism: \"%s\";\\n'\n          'Likely Go is not installed, or a local change to Prism did not '\n          'compile.\\nPlease install Go (see https://go.dev/doc/install) to '\n          'enable automatic local builds.\\n'\n          'Alternatively provide a binary with the --prism_location flag.'\n          '\\nCaptured output:\\n %s' % (version, output))\n\n    # Go is installed and claims we're not in a Go module that has access to\n    # the Prism package.\n\n    # Fallback to using the @latest version of prism, which works everywhere.\n    _LOGGER.info(\n        'Installing prism from \"%s@latest\" into \"%s\".',\n        PRISMPKG,\n        PrismJobServer.BIN_CACHE)\n    process = subprocess.run([\"go\", \"install\", PRISMPKG + \"@latest\"],\n                             stdout=subprocess.PIPE,\n                             stderr=subprocess.STDOUT,","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/prism_runner.py#L404-L440","documentation":"When Prism must be built locally from source (go install), _install_from_source runs the Go toolchain and checks the captured output. If it fails — either Go is not installed or the local Prism source does not compile — the @latest fallback would fail or hide the error, so ValueError is raised immediately with the captured output.","triggerScenarios":"_resolve_source_path falls back to local source build (e.g. prism_location points at a local source tree, or a developer build) and the 'go install/build' subprocess exits nonzero, including when the go binary is absent.","commonSituations":"Go missing from PATH on CI or a fresh machine; developing a local change to Prism that has a compile error; broken GOPATH/module setup; Go toolchain too old for the Prism module's go directive.","solutions":["Read the captured output in the message to identify the actual failure","Install Go (https://go.dev/doc/install) and verify 'go version' works in your shell","If building a local Prism change, fix the compile errors reported in the captured output","Alternatively pass a prebuilt prism binary via --prism_location to skip source builds"],"exampleFix":"// before (shell)\npython -m apache_beam.runners.portability.prism_runner ...   # fails, no Go\n// after\n# install Go, then\ngo version && python -m apache_beam.runners.portability.prism_runner ...","handlingStrategy":"fallback","validationCode":"import shutil\nif shutil.which('go') is None:\n    raise SystemExit('Go is not installed; install from https://go.dev/doc/install or pass --prism_location <binary>')","typeGuard":"def go_available() -> bool:\n    return shutil.which('go') is not None","tryCatchPattern":"try:\n    server = PrismJobServer(options)\nexcept ValueError as e:\n    if 'Unable to install a local of Prism' in str(e):\n        print(e)  # includes captured go output\n        sys.exit(2)","preventionTips":["Install Go on all machines that run Beam Prism builds, including CI images","Compile your local Prism change with 'go build ./...' before pointing Beam at it","Prefer shipping a prebuilt prism binary via --prism_location in CI"],"tags":["apache-beam","prism","go-toolchain","build-failure"],"backgroundTag":"missing-dependency","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"}