{"record":{"id":"bff4d67748272f7f","repo":"apache/beam","slug":"error-occurred","errorCode":null,"errorMessage":"error occurred","messagePattern":"error occurred","errorType":"console","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/testing/load_tests/build.gradle","lineNumber":68,"sourceCode":"    }\n\n    String requirementsTxtFileArg = project.findProperty(requirementsTxtFileProperty) ?: null\n    if (requirementsTxtFileArg != null) {\n    doFirst {\n        exec {\n          setWorkingDir \"${project.rootDir}/sdks/python\"\n          executable 'sh'\n          args '-c', \"${project.ext.envdir}/bin/python -m pip install -r ${requirementsTxtFileArg}\"\n        }\n     }\n   }\n    setWorkingDir \"${project.rootDir}/sdks/python\"\n    commandLine 'sh', '-c', \"${project.ext.envdir}/bin/python -m ${mainClass} --test-pipeline-options=\\\"${parseOptions(loadTestArgs)}\\\" --ignore-files \\'.*py3\\\\d?\\\\.py\\$\\'\"\n    ignoreExitValue true\n\n    doLast {\n        if (executionResult.get().exitValue != 0) {\n            throw new GradleException('error occurred')\n        }\n    }\n}\n\ndef parseOptions(String option) {\n    option.replace('\\\"', '\\\\\"')\n}","sourceCodeStart":50,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/testing/load_tests/build.gradle#L50-L75","documentation":"Beam's Python load-test Gradle tasks run the test module via a shell command with ignoreExitValue=true, then inspect the exit code in doLast. If the Python process exited non-zero, the build throws this generic GradleException('error occurred').","triggerScenarios":"Running any Beam load test task (e.g. `./gradlew :sdks:python:apache_beam:testing:load_tests:runLoadTest`) where the invoked Python module fails — bad --test-pipeline-options, missing GCP credentials, or a crashed pipeline.","commonSituations":"Misquoted JSON in loadTestArgs pipeline options; the virtualenv at project.ext.envdir missing or broken; Dataflow job failure during a load test run on CI.","solutions":["Scroll up in the Gradle output to find the real Python/beam error printed before the generic exception.","Verify --test-pipeline-options JSON is correctly escaped (parseOptions only escapes double quotes).","Confirm the Python virtualenv (envdir) exists and has apache_beam installed; rerun installGcpTest.","Re-run the single load test directly with python -m <mainClass> to see the full traceback."],"exampleFix":"// before\n./gradlew :sdks:python:...:runLoadTest -PloadTestArgs='{\"num_workers\":1'\n// after\n./gradlew :sdks:python:...:runLoadTest -PloadTestArgs='{\"num_workers\": 1}'","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  exec(\"./gradlew runLoadTest -PloadTestArgs=...\")\n} catch (e) {\n  log(e.output) // real Python failure is printed above the generic 'error occurred'\n}","preventionTips":["Validate the loadTestArgs JSON before launching the Gradle task.","Ensure the envdir virtualenv exists with apache_beam installed.","Rerun the Python module directly to capture the true traceback."],"tags":["gradle","python","load-test","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"}