[ 
https://issues.apache.org/jira/browse/HDDS-17879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Yarovoy updated HDDS-17879:
----------------------------------
    Status: Patch Available  (was: Open)

> [Regression] Datanode fails to start with Kerberos enabled when FQDN exceeds 
> 64 characters (RFC 5280 ub-common-name limit)
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-17879
>                 URL: https://issues.apache.org/jira/browse/HDDS-17879
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Security
>    Affects Versions: 2.2.2
>         Environment: *Kubernetes:* 1.32.13+rke2r1
> *FreeIPA:* 4.13.1
> *Security:* Kerberos / Ozone Security enabled
>            Reporter: Fatih
>            Assignee: Andrey Yarovoy
>            Priority: Major
>              Labels: pull-request-available
>
> When enabling Kerberos/security in Apache Ozone 2.2.2 (especially in 
> Kubernetes environments where headless service FQDNs are long), 
> HddsDatanodeService fails to start during CSR generation with an 
> IllegalArgumentException stating that the commonName exceeds the RFC 5280 
> ub-common-name limit of 64 characters.
> This issue is a regression introduced between 2.2.0 and 2.2.2:
> *     Ozone 2.2.0: Works without issues with the exact same configuration and 
> hostnames.
> *     Ozone 2.2.2: Fails during 
> CertificateSignRequest.getDistinguishedName(). 
> {noformat}
> 2026-11-20 11:29:27,370 [main] ERROR ozone.HddsDatanodeService 
> (HddsDatanodeService.java:printError(659)) - Exception in HddsDatanodeService.
> java.lang.IllegalArgumentException: commonName length 89 exceeds RFC 5280 
> ub-common-name (64): 
> 'd...@aaaa-ozone-000-datanode-1.aaa-ozone-000-datanode-headless.aaaa-data.svc.cluster.local'
>       at org.bouncycastle.asn1.x500.style.BCStyle.encodeStringValue(Unknown 
> Source)
>       at 
> org.bouncycastle.asn1.x500.style.AbstractX500NameStyle.stringToValue(Unknown 
> Source)
>       at org.bouncycastle.asn1.x500.X500NameBuilder.addRDN(Unknown Source)
>       at org.bouncycastle.asn1.x500.style.IETFUtils.addRDN(Unknown Source)
>       at org.bouncycastle.asn1.x500.style.IETFUtils.addRDNs(Unknown Source)
>       at org.bouncycastle.asn1.x500.style.IETFUtils.rDNsFromString(Unknown 
> Source)
>       at org.bouncycastle.asn1.x500.style.BCStyle.fromString(Unknown Source)
>       at org.bouncycastle.asn1.x500.X500Name.<init>(Unknown Source)
>       at org.bouncycastle.asn1.x500.X500Name.<init>(Unknown Source)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.utils.CertificateSignRequest.getDistinguishedName(CertificateSignRequest.java:127)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.utils.CertificateSignRequest.generateCSR(CertificateSignRequest.java:176)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.utils.CertificateSignRequest.toEncodedFormat(CertificateSignRequest.java:168)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.client.DNCertificateClient.sign(DNCertificateClient.java:93)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.client.DefaultCertificateClient.signAndStoreCertificate(DefaultCertificateClient.java:1297)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.client.DefaultCertificateClient.recoverStateIfNeeded(DefaultCertificateClient.java:801)
>       at 
> org.apache.hadoop.hdds.security.x509.certificate.client.DefaultCertificateClient.initWithRecovery(DefaultCertificateClient.java:696)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.initializeCertificateClient(HddsDatanodeService.java:443)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.start(HddsDatanodeService.java:298)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.start(HddsDatanodeService.java:228)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.call(HddsDatanodeService.java:196)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.call(HddsDatanodeService.java:115)
>       at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
>       at picocli.CommandLine.access$1500(CommandLine.java:148)
>       at 
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
>       at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
>       at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
>       at 
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
>       at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
>       at picocli.CommandLine.execute(CommandLine.java:2170)
>       at org.apache.hadoop.hdds.cli.GenericCli.execute(GenericCli.java:87)
>       at org.apache.hadoop.hdds.cli.GenericCli.run(GenericCli.java:79)
>       at 
> org.apache.hadoop.ozone.HddsDatanodeService.main(HddsDatanodeService.java:182)
> {noformat}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to