Helix ZkClient times out after successful ZooKeeper SASL DIGEST-MD5 authentication
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java
- Domain
- authentication, distributed-systems, testing
Research direction
Start at ZkClient.waitUntilConnected and the isKerberosAuthEnabled check described in the issue. Reproduce the controller or participant timeout with the provided DIGEST-MD5 JAAS configuration, then add the requested regression test covering successful authentication while preserving Kerberos behavior. Done means the authenticated session is treated as connected and startup succeeds.
Written by the indexing model from the issue text.
Description
Describe the bug
When a ZooKeeper server requires SASL DIGEST-MD5 authentication, an Apache Helix controller and participant establish ZooKeeper sessions and receive SaslAuthenticated, but Helix subsequently reports that its ZooKeeper client is not connected and times out.
I reproduced the controller failure with unmodified Helix 1.4.3 and 2.0.1, and the participant failure with Helix 1.4.3. The same DIGEST-MD5 credentials work for a ZooKeeper client and for bootstrapping the Helix cluster.
To Reproduce
- Start ZooKeeper with
org.apache.zookeeper.server.auth.SASLAuthenticationProviderandsessionRequireClientSASLAuth=true. - Configure the Helix JVM with a JAAS
Cliententry usingorg.apache.zookeeper.server.auth.DigestLoginModuleand set-Djava.security.auth.login.config=<JAAS file>and-Dzookeeper.sasl.client=true. - Bootstrap a Helix cluster using the same ZooKeeper client configuration
- Start
org.apache.helix.controller.HelixControllerMainwith that cluster, or connect a participant throughHelixManagerFactory.getZKHelixManager(..., InstanceType.PARTICIPANT, ...).
The controller's ZooKeeper events reach SyncConnected and then SaslAuthenticated, followed by:
org.apache.helix.zookeeper.zkclient.exception.ZkTimeoutException:
Waiting to be connected to ZK server has timed out.
The Helix 1.4.3 participant shows the same state transition, then:
zkClient is not connected, wait for 10000ms.
zkClient is not connected after waiting 10000ms.
org.apache.helix.HelixException: HelixManager is not connected within retry timeout
Expected behavior
Helix should treat a successful SASL DIGEST-MD5 authentication as a connected session and allow the controller and participant to start.
Additional context
In Helix 2.0.1, ZkClient.waitUntilConnected expects SaslAuthenticated only when isKerberosAuthEnabled() finds a JAAS Krb5LoginModule. A DigestLoginModule client instead waits for SyncConnected. After successful DIGEST-MD5 authentication, the current state becomes SaslAuthenticated, and the exact-state wait can time out.
As a local proof of concept, extending that JAAS module check to include DigestLoginModule allowed the controller to authenticate and become leader. This was only a diagnostic class override, not a proposed production patch. A fix should include a regression test for DIGEST-MD5 and preserve Kerberos behavior.
This appears related to #3101 (Kerberos connection timeout). The Kerberos fix does not cover DIGEST-MD5.
- Dominant language
- Java
- Stars
- 505
- Forks
- 258
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/helix
-
Four TestConstraintBasedAlgorithm tests pass when nothing is thrownPossibly taken @sharanggupta claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
-
NPE in canCompleteSwap if path doesn't existsPossibly taken @waterWang claimed this 106 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Legacy IZkStateListenerI0ItecImpl causes zombie participants by discarding session IDsPossibly taken @LZD-PratyushBhatt claimed this 457 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug documentation good first issue help wanted priority low size XS
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
martin-francois/symphony-trello#1351 ·
Maintainers usually reply within 1 day
-
Add test coverage for ConvertUtil.parseDate() with NULL inputPossibly taken @mirajul-mollah7 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
eclipse-sw360/sw360#4792 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100