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

Undefined method ord for nil class #266

Closed
dasomx77 opened this issue Feb 4, 2016 · 4 comments
Closed

Undefined method ord for nil class #266

dasomx77 opened this issue Feb 4, 2016 · 4 comments

Comments

@dasomx77
Copy link

dasomx77 commented Feb 4, 2016

Hey there,
I am currently seeing intermittent issues with this gem; every once a while, our connection with ldap will drop and fail with this backtrace:
"/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:33:in getbyte'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ber/ber_parser.rb:169:inread_ber'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:178:in block in read'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/instrumentation.rb:19:ininstrument'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:177:in read'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:143:inqueued_read'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:253:in bind_simple'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:222:inblock in bind'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/instrumentation.rb:19:in instrument'", "/opt/shared/bundle/ruby/2.2.0/gems/net-ldap-0.11/lib/net/ldap/connection.rb:219:inbind'"

As far as I can tell, this works flawlessly most of the time since I have a couple of cron jobs that reuse the same piece of code over and over again and this only happens (very consistently) every week or may be a bit more frequently than that. The steps to reproduce this issue are literally attempting to bind. I am tempted to say perhaps that when the connection times out, either a nil object is returned to the calling function which then attempts to send it the ord command which then fails, but again, I haven't taken a look at the source code as of now.

@dasomx77
Copy link
Author

Bump? Anyone aware of what could be triggering this?

@mynameisrufus
Copy link
Contributor

This code has changed in master https://github.com/ruby-ldap/ruby-net-ldap/blob/master/lib/net/ldap/connection.rb#L33 might be worth upgrading and see if issue persists.

@tmccombs
Copy link
Contributor

So, I think what is happening, is that getc returns nil at end of file, but that causes getbyte to raise an error.

@HarlemSquirrel
Copy link
Member

Should be fixed by #306

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

4 participants