8000 HADOOP-17725. Improve error message for token providers in ABFS by virajjasani · Pull Request #3041 · apache/hadoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HADOOP-17725. Improve error message for token providers in ABFS #3041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

virajjasani
Copy link
Contributor

No description provided.

Copy link
@sadikovi sadikovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to cover all of the token providers since they are all similar and have the same problem. Here is my patch for this issue (in my own fork, so the lines might be different):

--- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java
+++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java
@@ -774,16 +774,16 @@ public AccessTokenProvider getTokenProvider() throws TokenAccessProviderExceptio
 
         AccessTokenProvider tokenProvider = null;
         if (clientCredsTokenProviderName.equals(tokenProviderClassName)) {
-          String authEndpoint = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT);
-          String clientId = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
-          String clientSecret = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_SECRET);
+          String authEndpoint = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT);
+          String clientId = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
+          String clientSecret = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_SECRET);
           tokenProvider =getClientCredsTokenProvider(
             authEndpoint, clientId, clientSecret);
           LOG.trace("ClientCredsTokenProvider initialized");
         } else if (userPasswordTokenProviderName.equals(tokenProviderClassName)) {
-          String authEndpoint = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT);
-          String username = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_USER_NAME);
-          String password = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_USER_PASSWORD);
+          String authEndpoint = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT);
+          String username = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_USER_NAME);
+          String password = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_USER_PASSWORD);
           tokenProvider = getUserPasswordTokenProvider(
             authEndpoint, username, password);
           LOG.trace("UserPasswordTokenProvider initialized");
@@ -791,8 +791,8 @@ public AccessTokenProvider getTokenProvider() throws TokenAccessProviderExceptio
           String authEndpoint = getTrimmedPasswordString(
               FS_AZURE_ACCOUNT_OAUTH_MSI_ENDPOINT,
               AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_MSI_ENDPOINT);
-          String tenantGuid = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_MSI_TENANT);
-          String clientId = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
+          String tenantGuid = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_MSI_TENANT);
+          String clientId = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
           String authority = getTrimmedPasswordString(
               FS_AZURE_ACCOUNT_OAUTH_MSI_AUTHORITY,
               AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_MSI_AUTHORITY);
@@ -804,8 +804,8 @@ public AccessTokenProvider getTokenProvider() throws TokenAccessProviderExceptio
           String authEndpoint = getTrimmedPasswordString(
               FS_AZURE_ACCOUNT_OAUTH_REFRESH_TOKEN_ENDPOINT,
               AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_REFRESH_TOKEN_ENDPOINT);
-          String refreshToken = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_REFRESH_TOKEN);
-          String clientId = getPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
+          String refreshToken = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_REFRESH_TOKEN);
+          String clientId = getRequiredPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
           tokenProvider = getRefreshTokenBasedTokenProvider(authEndpoint,
               clientId, refreshToken);
           LOG.trace("RefreshTokenBasedTokenProvider initialized");
@@ -1004,9 +1004,27 @@ void setIsNamespaceEnabledAccount(String isNamespaceEnabledAccount) {
     this.isNamespaceEnabledAccount = isNamespaceEnabledAccount;
   }
 
+  /**
+   * Returns a value for the key if the value exists and is not null.
+   * Otherwise, throws NullPointerException.
+   * @param key Account-agnostic configuration key
+   * @return value in String form if one exists
+   * @throws NullPointerException when the value is null
+   * @throws IOException
+   */
+  private String getRequiredPasswordString(String key) throws IOException {
+    String value = getPasswordString(key);
+    if (value == null) {
+      throw new ConfigurationPropertyNotFoundException(key);
+    }
+    return value;
+  }

IMHO, it is better to do it in AbfsConfiguration since you already have all of the methods there + config keys that the code is trying to look up, so the changes are very concise.

