{"record":{"id":"eaee047be50aa989","repo":"apache/hadoop","slug":"accesskeyid-and-accesskeysecret-should-not-be-null","errorCode":null,"errorMessage":"AccessKeyId and AccessKeySecret should not be null or empty.","messagePattern":"AccessKeyId and AccessKeySecret should not be null or empty\\.","errorType":"validation","errorClass":"InvalidCredentialsException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunCredentialsProvider.java","lineNumber":57,"sourceCode":"    String accessKeyId;\n    String accessKeySecret;\n    String securityToken;\n    try {\n      accessKeyId = AliyunOSSUtils.getValueWithKey(conf, ACCESS_KEY_ID);\n      accessKeySecret = AliyunOSSUtils.getValueWithKey(conf, ACCESS_KEY_SECRET);\n    } catch (IOException e) {\n      throw new InvalidCredentialsException(e);\n    }\n\n    try {\n      securityToken = AliyunOSSUtils.getValueWithKey(conf, SECURITY_TOKEN);\n    } catch (IOException e) {\n      securityToken = null;\n    }\n\n    if (StringUtils.isEmpty(accessKeyId)\n        || StringUtils.isEmpty(accessKeySecret)) {\n      throw new InvalidCredentialsException(\n          \"AccessKeyId and AccessKeySecret should not be null or empty.\");\n    }\n\n    if (StringUtils.isNotEmpty(securityToken)) {\n      credentials = new DefaultCredentials(accessKeyId, accessKeySecret,\n          securityToken);\n    } else {\n      credentials = new DefaultCredentials(accessKeyId, accessKeySecret);\n    }\n  }\n\n  @Override\n  public void setCredentials(Credentials creds) {\n    if (creds == null) {\n      throw new InvalidCredentialsException(\"Credentials should not be null.\");\n    }\n\n    credentials = creds;","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunCredentialsProvider.java#L39-L75","documentation":"Error \"AccessKeyId and AccessKeySecret should not be null or empty.\" thrown in apache/hadoop.","triggerScenarios":"Thrown by AliyunCredentialsProvider when fs.oss.accessKeyId or fs.oss.accessKeySecret is missing or empty in the configuration. Set both credentials (or use a credentials provider/temporary token) before accessing OSS.","commonSituations":"See trigger scenarios.","solutions":["Set fs.oss.accessKeyId and fs.oss.accessKeySecret (or provide credentials via a credentials provider) with non-empty values.","If using temporary/instance-role credentials, configure the matching provider class instead of static keys."],"exampleFix":"<property><name>fs.oss.accessKeyId</name><value>YOUR_ID</value></property>\n<property><name>fs.oss.accessKeySecret</name><value>YOUR_SECRET</value></property>","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}