{"record":{"id":"f59eaaa33fe968f8","repo":"apache/hadoop","slug":"name-credentials-requested-after-provider-list-wa","errorCode":null,"errorMessage":"{name}Credentials requested after provider list was closed","messagePattern":"(.+?)Credentials requested after provider list was closed","errorType":"exception","errorClass":"NoAuthWithAWSException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/AWSCredentialProviderList.java","lineNumber":164,"sourceCode":"\n  /**\n   * Was an implementation of the v1 refresh; now just\n   * a no-op.\n   */\n  @Deprecated\n  public void refresh() {\n  }\n\n  /**\n   * Iterate through the list of providers, to find one with credentials.\n   * If {@link #reuseLastProvider} is true, then it is re-used.\n   * @return a set of credentials (possibly anonymous), for authenticating.\n   */\n  @Override\n  public AwsCredentials resolveCredentials() {\n    if (isClosed()) {\n      LOG.warn(CREDENTIALS_REQUESTED_WHEN_CLOSED);\n      throw new NoAuthWithAWSException(name +\n          CREDENTIALS_REQUESTED_WHEN_CLOSED);\n    }\n    checkNotEmpty();\n    if (reuseLastProvider && lastProvider != null) {\n      return lastProvider.resolveCredentials();\n    }\n\n    SdkException lastException = null;\n    for (AwsCredentialsProvider provider : providers) {\n      try {\n        AwsCredentials credentials = provider.resolveCredentials();\n        Preconditions.checkNotNull(credentials,\n            \"Null credentials returned by %s\", provider);\n        if ((credentials.accessKeyId() != null && credentials.secretAccessKey() != null) || (\n            provider instanceof AnonymousCredentialsProvider\n                || provider instanceof AnonymousAWSCredentialsProvider)) {\n          lastProvider = provider;\n          LOG.debug(\"Using credentials from {}\", provider);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/AWSCredentialProviderList.java#L146-L182","documentation":"Error \"{name}Credentials requested after provider list was closed\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/AWSCredentialProviderList.java:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request credentials before closing the provider list; check lifecycle ordering in the calling code."],"exampleFix":null,"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-22T20:17:22.307Z"}