{"record":{"id":"b668fae1500d4147","repo":"apache/beam","slug":"we-were-unable-to-execute-the-subprocess-s-to-automatically","errorCode":null,"errorMessage":"We were unable to execute the subprocess \"%s\" to automatically build prism.\nAlternatively provide an alternate binary with the --prism_location flag.\nCaptured output:\n %s","messagePattern":"We were unable to execute the subprocess \"(.+?)\" to automatically build prism\\.\nAlternatively provide an alternate 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":448,"sourceCode":"    # 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,\n                             env=envdict,\n                             check=False)\n\n    if process.returncode == 0:\n      return '%s/prism' % (PrismJobServer.BIN_CACHE)\n\n    output = process.stdout.decode(\"utf-8\")\n    raise ValueError(\n        'We were unable to execute the subprocess \"%s\" to automatically '\n        'build prism.\\nAlternatively provide an alternate binary with the '\n        '--prism_location flag.'\n        '\\nCaptured output:\\n %s' % (process.args, output))\n\n  def _resolve_source_path(self) -> str:\n    \"\"\"Resolves and returns the source for the Prism binary.\n\n    The resolution follows this order:\n\n    1. A user-provided location (local path, GCS, or URL).\n    2. A pre-built binary from GitHub for a release version.\n    3. Build from local Go source for a development version.\n    \"\"\"\n    if self._path:\n      return self._resolve_from_location_override(self._path, self._version)\n\n    if '.dev' not in self._version:","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/prism_runner.py#L430-L466","documentation":"In _install_from_source, Prism is auto-built by invoking a subprocess ('go install' via go run). If the subprocess completes with a nonzero return code (and it did get executed), the library raises ValueError showing the subprocess args and its captured stdout/stderr so the user can supply a binary manually.","triggerScenarios":"Automatic prism build subprocess (process.args, typically 'go install github.com/apache/beam/sdks/v2/go/cmd/prism@...') returns nonzero after being launched; process.stdout is decoded and embedded in the error.","commonSituations":"Network failures fetching the Go module from proxy.golang.org; Go version mismatch with the module; module version/tag that doesn't exist; proxies blocking downloads in corporate environments.","solutions":["Inspect the 'Captured output' in the message for the underlying go command failure","Fix network/proxy access to the Go module proxy (set GOPROXY/HTTPS_PROXY as needed)","Run the same 'go install ...' command manually to reproduce and fix the error","Provide a prebuilt prism binary via --prism_location to bypass automatic builds"],"exampleFix":"// before\n--runner=PrismRunner  # auto-build fails behind proxy\n// after\nexport HTTPS_PROXY=http://proxy:8080\n# or\n--prism_location=/usr/local/bin/prism","handlingStrategy":"try-catch","validationCode":"import subprocess\nr = subprocess.run(['go', 'install', 'github.com/apache/beam/sdks/v2/go/cmd/prism@latest'], capture_output=True)\nif r.returncode != 0:\n    print(r.stdout, r.stderr)  # fix go env/network before running Beam","typeGuard":"def can_build_prism() -> bool:\n    import shutil, subprocess\n    if shutil.which('go') is None:\n        return False\n    return subprocess.run(['go', 'env', 'GOMODCACHE'], capture_output=True).returncode == 0","tryCatchPattern":"try:\n    server = PrismJobServer(options)\nexcept ValueError as e:\n    if 'unable to execute the subprocess' in str(e):\n        logger.error('Prism auto-build failed; see captured output:\\n%s', e)\n        raise SystemExit(3)","preventionTips":["Ensure outbound access to proxy.golang.org or configure GOPROXY for your network","Keep the Go toolchain version compatible with the Beam Go module","Warm the binary cache by installing prism once before running pipelines at scale"],"tags":["apache-beam","prism","subprocess","go-build"],"backgroundTag":"command-not-found","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"}