Skip to content

HDDS-14578. Ozone admin command gives inconsistent error messages on expired keytab.#10160

Merged
sarvekshayr merged 9 commits into
apache:masterfrom
sravani-revuri:HDDS-14578
May 8, 2026
Merged

HDDS-14578. Ozone admin command gives inconsistent error messages on expired keytab.#10160
sarvekshayr merged 9 commits into
apache:masterfrom
sravani-revuri:HDDS-14578

Conversation

@sravani-revuri

@sravani-revuri sravani-revuri commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Ozone admin command gives inconsistent error messages on expired keytab for the following commands.

  1. ozone admin safemode status
  2. ozone admin container create
  3. ozone admin container info
bash-5.1$ ozone admin safemode status
Service ID: scmservice
Could not determine leader node
bash-5.1$ ozone admin container create
java.security.cert.CertificateException: org.apache.hadoop.security.AccessControlException: Permission denied.
~# ozone admin container info 69017
Unable to retrieve the container details for 69017
~# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: scm@example.COMValid starting       Expires              Service principal
01/30/2026 10:33:22  01/30/2026 20:33:22  krbtgt/example.COM@example.COM
        renew until 01/31/2026 10:33:10
~# date
Fri Feb  6 12:05:53 PM UTC 2026
root@ve1328:~# ozone admin scm roles
DestHost:destPort ve.example.com:9860 , LocalHost:localPort ve.example.com/10.xx:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
root@ve1328:~# ozone admin container info 69017
Unable to retrieve the container details for 69017
~# kinit -kt scm.keytab scm
~# ozone admin container info 69017
Container id: 69017
Pipeline id: 3c8208ce-46ca-4435-8554-f07a58ec6bf7
Write PipelineId: 7a571825-4751-4876-a6ac-acc4c097f282
Write Pipeline State: CLOSED
Container State: CLOSED

Works again on renewing the Kerberos credentials

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14578

How was this patch tested?

Manual test of ozone admin commands.

bash-5.1$ ozone admin container close 1
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin container report
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin om finalizeupgrade --service-id=omservice
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
bash-5.1$ ozone admin om lof
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
bash-5.1$ ozone admin om lok
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
bash-5.1$ ozone admin om roles
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
bash-5.1$ ozone admin datanode usageinfo --node-id=ba1d4f8a-1b59-4a12-80f8-d78e61a8f85
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin datanode status decommission
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin datanode decommission ba1d4f8a-1b59-4a12-80f8-d78e61a8f85
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin datanode maintenance ba1d4f8a-1b59-4a12-80f8-d78e61a8f85
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin datanode recommission ba1d4f8a-1b59-4a12-80f8-d78e61a8f85
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin containerbalancer start
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin containerbalancer status
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin safemode status
Service ID: scmservice
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin container create
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]

Reconcile command:

manula and unit test.

no keytab:

bash-5.1$ ozone admin container reconcile 1
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ ozone admin container reconcile 1 2 3
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]

non ratis contianer: (failure not form authentication)

bash-5.1$ ozone admin container reconcile 1 2 3
Container #1 not found for reconciliation.
Container #2 not found for reconciliation.
Container #3 not found for reconciliation.
Failed to trigger reconciliation for 3 containers
bash-5.1$ ozone admin container create
Container 1 is created with replication config STANDALONE/ONE.
bash-5.1$ ozone admin container create
Container 2 is created with replication config STANDALONE/ONE.
bash-5.1$ ozone admin container create
Container 3 is created with replication config STANDALONE/ONE.
bash-5.1$ ozone admin container reconcile 1 2 3
Cannot reconcile container 1 in state OPEN.
Cannot reconcile container 2 in state OPEN.
Cannot reconcile container 3 in state OPEN.
Failed to trigger reconciliation for 3 containers
bash-5.1$ ozone admin container close 1
bash-5.1$ ozone admin container close 2
bash-5.1$ ozone admin container close 3
ozone admin container reconcile 1 2 3
Cannot reconcile container #1 with replication type STAND_ALONE. Reconciliation is currently only supported for Ratis containers.
Cannot reconcile container #2 with replication type STAND_ALONE. Reconciliation is currently only supported for Ratis containers.
Cannot reconcile container #3 with replication type STAND_ALONE. Reconciliation is currently only supported for Ratis containers.
Failed to trigger reconciliation for 3 containers

normal:

bash-5.1$ ozone admin container create -t RATIS -r THREE
ozone admin container create -t RATIS -r THREE
ozone admin container create -t RATIS -r THREE
Container 4 is created with replication config RATIS/THREE.
Container 5 is created with replication config RATIS/THREE.
Container 6 is created with replication config RATIS/THREE.
bash-5.1$ ozone admin container close 4 5 6
bash-5.1$ ozone admin container reconcile 4 5 6
Reconciliation has been triggered for container 4
Reconciliation has been triggered for container 5
Reconciliation has been triggered for container 6

@Gargi-jais11
Gargi-jais11 self-requested a review April 30, 2026 04:21
@sravani-revuri sravani-revuri changed the title HDDS-14578. Ozone admin command gives Unable to retrieve the container details on expired keytab HDDS-14578. Ozone admin command gives inconsistent error messages on expired keytab. Apr 30, 2026
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @sravani-revuri for the patch. Are you planning to make admin commands more consistent, or just clarifying admin container info with the exception message?

