{"record":{"id":"7b806d2dd7688678","repo":"apache/hadoop","slug":"bucket-does-not-exist","errorCode":null,"errorMessage":"Bucket {} does not exist","messagePattern":"Bucket (.+?) does not exist","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"hadoop-cloud-storage-project/hadoop-huaweicloud/src/main/java/org/apache/hadoop/fs/obs/OBSCommonUtils.java","lineNumber":1445,"sourceCode":"          + OBSConstants.OBS_SECURITY_CREDENTIAL_PROVIDER_PATH);\n    }\n  }\n\n  /**\n   * Verify that the bucket exists. This does not check permissions, not even\n   * read access.\n   *\n   * @param owner the owner OBSFileSystem instance\n   * @throws FileNotFoundException the bucket is absent\n   * @throws IOException           any other problem talking to OBS\n   */\n  static void verifyBucketExists(final OBSFileSystem owner)\n      throws FileNotFoundException, IOException {\n    int retryTime = 1;\n    while (true) {\n      try {\n        if (!owner.getObsClient().headBucket(owner.getBucket())) {\n          throw new FileNotFoundException(\n              \"Bucket \" + owner.getBucket() + \" does not exist\");\n        }\n        return;\n      } catch (ObsException e) {\n        LOG.warn(\"Failed to head bucket for [{}], retry time [{}], \"\n                + \"exception [{}]\", owner.getBucket(), retryTime,\n            translateException(\"doesBucketExist\", owner.getBucket(),\n                e));\n\n        if (MAX_RETRY_TIME == retryTime) {\n          throw translateException(\"doesBucketExist\",\n              owner.getBucket(), e);\n        }\n\n        try {\n          Thread.sleep(DELAY_TIME);\n        } catch (InterruptedException ie) {\n          throw e;","sourceCodeStart":1427,"sourceCodeEnd":1463,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-huaweicloud/src/main/java/org/apache/hadoop/fs/obs/OBSCommonUtils.java#L1427-L1463","documentation":"OBSCommonUtils.verifyBucketExists calls headBucket(bucket) during OBSFileSystem.initialize; a definitive false (bucket really absent) throws FileNotFoundException('Bucket <bucket> does not exist'). Transient ObsException failures are retried up to MAX_RETRY_TIME with warnings; only after exhausting retries (or a clean false) does initialization fail. A clean false means name/endpoint/credentials pointed at a place where that bucket name is not visible — not necessarily that the bucket is gone.","triggerScenarios":"Initializing obs://bucket/ with a typo'd bucket name; wrong fs.obs.endpoint (different region or wrong service domain) so the bucket is invisible to that endpoint; AK/SK belonging to a different tenant/region that cannot see the bucket; bucket genuinely deleted; endpoint reachable only via proxy that is misconfigured (those surface as ObsException retries first).","commonSituations":"Cross-region endpoints after bucket migration; new clusters cloned from configs pointing at old endpoints; typos in bucket ARN-style names ('obs://my-buket'); IAM user scoped to another project; test configs promoted to prod with placeholder bucket names.","solutions":["Verify the exact bucket name and that it exists in the SAME region as fs.obs.endpoint (check with the OBS console or obsutil ls).","Fix fs.obs.endpoint to the region-correct endpoint (e.g. obs.cn-north-4.myhuaweicloud.com vs eu-west-101), then re-initialize.","Confirm the AK/SK owner has access to that bucket in that region (tenant/project alignment for temporary credentials).","If the bucket truly must be new, create it (console, obsutil, or a one-off bootstrap job) before starting the cluster/job."],"exampleFix":"# before (core-site.xml)\n<property><name>fs.obs.endpoint</name><value>obs.cn-north-4.myhuaweicloud.com</value></property>\n# bucket actually lives in eu-west-101 -> Bucket X does not exist\n\n# after\n<property><name>fs.obs.endpoint</name><value>obs.eu-west-101.myhuaweicloud.com</value></property>\n# verify: obsutil ls -bucket=my-bucket -e=obs.eu-west-101.myhuaweicloud.com","handlingStrategy":"validation","validationCode":"static void verifyBucketReachable(String bucket, String endpoint, String ak, String sk) {\n  ObsConfiguration c = new ObsConfiguration();\n  c.setEndPoint(endpoint);\n  try (ObsClient client = new ObsClient(ak, sk, c)) {\n    if (!client.headBucket(bucket)) {\n      throw new IllegalArgumentException(\"bucket \" + bucket + \" not visible at \" + endpoint);\n    }\n  } catch (ObsException e) {\n    throw new IllegalArgumentException(\"cannot reach OBS at \" + endpoint + \": \" + e.getMessage(), e);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  fs.initialize(obsUri, conf);\n} catch (FileNotFoundException e) {\n  if (String.valueOf(e.getMessage()).endsWith(\"does not exist\")) {\n    throw new ConfigException(\"bucket/endpoint mismatch — verify fs.obs.endpoint region and bucket name\", e);\n  }\n  throw e;\n}","preventionTips":["Keep bucket name and fs.obs.endpoint in one config template; validate pairs together at deploy.","Add a startup smoke test (headBucket) for every obs:// root the job touches.","Confirm AK/SK tenant/region scope for temporary credentials.","Beware retry exhaustion: repeated headBucket ObsExceptions eventually surface as the same init failure — read the warnings above it."],"tags":["obs","huaweicloud","bucket-not-found","endpoint","initialization"],"backgroundTag":"bucket-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}