{"record":{"id":"b5eda6fd869bfe3c","repo":"apache/hadoop","slug":"call-cos-sdk-failed-call-method-s-exception","errorCode":null,"errorMessage":"Call cos sdk failed, call method: %s, exception: %s","messagePattern":"Call cos sdk failed, call method: (.+?), exception: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-cos/src/main/java/org/apache/hadoop/fs/cosn/CosNativeFileSystemStore.java","lineNumber":754,"sourceCode":"              }\n              Thread.sleep(\n                  ThreadLocalRandom.current().nextLong(sleepLeast, sleepBound));\n              ++retryIndex;\n            } catch (InterruptedException e) {\n              throw new IOException(e.toString());\n            }\n          } else {\n            LOG.error(errMsg);\n            throw new IOException(errMsg);\n          }\n        } else {\n          throw cse;\n        }\n      } catch (Exception e) {\n        String errMsg = String.format(\"Call cos sdk failed, \"\n            + \"call method: %s, exception: %s\", sdkMethod, e.toString());\n        LOG.error(errMsg);\n        throw new IOException(errMsg);\n      }\n    }\n  }\n\n  @Override\n  public void close() {\n    if (null != this.cosClient) {\n      this.cosClient.shutdown();\n    }\n  }\n}\n","sourceCodeStart":736,"sourceCodeEnd":766,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-cos/src/main/java/org/apache/hadoop/fs/cosn/CosNativeFileSystemStore.java#L736-L766","documentation":"The catch-all branch of callCOSClientWithRetry: any failure during an SDK invocation that is NOT a CosServiceException (i.e. not an HTTP error response from COS) is logged and rethrown as IOException(\"Call cos sdk failed, call method: %s, exception: %s\"). These are client-side failures: misconfigured client, invalid request construction, interrupted threads, network-layer errors before a service response.","triggerScenarios":"SDK client used after shutdown, malformed request parameters (null bucket/key), UnknownHostException/proxy failures, InterruptedException-adjacent state bugs, or IllegalArgumentException from the cos_api client — all surfacing through one of the dispatched methods (putObject, getObject, copyObject, deleteObject, listObjects, uploadPart).","commonSituations":"Filesystem closed while a stream operation is still in flight (client shutdown race); JVM DNS failures to cos.<region>.myqcloud.com; HTTP proxy environment variables breaking the SDK's Apache client; cos_api version incompatible with the connector.","solutions":["Read the exception text after 'exception: ' — it names the concrete client-side cause; fix that (DNS, proxy, client lifecycle)","Ensure streams are closed before the filesystem is closed to avoid client-shutdown races","Verify the cos_api sdk version matches the connector's declared dependency","For network-level causes, test basic reachability of the COS endpoint from the node"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  callStore();\n} catch (IOException e) {\n  String m = e.getMessage() != null ? e.getMessage() : \"\";\n  if (m.startsWith(\"Call cos sdk failed, call method:\")) {\n    // client-side failure; inspect suffix for DNS/proxy/lifecycle causes before retrying\n    LOG.error(\"COS SDK client failure: {}\", m);\n  }\n  throw e;\n}","preventionTips":["Close streams before closing the filesystem to avoid client-shutdown races","Verify DNS/proxy reachability to cos.<region>.myqcloud.com on all nodes","Keep hadoop-cos and cos_api versions aligned"],"tags":["cosn","hadoop-cos","sdk-client-error","catch-all","ioexception"],"backgroundTag":"storage-sdk-call-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}