Skip to content
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

KeyError on ZK.new #96

Open
andremleblanc opened this issue Oct 6, 2016 · 0 comments
Open

KeyError on ZK.new #96

andremleblanc opened this issue Oct 6, 2016 · 0 comments

Comments

@andremleblanc
Copy link

Ruby: JRuby-1.7.19
Java: 1.8.0_60
ZooKeeper: 3.4.6

Issue:
When calling ZK.new(localhost:2181) I see the below error in my server log. I tried stepping through the code a bit and it looks like the issue is in the prettify_event method when it calls h[:state] = Zookeeper::Constants::STATE_NAMES.fetch(h[:state]) if h[:state]. For some reason, h[:state] is equal to 4 which is not included in Zookeeper::Constants::STATE_NAMES and there is no default value defined for the fetch.

I don't understand the codebase well enough to know why an unexpected value is showing up here and thus don't know what the fix should be.

Interestingly, this error doesn't seem to be affecting any of the functionality I'm currently using (mainly just getting children of nodes and issuing watches on them). It also doesn't show up through irb or rails console, likely because I don't have logging setup to output there.

12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20) KeyError: key not found: 4
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    org/jruby/RubyHash.java:1183:in `fetch'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:123:in `prettify_event'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    org/jruby/RubyKernel.java:1886:in `tap'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:120:in `prettify_event'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:67:in `dispatch_next_callback'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    org/jruby/RubyProc.java:271:in `call'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/logger/forwarding_logger.rb:31:in `add'
12:51:00,698 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/logger/forwarding_logger.rb:48:in `debug'
12:51:00,705 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:67:in `dispatch_next_callback'
12:51:00,706 ERROR [stderr] (Ruby-3-Thread-69: /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:20)    /Users/andreleblanc/.rvm/gems/jruby-1.7.19/gems/zookeeper-1.4.11-java/lib/zookeeper/common.rb:96:in `dispatch_thread_body'

I feel I should mentioned I'm also getting the below warning, though I don't think it's related. I haven't setup any special authentication or ACLs on my server.

12:51:00,683 WARN  [org.apache.zookeeper.client.ZooKeeperSaslClient] (jboss.deployment.unit."aview_jruby-knob.yml".job_scheduler_Worker-2-SendThread(localhost:2181)) Could not login: the client is being asked for a password, but the Zookeeper client code does not currently support obtaining a password from the user. Make sure that the client is configured to use a ticket cache (using the JAAS configuration setting 'useTicketCache=true)' and restart the client. If you still get this message after that, the TGT in the ticket cache has expired and must be manually refreshed. To do so, first determine if you are using a password or a keytab. If the former, run kinit in a Unix shell in the environment of the user who is running this Zookeeper client using the command 'kinit <princ>' (where <princ> is the name of the client's Kerberos principal). If the latter, do 'kinit -k -t <keytab> <princ>' (where <princ> is the name of the Kerberos principal, and <keytab> is the location of the keytab file). After manually refreshing your cache, restart this client. If you continue to see this message after manually refreshing your cache, ensure that your KDC host's clock is in sync with this host's clock.
12:51:00,684 WARN  [org.apache.zookeeper.ClientCnxn] (jboss.deployment.unit."aview_jruby-knob.yml".job_scheduler_Worker-2-SendThread(localhost:2181)) SASL configuration failed: javax.security.auth.login.FailedLoginException: PBOX000070: Password invalid/Password required Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
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

No branches or pull requests

1 participant