{"record":{"id":"137d00589fc581b9","repo":"apache/hadoop","slug":"not-supported-137d00","errorCode":null,"errorMessage":"Not supported","messagePattern":"Not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/tos/DelegationClient.java","lineNumber":420,"sourceCode":"      RequestOptionsBuilder... builders) throws TosException {\n    return retry(() -> client.deleteObject(bucket, objectKey, builders));\n  }\n\n  @Override\n  public DeleteMultiObjectsOutput deleteMultiObjects(\n      String bucket,\n      DeleteMultiObjectsInput input,\n      RequestOptionsBuilder... builders)\n      throws TosException {\n    return retry(() -> client.deleteMultiObjects(bucket, input, builders));\n  }\n\n  @Override\n  public PutObjectOutput putObject(\n      String bucket, String objectKey, InputStream inputStream,\n      RequestOptionsBuilder... builders)\n      throws TosException {\n    throw new UnsupportedOperationException(\"Not supported\");\n  }\n\n  @Override\n  public UploadFileOutput uploadFile(\n      String bucket, UploadFileInput input,\n      RequestOptionsBuilder... builders) throws TosException {\n    return retry(() -> client.uploadFile(bucket, input, builders));\n  }\n\n  @Override\n  public AppendObjectOutput appendObject(\n      String bucket, String objectKey, InputStream content, long offset,\n      RequestOptionsBuilder... builders)\n      throws TosException {\n    throw new UnsupportedOperationException(\"Not supported\");\n  }\n\n  @Override","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/tos/DelegationClient.java#L402-L438","documentation":"DelegationClient implements the TOS SDK's TOSV2 interface to wrap the real client with delegation/session-token refresh and retries. The raw putObject(bucket, objectKey, InputStream, RequestOptionsBuilder...) overload is intentionally unimplemented and throws UnsupportedOperationException(\"Not supported\"). Writes are expected to go through the connector's helper put(bucket, key, InputStreamProvider, contentLength, acl) or uploadFile(bucket, UploadFileInput), which are implemented.","triggerScenarios":"Custom code that obtains the TOSV2 client (e.g. via DelegationClientBuilder) and calls client.putObject(bucket, key, inputStream) directly; SDK example code ported unchanged from a plain TOSV2 client to a delegation-token deployment.","commonSituations":"Applications reaching into connector internals for side writes; STS/delegation-token environments where code was originally written against a directly built client.","solutions":["Use DelegationClient.put(bucket, key, InputStreamProvider, contentLength, acl) or uploadFile(bucket, UploadFileInput), which are supported","Write through the connector's normal path (FSDataOutputStream on tos://) instead of raw client calls","For ad-hoc putObject calls, build a separate plain TOSV2 client with explicit credentials"],"exampleFix":"// before\nclient.putObject(bucket, key, inputStream, builders);\n\n// after\nclient.put(bucket, key, () -> inputStream, contentLength, ACLType.ACL_PRIVATE);\n// or\nclient.uploadFile(bucket, uploadFileInput);","handlingStrategy":"validation","validationCode":"if (client instanceof DelegationClient) {\n  client.put(bucket, key, () -> inputStream, contentLength, ACLType.ACL_PRIVATE);\n} else {\n  client.putObject(bucket, key, inputStream);\n}","typeGuard":"private static boolean isDelegationClient(TOSV2 client) {\n  return client instanceof org.apache.hadoop.fs.tosfs.object.tos.DelegationClient;\n}","tryCatchPattern":"try {\n  client.putObject(bucket, key, inputStream);\n} catch (UnsupportedOperationException e) {\n  // route to the supported write path\n  client.put(bucket, key, () -> inputStream, contentLength, ACLType.ACL_PRIVATE);\n}","preventionTips":["Never call raw TOSV2 putObject on the delegation client; use its put/uploadFile helpers","Prefer the connector's FSDataOutputStream write path over raw client calls","Keep a separate plain TOSV2 client for ad-hoc SDK calls"],"tags":["hadoop-tos","volcengine-tos","delegation-token","unsupported-operation","object-upload"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}