Preconditions.checkNotNull(clientSecret, "clientSecret");
final String clientId, final String clientSecret)
throws AzureBlobFileSystemException {
validateClientCredsTokenProvider(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not going to work. You probably want to keep non-null check here, since this class does not depend on Hadoop configuration.


this.authEndpoint = authEndpoint;
this.clientId = clientId;
this.clientSecret = clientSecret;
}

private void validateClientCredsTokenProvider(final String configName,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, it is better to move it to AbfsConfiguration.java. It will allow you to cover other token providers there as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the code which gets the config and instantiates the tokenprovider

final AbfsConfiguration abfsConf = new AbfsConfiguration(conf, accountName);

setAuthConfig(abfsConf, true, AuthType.OAuth);
abfsConf.unset(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT + "." + accountName);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... Can you create some kind of for loop to iterate over the keys, otherwise, the code is duplicated quite a bit. I would also suggest creating separate tests for each.

@sadikovi
Copy link

I would appreciate it if you could address the comments, thanks.

@virajjasani virajjasani force-pushed the HADOOP-17725-trunk branch 2 times, most recently from 19fe670 to a67a1b2 Compare May 21, 2021 17:53
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 8m 54s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 34m 5s trunk passed
+1 💚 compile 0m 39s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 compile 0m 36s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 checkstyle 0m 29s trunk passed
+1 💚 mvnsite 0m 41s trunk passed
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 32s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 1s trunk passed
+1 💚 shadedclient 13m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 31s the patch passed
+1 💚 compile 0m 31s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javac 0m 31s the patch passed
+1 💚 compile 0m 27s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 javac 0m 27s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 18s the patch passed
+1 💚 mvnsite 0m 31s the patch passed
+1 💚 javadoc 0m 22s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 22s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 0s the patch passed
+1 💚 shadedclient 13m 49s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 0s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 33s The patch does not generate ASF License warnings.
83m 18s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/3/artifact/out/Dockerfile
GITHUB PR #3041
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux ab52e391e0eb 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a67a1b20e529973b2776c00e16df75d87bc47eb6
Default Java Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/3/testReport/
Max. process+thread count 652 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@virajjasani
Copy link
Contributor Author

I would appreciate it if you could address the comments, thanks.

Thanks for the review @sadikovi, I missed out of on other token providers initially. Please take a look.
Thanks

Copy link
@sadikovi sadikovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for fixing it!

@virajjasani
Copy link
Contributor Author

@aajisaka would you like to take a look?

@virajjasani
Copy link
Contributor Author

@surendralilhore @goiri @steveloughran Could you please review this PR?

import java.util.Collections;
import java.util.List;

import org.apache.hadoop.fs.azurebfs.contracts.exceptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usual losing battle on import isolation, split from non org.apache stuffl

private void testMissingConfigKey(final AbfsConfiguration abfsConf,
final String confKey) {
try {
abfsConf.getTokenProvider().getClass().getTypeName();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use LambdaTestUtils.intercept.

*
* @param key Account-agnostic configuration key
* @return value if exists
* @throws IOException if error in fetching password or if value does not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+mention ConfigurationPropertyNotFoundException for missing key

@apache apache deleted a comment from hadoop-yetus May 27, 2021
@apache apache deleted a comment from hadoop-yetus May 27, 2021
@steveloughran
Copy link
Contributor

@steveloughran Could you please review this PR?

which endpoint did you run against? Remember: "no tests: no review"

@virajjasani virajjasani force-pushed the HADOOP-17725-trunk branch from a67a1b2 to c8ed0cc Compare May 27, 2021 12:27
@virajjasani
Copy link
Contributor Author

@steveloughran Could you please review this PR?

which endpoint did you run against? Remember: "no tests: no review"

Unfortunately, I don't have access to test env as of today (non-tech reasons), sorry about that. However, the reason I offered help for this Jira is because of well written unit tests that I was exploring some time back. I was able to reproduce the exact issue reported by @sadikovi using unit test and then realized that source changes are not complex enough to test on real time test env. Please let me know if this works.

@virajjasani
Copy link
Contributor Author

Addressed comments from recent review cycle.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 41s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 34m 36s trunk passed
+1 💚 compile 0m 39s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 compile 0m 36s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 checkstyle 0m 29s trunk passed
+1 💚 mvnsite 0m 41s trunk passed
+1 💚 javadoc 0m 33s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 31s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 0s trunk passed
+1 💚 shadedclient 14m 30s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 31s the patch passed
+1 💚 compile 0m 30s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javac 0m 30s the patch passed
+1 💚 compile 0m 26s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 javac 0m 26s the patch passed
+1 💚 blanks 0m 1s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 32s the patch passed
+1 💚 javadoc 0m 23s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 23s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 2s the patch passed
+1 💚 shadedclient 14m 24s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 1m 59s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
76m 42s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/4/artifact/out/Dockerfile
GITHUB PR #3041
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux bd9a9f098e43 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c8ed0cc25bd094240b6274df447bdc33aa93546c
Default Java Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/4/testReport/
Max. process+thread count 687 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@virajjasani virajjasani requested a review from steveloughran May 28, 2021 10:10
@sadikovi
Copy link

I concur, the issue can be easily reproduced in unit tests and the fix is fairly straightforward. Let me run a manual test with this commit in my dev environment.

@sadikovi
Copy link
sadikovi commented May 28, 2021

Tested commit c8ed0cc25bd094240b6274df447bdc33aa93546c. Ran the following code

import org.apache.hadoop.conf._
import org.apache.hadoop.fs._

val conf = new Configuration()

conf.set("fs.azure.account.auth.type", "OAuth")
conf.set("fs.azure.account.oauth.provider.type", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")
conf.set("fs.azure.account.oauth2.client.id", "<client-id>")
// conf.set("fs.azure.account.oauth2.client.secret.<account>.dfs.core.windows.net", "<client-secret>")
// conf.set("fs.azure.account.oauth2.client.secret", "<client-secret>")
conf.set("fs.azure.account.oauth2.client.endpoint", "https://login.microsoftonline.com/<endpoint>")

val path = new Path("abfss://<container>@<account>.dfs.core.windows.net/")
val fs = path.getFileSystem(conf)
fs.getFileStatus(path)

with the storage account in West US, everything seems to work correctly. If I comment out one or more configs, e.g. client-secret or client-id, the error message is as follows:

TokenAccessProviderException: Unable to load OAuth token provider class.
...
Caused by: ConfigurationPropertyNotFoundException: Configuration property fs.azure.account.oauth2.client.secret not found.
...

The code works when commenting out fs.azure.account.oauth2.client.secret or fs.azure.account.oauth2.client.secret.<account>.dfs.core.windows.net, the same is applicable to other configs.

@steveloughran
Copy link
Contributor

@virajjasani

source changes are not complex enough to test on real time test env. Please let me know if this works.

Given that a source change which may cause a regression, there is no source change for the hadoop-azure module which doesn't require the submitter to run the integration test suites. It's not about whether the new feature merits i a test, its "what of the existing features have stopped working". As for new features: the tests are there to stop the next person who touches the code from regressing this bit.

no test: no review

See the section in Testing hadoop-azure

@sadikovi if you are set up and willing to test this, are you able to run the mvn verify suite and state which endpoint, auth mechanism and build options were used?

unsetAuthConfig(abfsConf, true);
}

private void testMissingConfigKey(final AbfsConfiguration abfsConf,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever an exception doesn't match expected, its critical for the test case to throw up that exception so we can debug what's gone wrong from the test report alone. This one loses the stack trace on L399 and L403.

add verifyCause to verify cause type and GenericTestUtils.assertExceptionContains() to process, something like

assertExceptionContains("Configuration property "+confKey+" not found."),
    verifyCause(ConfigurationPropertyNotFoundException.class,
      intercept(TokenAccessProviderException.class,()->
        abfsConf.getTokenProvider().getClass().getTypeName())));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is addressed @steve F438 loughran. Please take a look when you get a chance. Thanks

@virajjasani virajjasani force-pushed the HADOOP-17725-trunk branch from c8ed0cc to 2a9849f Compare May 29, 2021 07:13
@virajjasani virajjasani force-pushed the HADOOP-17725-trunk branch from 2a9849f to 4b82454 Compare May 29, 2021 07:15
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 45s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 34m 12s trunk passed
+1 💚 compile 0m 40s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 compile 0m 36s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 checkstyle 0m 30s trunk passed
+1 💚 mvnsite 0m 41s trunk passed
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 31s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 2s trunk passed
+1 💚 shadedclient 13m 57s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 30s the patch passed
+1 💚 compile 0m 31s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javac 0m 31s the patch passed
+1 💚 compile 0m 26s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 javac 0m 26s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 30s the patch passed
+1 💚 javadoc 0m 24s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 21s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 0m 59s the patch passed
+1 💚 shadedclient 13m 39s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 1m 57s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
74m 58s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/6/artifact/out/Dockerfile
GITHUB PR #3041
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux 2b4581ec9939 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4b82454
Default Java Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/6/testReport/
Max. process+thread count 553 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/6/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 49s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 40m 53s trunk passed
+1 💚 compile 0m 44s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 compile 0m 38s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 checkstyle 0m 29s trunk passed
+1 💚 mvnsite 0m 42s trunk passed
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 31s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 12s trunk passed
+1 💚 shadedclient 18m 29s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 35s the patch passed
+1 💚 compile 0m 35s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javac 0m 35s the patch passed
+1 💚 compile 0m 29s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 javac 0m 29s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 18s the patch passed
+1 💚 mvnsite 0m 33s the patch passed
+1 💚 javadoc 0m 25s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 24s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 1m 13s the patch passed
+1 💚 shadedclient 15m 41s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 0s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
88m 59s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/5/artifact/out/Dockerfile
GITHUB PR #3041
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux 86713e68405f 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4b82454
Default Java Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/5/testReport/
Max. process+thread count 590 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3041/5/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@sadikovi
Copy link

@steveloughran

I ran the tests using the following:

mvn install -DskipTests
cd hadoop-tools/hadoop-azure
./dev-support/testrun-scripts/runtests.sh

Storage account is in West US and has HNS enabled. I configured all of the auth mechanisms in the src/test/resources/azure-auth-keys.xml.

I get the following output:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.601 s
[INFO] Finished at: 2021-05-31T10:32:23Z
[INFO] ------------------------------------------------------------------------

Running the combination: HNS-OAuth...
----- Test results -----
[INFO] Results:
[INFO] 
[WARNING] Tests run: 98, Failures: 0, Errors: 0, Skipped: 20
[INFO] Results:
[INFO] 
[WARNING] Tests run: 556, Failures: 0, Errors: 0, Skipped: 556
[INFO] Results:
[INFO] 
[WARNING] Tests run: 264, Failures: 0, Errors: 0, Skipped: 264

Time taken: 0 mins 52 secs.
Find test logs for the combination (HNS-OAuth) in: dev-support/testlogs/2021-05-31_10-32-23/Test-Logs-HNS-OAuth.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_10-32-23/Test-Results.txt
----------

Running the combination: HNS-SharedKey...
----- Test results -----
[INFO] Results:
[INFO] 
[WARNING] Tests run: 98, Failures: 0, Errors: 0, Skipped: 20
[INFO] Results:
[INFO] 
[WARNING] Tests run: 556, Failures: 0, Errors: 0, Skipped: 556
[INFO] Results:
[INFO] 
[WARNING] Tests run: 264, Failures: 0, Errors: 0, Skipped: 264

Time taken: 0 mins 52 secs.
Find test logs for the combination (HNS-SharedKey) in: dev-support/testlogs/2021-05-31_10-32-23/Test-Logs-HNS-SharedKey.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_10-32-23/Test-Results.txt
----------

Running the combination: NonHNS-SharedKey...
----- Test results -----
[INFO] Results:
[INFO] 
[WARNING] Tests run: 98, Failures: 0, Errors: 0, Skipped: 20
[INFO] Results:
[INFO] 
[WARNING] Tests run: 556, Failures: 0, Errors: 0, Skipped: 556
[INFO] Results:
[INFO] 
[WARNING] Tests run: 264, Failures: 0, Errors: 0, Skipped: 264

Time taken: 0 mins 53 secs.
Find test logs for the combination (NonHNS-SharedKey) in: dev-support/testlogs/2021-05-31_10-32-23/Test-Logs-NonHNS-SharedKey.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_10-32-23/Test-Results.txt

I am not quite sure why the integration tests are ignored. Do you know how I can configure them to run?

@virajjasani
Copy link
Contributor Author
virajjasani commented May 31, 2021

@sadikovi Thanks a lot for running this. One request for you: could you please also run this one in hadoop-azure module?

mvn -T 1C -Dparallel-tests=wasb clean verify
mvn -T 1C -Dparallel-tests=abfs clean verify

Here is the reference link.

Thanks

@sadikovi
Copy link

I tried running those commands but the tests are still ignored. azure-auth-keys.xml is fully configured - tests are ignored. I also updated the ones in src/test/resources/combinationConfigFiles but still the same outcome. No errors, the tests are simply ignored.

I triggered mvn test and got the following output:

[INFO] Results:
[INFO] 
[WARNING] Tests run: 348, Failures: 0, Errors: 0, Skipped: 101
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:15 min
[INFO] Finished at: 2021-05-31T12:08:10Z
[INFO] ------------------------------------------------------------------------

Did anyone try running the tests following the guide in the repository?

@sadikovi
Copy link

The error seems to be

<testcase name="testListStatusFile" classname="org.apache.hadoop.fs.azurebfs.contract.ITestAbfsFileSystemContractGetFileStatus" time="0">
  <skipped message="Not set: fs.azure.account.key"/>
</testcase>

but I am setting the key in azure-auth-keys.xml.

Also, I found that the tests only work/fail if you hardcode "fs.azure.account.key" in src/test/resources/combinationConfigFiles/NonHNS-SharedKey.xml (the account-specific config variant is ignored).

It seems https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-azure/src/site/markdown/testing_azure.md is missing a few configuration points, including installing dependencies to run the scripts on Ubuntu.

Would appreciate it if someone could share what I need to change exactly to run the tests. Thanks.

@virajjasani virajjasani requested a review from steveloughran May 31, 2021 13:57
@sadikovi
Copy link

Okay, I think I figured out how to run them. I think I confused mvn test with the runtests.sh, will post the test results soon-ish.

@sadikovi
Copy link

@steveloughran

Tested commit 4b82454.

NonHNS-SharedKey tests.

Storage account is in West US 2.
I checked the logs to make sure the integration tests ran.

ivan:/tmp/hadoop/hadoop-tools/hadoop-azure$ dev-support/testrun-scripts/runtests.sh -c "NonHNS-SharedKey"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.542 s
[INFO] Finished at: 2021-05-31T15:18:55Z
[INFO] ------------------------------------------------------------------------

Running the combination: NonHNS-SharedKey...
----- Test results -----
[INFO] Results:
[INFO] 
[INFO] Tests run: 98, Failures: 0, Errors: 0, Skipped: 0
[INFO] Results:
[INFO] 
[WARNING] Tests run: 556, Failures: 0, Errors: 0, Skipped: 277
[INFO] Results:
[INFO] 
[WARNING] Tests run: 265, Failures: 0, Errors: 0, Skipped: 40

Time taken: 10 mins 30 secs.
Find test logs for the combination (NonHNS-SharedKey) in: dev-support/testlogs/2021-05-31_15-18-55/Test-Logs-NonHNS-SharedKey.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_15-18-55/Test-Results.txt

HNS-OAuth tests.

Storage account is in West US.
I checked the logs to make sure the integration tests ran.

ivan:/tmp/hadoop/hadoop-tools/hadoop-azure$ dev-support/testrun-scripts/runtests.sh -c "HNS-OAuth"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.714 s
[INFO] Finished at: 2021-05-31T15:31:10Z
[INFO] ------------------------------------------------------------------------

Running the combination: HNS-OAuth...
----- Test results -----
[INFO] Results:
[INFO] 
[INFO] Tests run: 98, Failures: 0, Errors: 0, Skipped: 0
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testCheckAccessForNonExistentFile »  Unexp...
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionALL:293->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionEXECUTE:218->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionNONE:204->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionREAD:233->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionREADEXECUTE:263->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionWRITE:248->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionWRITEEXECUTE:278->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testWhenCheckAccessConfigIsOff:141->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemOauth.testBlobDataContributor:76->getBlobConributor:175->AbstractAbfsIntegrationTest.getFileSystem:254 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemOauth.testBlobDataReader:128->getBlobReader:183->AbstractAbfsIntegrationTest.getFileSystem:254 » AbfsRestOperation
[ERROR]   ITestAzureBlobFilesystemAcl.testEnsureAclOperationWorksForRoot:1261 » AccessDenied
[INFO] 
[ERROR] Tests run: 556, Failures: 0, Errors: 12, Skipped: 98
[INFO] Results:
[INFO] 
[WARNING] Tests run: 265, Failures: 0, Errors: 0, Skipped: 52

Time taken: 11 mins 35 secs.
Find test logs for the combination (HNS-OAuth) in: dev-support/testlogs/2021-05-31_15-31-10/Test-Logs-HNS-OAuth.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_15-31-10/Test-Results.txt

The failures are due to the fact that I forgot to configure CheckAccess part of the azure-auth-keys.xml.

HNS-SharedKey tests.

Storage account is in West US.
I checked the logs to make sure the integration tests ran.

ivan:/tmp/hadoop/hadoop-tools/hadoop-azure$ dev-support/testrun-scripts/runtests.sh -c "HNS-SharedKey"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.696 s
[INFO] Finished at: 2021-05-31T15:44:45Z
[INFO] ------------------------------------------------------------------------

Running the combination: HNS-SharedKey...
----- Test results -----
[INFO] Results:
[INFO] 
[INFO] Tests run: 98, Failures: 0, Errors: 0, Skipped: 0
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ITestAbfsRestOperationException.testCustomTokenFetchRetryCount:93->testWithDifferentCustomTokenFetchRetry:122->Assert.assertTrue:42->Assert.fail:89 Number of token fetch retries (4) done, does not match with fs.azure.custom.token.fetch.retry.count configured (0)
[ERROR] Errors: 
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testCheckAccessForNonExistentFile »  Unexp...
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionALL:293->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionEXECUTE:218->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionNONE:204->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionREAD:233->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionREADEXECUTE:263->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionWRITE:248->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testFsActionWRITEEXECUTE:278->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[ERROR]   ITestAzureBlobFileSystemCheckAccess.testWhenCheckAccessConfigIsOff:141->setupTestDirectoryAndUserAccess:357->modifyAcl:348 » AbfsRestOperation
[INFO] 
[ERROR] Tests run: 556, Failures: 1, Errors: 9, Skipped: 67
[INFO] Results:
[INFO] 
[WARNING] Tests run: 265, Failures: 0, Errors: 0, Skipped: 40

Time taken: 11 mins 8 secs.
Find test logs for the combination (HNS-SharedKey) in: dev-support/testlogs/2021-05-31_15-44-45/Test-Logs-HNS-SharedKey.txt
Find consolidated test results in: dev-support/testlogs/2021-05-31_15-44-45/Test-Results.txt

The failures are due to the fact that I forgot to configure CheckAccess part of the azure-auth-keys.xml.

CEB7

@steveloughran
Copy link
Contributor

@sadikovi great work, you've done more than anyone could ask for. You're also now set up for testing your own work.
I'll look at this PR on wednesday when I'm back at work.

@steveloughran steveloughran merged commit 00d372b into apache:trunk Jun 8, 2021
@steveloughran
Copy link
Contributor

merged into trunk; will cherrypick to branch-3.3 with a recompile to verify all is good. leaving JIRA open until then

asfgit pushed a commit that referenced this pull request Jun 8, 2021
@steveloughran
Copy link
Contributor

..and its done. Thank you everyone for your work.

@virajjasani virajjasani deleted the HADOOP-17725-trunk branch June 15, 2021 07:14
kiran-maturi pushed a commit to kiran-maturi/hadoop that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0