apache/hadoop · error · IOException
Call cos sdk failed, call method: %s, exception: %s
Error message
Call cos sdk failed, call method: %s, exception: %s
What it means
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.
Source
Thrown at hadoop-cloud-storage-project/hadoop-cos/src/main/java/org/apache/hadoop/fs/cosn/CosNativeFileSystemStore.java:754
}
Thread.sleep(
ThreadLocalRandom.current().nextLong(sleepLeast, sleepBound));
++retryIndex;
} catch (InterruptedException e) {
throw new IOException(e.toString());
}
} else {
LOG.error(errMsg);
throw new IOException(errMsg);
}
} else {
throw cse;
}
} catch (Exception e) {
String errMsg = String.format("Call cos sdk failed, "
+ "call method: %s, exception: %s", sdkMethod, e.toString());
LOG.error(errMsg);
throw new IOException(errMsg);
}
}
}
@Override
public void close() {
if (null != this.cosClient) {
this.cosClient.shutdown();
}
}
}
View on GitHub (pinned to 2add963021)
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
Defensive patterns
Strategy: retry
Try / catch
try {
callStore();
} catch (IOException e) {
String m = e.getMessage() != null ? e.getMessage() : "";
if (m.startsWith("Call cos sdk failed, call method:")) {
// client-side failure; inspect suffix for DNS/proxy/lifecycle causes before retrying
LOG.error("COS SDK client failure: {}", m);
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- %s : %s
- dump not supported
- no such method
- No COS Credential Providers
- Credentials requested after provider list was closed
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/b5eda6fd869bfe3c.
Report an issue: GitHub.