You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Eclipse运行WordCount Dataflow云端报错:路径缺少对象或存储桶

Troubleshooting the Dataflow Cloud Run Error for WordCount

Let’s work through this issue you’re facing—your WordCount pipeline runs fine locally but throws that path error when moving to the cloud, even though your GCS bucket definitely exists. Here are practical fixes to try:

1. Fix the GCS Path Format

The error message is a big clue: your path gs://tough-shard-129113/ is being misinterpreted by the cloud runtime, which is stricter about path conventions than the local runner.

  • Remove the trailing slash: Try using gs://tough-shard-129113 instead of gs://tough-shard-129113/. Some Dataflow SDK versions struggle with trailing slashes when the path points directly to the bucket root.
  • Use a specific subpath/prefix: Instead of targeting the bucket root, create and use a dedicated subdirectory like gs://tough-shard-129113/wordcount-input for your input files and gs://tough-shard-129113/wordcount-output for results. This makes the path’s intent explicit and avoids parsing confusion.

2. Check Your Dataflow SDK Version

Since you’re using Java 8, make sure you’re on a compatible SDK version that handles GCS root paths correctly. Older SDK versions (pre-2.x) had parsing bugs for bucket-only paths. Upgrade to a Java 8-supported release (like SDK 2.5.0 or later) if you’re running an outdated version.

3. Verify Path Construction in Your Code

Double-check that your code isn’t accidentally malforming the GCS path:

  • If you’re concatenating strings to build paths, avoid adding unnecessary trailing slashes. For example, replace code like this:
    String outputPath = "gs://" + bucketName + "/"; // Trailing slash causes issues
    
    With:
    String outputPath = "gs://" + bucketName + "/wordcount-output"; // Explicit prefix
    
  • Confirm that your bucketName variable is correctly set to tough-shard-129113—no typos, extra characters, or missing parts.

4. Quick Permission Sanity Check

While the error is a path parsing issue, it’s worth confirming the service account running your Dataflow pipeline has proper permissions on tough-shard-129113. Permission issues can sometimes manifest indirectly, but focus on fixing the path format first—it’s the most likely culprit here.


内容的提问来源于stack exchange,提问作者toto'

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:15:33