@sravani-revuri

sravani-revuri commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @sravani-revuri for the patch. Are you planning to make admin commands more consistent, or just clarifying admin container info with the exception message?

I will be doing it for the other admin commands error messages mentioned in the jira. the jira was initially just for the container info command, but i had found some more inconsistencies. Updated the jira to handle it in this PR itself.

Will update the testing proof once i'm done.

@Gargi-jais11

Copy link
Copy Markdown
Contributor

@sravani-revuri For the other ozone admin commands which need to have clear error message, please update about it in the PR description.

@sravani-revuri

Copy link
Copy Markdown
Contributor Author

@Gargi-jais11 could you please take a look at these changes?

@sravani-revuri
sravani-revuri marked this pull request as ready for review May 1, 2026 07:21

@sreejasahithi sreejasahithi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for working on this
LGTM

@Gargi-jais11 Gargi-jais11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @sravani-revuri fixing this. LGTM!

@Gargi-jais11

Copy link
Copy Markdown
Contributor

@adoroszlai Do you want to have look into this?

@adoroszlai
adoroszlai requested a review from errose28 May 5, 2026 06:09
@adoroszlai

adoroszlai commented May 5, 2026

Copy link
Copy Markdown
Contributor

Thanks @sravani-revuri for working on this. I think these messages are still inconsistent:

bash-5.1$ ozone admin container info 1
Unable to retrieve the container details for 1. DestHost:destPort scm1.org:9860 , LocalHost:localPort scm1.org/172.25.0.116:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]

bash-5.1$ ozone admin container create
java.security.cert.CertificateException: java.io.IOException: Client cannot authenticate via:[KERBEROS]

bash-5.1$ ozone admin safemode status
Service ID: scmservice
Could not determine leader node. DestHost:destPort scm1.org:9860 , LocalHost:localPort scm1.org/172.25.0.116:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
  • different combinations of exceptions (IOException: AccessControlException, CertificateException: IOException)
  • confusing extra messages (Could not determine leader node, Failed on local exception)
  • unnecessary details present/absent (DestHost:destPort scm1.org:9860 , LocalHost:localPort scm1.org/172.25.0.116:0.)

Would it be possible to simply print AccessControlException: Client cannot authenticate via:[KERBEROS] or even rely on AccessControlException's default message and print Permission denied?

@sarvekshayr

sarvekshayr commented May 5, 2026

Copy link
Copy Markdown
Contributor

Would it be possible to simply print AccessControlException: Client cannot authenticate via:[KERBEROS] or even rely on AccessControlException's default message and print Permission denied?

Agreed, just the AccessControlException with a message across all admin commands would be clear and concise.
Similar to below shell commands -

bash-5.1$ ozone sh volume create vol1
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
bash-5.1$ ozone sh bucket create vol1/buck1
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]

@sravani-revuri

Copy link
Copy Markdown
Contributor Author

@sarvekshayr , @adoroszlai could you please take a look at these changes.

@sarvekshayr

Copy link
Copy Markdown
Contributor

I'm seeing the below exception for ozone admin safemode status command. It doesn't match with the output shared in the description. Could you please verify this?

bash-5.1$ ozone admin safemode status
scm:9860 [scmNodeId]: ERROR: Failed to get safe mode status for SCM node: DestHost:destPort scm:9860 , LocalHost:localPort om/172.18.0.9:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]

@adoroszlai

Copy link
Copy Markdown
Contributor

I'm seeing the below exception for ozone admin safemode status command. It doesn't match with the output shared in the description. Could you please verify this?

bash-5.1$ ozone admin safemode status
scm:9860 [scmNodeId]: ERROR: Failed to get safe mode status for SCM node: DestHost:destPort scm:9860 , LocalHost:localPort om/172.18.0.9:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]

FYI this happens in non-HA cluster.

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for updating the patch.

Comment thread hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java Outdated
Comment thread hadoop-hdds/cli-common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java Outdated
@sravani-revuri
sravani-revuri requested a review from adoroszlai May 7, 2026 07:10
Comment thread hadoop-hdds/cli-common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java Outdated
@sravani-revuri
sravani-revuri requested a review from adoroszlai May 8, 2026 05:22
@sravani-revuri

sravani-revuri commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

I'm seeing the below exception for ozone admin safemode status command. It doesn't match with the output shared in the description. Could you please verify this?

bash-5.1$ ozone admin safemode status
scm:9860 [scmNodeId]: ERROR: Failed to get safe mode status for SCM node: DestHost:destPort scm:9

@sarvekshayr , the admin commands in non-ha cluster now give the same error message. could you please take a look at these chnages.

ozonesecure % docker compose exec scm bash
bash-5.1$ ozone admin safemode status
org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
bash-5.1$ exit

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for updating the patch. Please revert changes that are unnecessary now that the command exits on access denied.

@sravani-revuri
sravani-revuri requested a review from adoroszlai May 8, 2026 09:51

@sarvekshayr sarvekshayr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing all the comments @sravani-revuri.

LGTM.

@sarvekshayr
sarvekshayr merged commit 95867e8 into apache:master May 8, 2026
90 of 91 checks passed
@sarvekshayr

Copy link
Copy Markdown
Contributor

Thanks @sravani-revuri for the patch, @adoroszlai, @Gargi-jais11 and @sreejasahithi for the review.

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