{"record":{"id":"a54d20c89fa15ab4","repo":"apache/hadoop","slug":"no-such-method","errorCode":null,"errorMessage":"no such method","messagePattern":"no such method","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":716,"sourceCode":"        } else if (request instanceof GetObjectMetadataRequest) {\n          sdkMethod = \"queryObjectMeta\";\n          return this.cosClient.getObjectMetadata(\n              (GetObjectMetadataRequest) request);\n        } else if (request instanceof DeleteObjectRequest) {\n          sdkMethod = \"deleteObject\";\n          this.cosClient.deleteObject((DeleteObjectRequest) request);\n          return new Object();\n        } else if (request instanceof CopyObjectRequest) {\n          sdkMethod = \"copyFile\";\n          return this.cosClient.copyObject((CopyObjectRequest) request);\n        } else if (request instanceof GetObjectRequest) {\n          sdkMethod = \"getObject\";\n          return this.cosClient.getObject((GetObjectRequest) request);\n        } else if (request instanceof ListObjectsRequest) {\n          sdkMethod = \"listObjects\";\n          return this.cosClient.listObjects((ListObjectsRequest) request);\n        } else {\n          throw new IOException(\"no such method\");\n        }\n      } catch (CosServiceException cse) {\n        String errMsg = String.format(\"Call cos sdk failed, \"\n                + \"retryIndex: [%d / %d], \"\n                + \"call method: %s, exception: %s\",\n            retryIndex, this.maxRetryTimes, sdkMethod, cse.toString());\n        int statusCode = cse.getStatusCode();\n        // Retry all server errors\n        if (statusCode / 100 == 5) {\n          if (retryIndex <= this.maxRetryTimes) {\n            LOG.info(errMsg);\n            long sleepLeast = retryIndex * 300L;\n            long sleepBound = retryIndex * 500L;\n            try {\n              if (request instanceof UploadPartRequest) {\n                if (((UploadPartRequest) request).getInputStream()\n                    instanceof ByteBufferInputStream) {\n                  ((UploadPartRequest) request).getInputStream().reset();","sourceCodeStart":698,"sourceCodeEnd":734,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-cos/src/main/java/org/apache/hadoop/fs/cosn/CosNativeFileSystemStore.java#L698-L734","documentation":"callCOSClientWithRetry dispatches on the concrete request type via instanceof chains (UploadPartRequest, DeleteObjectRequest, CopyObjectRequest, GetObjectRequest, ListObjectsRequest, ...). Any request object that is not one of the recognized types falls into the final else branch and throws IOException(\"no such method\") with no retry and no SDK call. This is a programming/versioning defect inside the connector or its callers, not a backend condition.","triggerScenarios":"Passing a request type the dispatch chain does not cover — e.g. a newly added COS SDK request class, a custom subclass of a known request, or calling the package-private retry helper directly with an unsupported request. Can also appear after mixing hadoop-cos jar versions with a qcloud cos_api sdk version that introduced new request types.","commonSituations":"Shading/classpath conflicts producing mismatched hadoop-cos + cos_api versions; custom code inside the org.apache.hadoop.fs.cosn package calling callCOSClientWithRetry; upgrading the COS SDK without upgrading the connector.","solutions":["Do not call callCOSClientWithRetry directly — use the public store/filesystem APIs, which construct only supported request types","Align the qcloud cos_api sdk version with the one the hadoop-cos release declares in its pom","If you maintain a fork, extend the instanceof dispatch chain to cover the new request type and send the mapping upstream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Don't reach the dispatch at all: only pass the request types it explicitly handles\nprivate static final Set<Class<?>> SUPPORTED = new HashSet<>(Arrays.asList(\n    PutObjectRequest.class, UploadPartRequest.class, DeleteObjectRequest.class,\n    CopyObjectRequest.class, GetObjectRequest.class, ListObjectsRequest.class));\nif (!SUPPORTED.contains(request.getClass())) {\n  throw new IllegalArgumentException(\"Unsupported request type: \" + request.getClass());\n}","typeGuard":"boolean isDispatchableRequest(Object r) {\n  return r instanceof PutObjectRequest || r instanceof UploadPartRequest\n      || r instanceof DeleteObjectRequest || r instanceof CopyObjectRequest\n      || r instanceof GetObjectRequest || r instanceof ListObjectsRequest;\n}","tryCatchPattern":null,"preventionTips":["Use the public store APIs instead of callCOSClientWithRetry","Pin the cos_api SDK version to the connector's declared dependency","Watch for jar shading conflicts after dependency upgrades"],"tags":["cosn","hadoop-cos","sdk-dispatch","version-mismatch","internal-api"],"backgroundTag":"unsupported-request-type","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}