{"record":{"id":"5a4e6a9eb9ed4bea","repo":"apache/iceberg","slug":"failed-to-create-rrsa-oss-client","errorCode":null,"errorMessage":"Failed to create RRSA OSS client","messagePattern":"Failed to create RRSA OSS client","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java","lineNumber":165,"sourceCode":"                    if (cred.getExpiration() > 0) {\n                      expirationSeconds =\n                          (cred.getExpiration() - System.currentTimeMillis()) / 1000;\n                    }\n                    this.currentCredentials =\n                        new BasicCredentials(\n                            cred.getAccessKeyId(),\n                            cred.getAccessKeySecret(),\n                            cred.getSecurityToken(),\n                            expirationSeconds);\n                    return this.currentCredentials;\n                  } catch (Exception e) {\n                    throw new RuntimeException(\"Failed to get RRSA credentials\", e);\n                  }\n                }\n              };\n          return new OSSClientBuilder().build(endpoint, ossCredProvider);\n        } catch (Exception e) {\n          throw new RuntimeException(\"Failed to create RRSA OSS client\", e);\n        }\n      } else if (Strings.isNullOrEmpty(aliyunProperties.securityToken())) {\n        return new OSSClientBuilder()\n            .build(\n                aliyunProperties.ossEndpoint(),\n                aliyunProperties.accessKeyId(),\n                aliyunProperties.accessKeySecret());\n      } else {\n        return new OSSClientBuilder()\n            .build(\n                aliyunProperties.ossEndpoint(),\n                aliyunProperties.accessKeyId(),\n                aliyunProperties.accessKeySecret(),\n                aliyunProperties.securityToken());\n      }\n    }\n\n    @Override","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java#L147-L183","documentation":"After the RRSA credential provider is built, the OSS client itself is constructed with OSSClientBuilder. Any exception during client construction/first-time setup is wrapped as RuntimeException(\"Failed to create RRSA OSS client\", e). It indicates the OSS client could not be created under RRSA auth.","triggerScenarios":"newOSSClient invoked with RRSA enabled: invalid oss.endpoint value, OSSClientBuilder failing due to malformed endpoint URL, or the credential provider throwing during client initialization.","commonSituations":"Wrong endpoint region (e.g. missing https:// or wrong region domain); DNS resolution failure; RRSA properties partially set so provider construction half-fails.","solutions":["Read the wrapped cause to see whether the endpoint or the credential provider failed; fix that first.","Verify oss.endpoint is a valid OSS regional endpoint (e.g. https://oss-cn-hangzhou.aliyuncs.com).","Confirm all RRSA properties are set consistently (provider ARN, role ARN, session name).","Test OSS connectivity from the host (DNS/firewall)."],"exampleFix":"// before\nconf.set(\"oss.endpoint\", \"oss-cn-hangzhou\");\n\n// after\nconf.set(\"oss.endpoint\", \"https://oss-cn-hangzhou.aliyuncs.com\");","handlingStrategy":"validation","validationCode":"String ep = properties.get(\"oss.endpoint\");\nif (ep == null || !ep.matches(\"https?://oss-[a-z0-9-]+\\.aliyuncs\\.com\")) {\n  throw new IllegalArgumentException(\"oss.endpoint is not a valid OSS regional endpoint: \" + ep);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use fully-qualified https OSS regional endpoints.","Test DNS/network reachability to the endpoint before launching jobs.","Keep RRSA and endpoint settings together in one validated config block."],"tags":["aliyun","oss","client-initialization","network"],"backgroundTag":"module-init-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}