You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Carl (Jira)" <ji...@apache.org> on 2022/06/23 13:57:00 UTC

[jira] [Commented] (HADOOP-17725) Improve error message for token providers in ABFS

    [ https://issues.apache.org/jira/browse/HADOOP-17725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558102#comment-17558102 ] 

Carl commented on HADOOP-17725:
-------------------------------

The changes related to this ticket force to set optional fields and prevent from relying on Azure's metadata service to set them automatically.

Both [~vjasani] 's PR ([https://github.com/apache/hadoop/pull/3788)] and mine fix it ([https://github.com/apache/hadoop/pull/4262|https://github.com/apache/hadoop/pull/4262)]).

Can we get one of these merged please ?

> Improve error message for token providers in ABFS
> -------------------------------------------------
>
>                 Key: HADOOP-17725
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17725
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs/azure, hadoop-thirdparty
>    Affects Versions: 3.3.0
>            Reporter: Ivan Sadikov
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.3.2
>
>          Time Spent: 8h
>  Remaining Estimate: 0h
>
> It would be good to improve error messages for token providers in ABFS. Currently, when a configuration key is not found or mistyped, the error is not very clear on what went wrong. It would be good to indicate that the key was required but not found in Hadoop configuration when creating a token provider.
> For example, when running the following code:
> {code:java}
> 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", "my-client-id")
> // conf.set("fs.azure.account.oauth2.client.secret.my-account.dfs.core.windows.net", "my-secret")
> conf.set("fs.azure.account.oauth2.client.endpoint", "my-endpoint")
> val path = new Path("abfss://container@my-account.dfs.core.windows.net/")
> val fs = path.getFileSystem(conf)
> fs.getFileStatus(path){code}
> The following exception is thrown:
> {code:java}
> TokenAccessProviderException: Unable to load OAuth token provider class.
> ...
> Caused by: UncheckedExecutionException: java.lang.NullPointerException: clientSecret
> ...
> Caused by: NullPointerException: clientSecret {code}
> which does not tell what configuration key was not loaded.
>  
> IMHO, it would be good if the exception was something like this:
> {code:java}
> TokenAccessProviderException: Unable to load OAuth token provider class.
> ...
> Caused by: ConfigurationPropertyNotFoundException: Configuration property fs.azure.account.oauth2.client.secret not found. {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org