apache/beam · error · ValueError
We were unable to execute the subprocess
Error message
We were unable to execute the subprocess "%s" to automatically build prism. Alternatively provide an alternate binary with the --prism_location flag. Captured output: %s
What it means
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.
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
Example fix
// before --runner=PrismRunner # auto-build fails behind proxy // after export HTTPS_PROXY=http://proxy:8080 # or --prism_location=/usr/local/bin/prism
Defensive patterns
Strategy: try-catch
Validate before calling
import subprocess
r = subprocess.run(['go', 'install', 'github.com/apache/beam/sdks/v2/go/cmd/prism@latest'], capture_output=True)
if r.returncode != 0:
print(r.stdout, r.stderr) # fix go env/network before running Beam Type guard
def can_build_prism() -> bool:
import shutil, subprocess
if shutil.which('go') is None:
return False
return subprocess.run(['go', 'env', 'GOMODCACHE'], capture_output=True).returncode == 0 Try / catch
try:
server = PrismJobServer(options)
except ValueError as e:
if 'unable to execute the subprocess' in str(e):
logger.error('Prism auto-build failed; see captured output:\n%s', e)
raise SystemExit(3) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- error connecting to job server at
- Failed to build sdk container with local docker, stderr
- Provided --prism_location URL is not an Apache Beam Github…
- Returning elements from _SubprocessDoFn.finish_bundle not…
- Service failed to start up with error
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/b668fae1500d4147.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/python/apache_beam/runners/portability/prism_runner.py:448
# Go is installed and claims we're not in a Go module that has access to
# the Prism package.
# Fallback to using the @latest version of prism, which works everywhere.
_LOGGER.info(
'Installing prism from "%s@latest" into "%s".',
PRISMPKG,
PrismJobServer.BIN_CACHE)
process = subprocess.run(["go", "install", PRISMPKG + "@latest"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
env=envdict,
check=False)
if process.returncode == 0:
return '%s/prism' % (PrismJobServer.BIN_CACHE)
output = process.stdout.decode("utf-8")
raise ValueError(
'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' % (process.args, output))
def _resolve_source_path(self) -> str:
"""Resolves and returns the source for the Prism binary.
The resolution follows this order:
1. A user-provided location (local path, GCS, or URL).
2. A pre-built binary from GitHub for a release version.
3. Build from local Go source for a development version.
"""
if self._path:
return self._resolve_from_location_override(self._path, self._version)
if '.dev' not in self._version:View on GitHub (pinned to 12126d8942)