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

Deadlock under rails 4.0 #11

Closed
jeremytregunna opened this issue Nov 15, 2013 · 3 comments
Closed

Deadlock under rails 4.0 #11

jeremytregunna opened this issue Nov 15, 2013 · 3 comments

Comments

@jeremytregunna
Copy link

In rails 4 I am throwing 401 when a user tries to access a protected resource, and it redirects me to login as I expect. I already have a valid session with the server open in the browser I'm using, and the server is backed by CASino. The server is responding with a ticket before the deadlock.

In the rails server log I see this bit of relevant information along with this stack trace which shows after about 2 minutes:

Completed 401 Unauthorized in 54ms (ActiveRecord: 2.2ms)
rack-cas: Intercepting 401 access denied response. Redirecting to CAS login.  CACHE (0.0ms)  SELECT "sessions".* FROM "sessions" WHERE "sessions"."session_id" = '6648cc0dfeedcf5c36f1d93465e10886' ORDER BY "sessions"."id" ASC LIMIT 1
   (0.1ms)  begin transaction
   (0.1ms)  commit transaction
rack-cas: Intercepting ticket validation request.[2013-11-15 07:51:54] ERROR Net::ReadTimeout: Net::ReadTimeout
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/protocol.rb:158:in `rescue in rbuf_fill'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/protocol.rb:152:in `rbuf_fill'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/protocol.rb:134:in `readuntil'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/protocol.rb:144:in `readline'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2rack-cas: Intercepting ticket validation request..0.0/net/http/response.rb:39:in `read_status_line'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http/response.rb:28:in `read_new'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1406:in `block in transport_request'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1403:in `catch'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1376:in `request'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1126:in `get'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:89:in `block in response'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:852:in `start'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:88:in `response'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:98:in `xml'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:62:in `success?'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:15:in `user'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/server.rb:24:in `validate_service'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack/cas.rb:76:in `get_user'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack/cas.rb:33:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

Additionally, if I log out on the CAS server, and then repeat this process in my app using rac-cas, I get this:

rack-cas: Intercepting 401 access denied response. Redirecting to CAS login.  CACHE (0.0ms)  SELECT "sessions".* FROM "sessions" WHERE "sessions"."session_id" = '6648cc0dfeedcf5c36f1d93465e10886' ORDER BY "sessions"."id" ASC LIMIT 1
   (0.1ms)  begin transaction
   (0.1ms)  commit transaction
et/http.rb:1376:in `request'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1126:in `get'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:89:in `block in response'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:852:in `start'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:88:in `response'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:98:in `xml'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:62:in `success?'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/service_validation_response.rb:15:in `user'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack-cas/server.rb:24:in `validate_service'
    /Users/jtregunna/.rvm/gems/ruby-2.rack-cas: Intercepting ticket validation request.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack/cas.rb:76:in `get_user'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-cas-0.8.1/lib/rack/cas.rb:33:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
    /Users/jtregunna/.rvm/gems/ruby-2.0.0-p195@teamapp/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
    /Users/jtregunna/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
@adamcrown
Copy link
Collaborator

Sorry for not getting to this for a while. I was out of commission with an injury when you posted this issue. Are you still having this problem?

@adamcrown
Copy link
Collaborator

Not activity for a few months so I'm closing this.

@jeremytregunna
Copy link
Author

Sorry for not seeing your reply until you closed this, I in fact gave up, and went with another single sign in mechanism given I had the flexibility and couldn't make this work. Thanks though.

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

2 participants