{"record":{"id":"a308a7f900979394","repo":"apache/beam","slug":"localpath-not-found-please-build-the-server-with-cd","errorCode":null,"errorMessage":"${localPath} not found. Please build the server with\n      cd ${projectRoot}; ./gradlew ${gradleTarget})","messagePattern":"(.+?) not found\\. Please build the server with\n      cd (.+?); \\./gradlew (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/utils/service.ts","lineNumber":318,"sourceCode":"          \"build\",\n          \"libs\",\n          JavaJarService.jarName(\n            artifactId,\n            version.replace(\"-SNAPSHOT\", \"\"),\n            \"SNAPSHOT\",\n            appendix,\n          ),\n        );\n\n    if (version.includes(\"SNAPSHOT\") && !projectRoot) {\n      version = \"latest\";\n    }\n\n    if (localPath && fs.existsSync(localPath)) {\n      console.info(\"Using pre-built snapshot at\", localPath);\n      return localPath;\n    } else if (version.includes(\"SNAPSHOT\")) {\n      throw new Error(\n        `${localPath} not found. Please build the server with\n      cd ${projectRoot}; ./gradlew ${gradleTarget})`,\n      );\n    } else {\n      return JavaJarService.mavenJarUrl(\n        artifactId,\n        version,\n        undefined,\n        appendix,\n      );\n    }\n  }\n\n  static async mavenJarUrl(\n    artifactId: string,\n    version: string,\n    classifier: string | undefined = undefined,\n    appendix: string | undefined = undefined,","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/utils/service.ts#L300-L336","documentation":"When the configured Beam version is a SNAPSHOT, gradleToJar expects a locally built jar (from a Gradle snapshot build) to exist at localPath. If the file does not exist, it throws with build instructions rather than falling back to Maven, because SNAPSHOT artifacts are not published to Maven Central.","triggerScenarios":"Using a 'SNAPSHOT' Beam version while the local Gradle-built server jar is absent at the expected path — e.g. pointing at a snapshot version without running `./gradlew <gradleTarget>` in the Beam project root.","commonSituations":"Developers tracking Beam master/SNAPSHOT who checked out the repo but never built the Java server; stale build output after switching versions; CI environments without the Gradle build step.","solutions":["Build the server: `cd <projectRoot> && ./gradlew <gradleTarget>` (as stated in the message).","Switch to a released (non-SNAPSHOT) Beam version so the jar is fetched from Maven.","Verify localPath points at the actual jar location produced by the Gradle build.","Set the project root configuration so the snapshot path resolves correctly."],"exampleFix":"// before: snapshot version with no local build\nversion = \"2.61.0-SNAPSHOT\";\n\n// after: either build it\ncd beam && ./gradlew :runners:portable:java:...  // per gradleTarget\n// or pin a release\nversion = \"2.60.0\";","handlingStrategy":"validation","validationCode":"import fs from 'fs';\nif (version.includes('SNAPSHOT') && !fs.existsSync(localPath)) {\n  throw new Error(`Build snapshot jar first: cd ${projectRoot}; ./gradlew ${gradleTarget}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  jar = await gradleToJar(...);\n} catch (e) {\n  if (/not found\\. Please build the server/.test(String(e))) {\n    // fall back to a released version\n    jar = JavaJarService.mavenJarUrl(artifactId, releaseVersion);\n  } else throw e;\n}","preventionTips":["Avoid SNAPSHOT versions unless you also run the Gradle build step.","Pin released Beam versions in CI.","Add a preflight check that the snapshot jar exists before launching."],"tags":["service-startup","build","snapshot","file-not-found"],"backgroundTag":"file-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"}