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

redirection issue #29

Closed
awesome opened this issue May 15, 2012 · 5 comments
Closed

redirection issue #29

awesome opened this issue May 15, 2012 · 5 comments

Comments

@awesome
Copy link

awesome commented May 15, 2012

testing a json api with cucumber, capybara, json_spec

Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
Warning! ActionDispatch::Session::DalliStore failed to save session. Content dropped.
    And the following path and params:                              # features/step_definitions/steps.rb:49
      /search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma?zipcode=98115
      | path    | /search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma |
      | zipcode | 98115                                            |
      NativeException com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: Too much redirect for http://127.0.0.1:52191/search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma?zipcode=98115 (RuntimeError)
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1475:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1493:in `loadWebResponseFromWebConnection'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:1358:in `loadWebResponse'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:307:in `getPage'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:373:in `getPage'
      (druby://127.0.0.1:52194) com/gargoylesoftware/htmlunit/WebClient.java:358:in `getPage'
      ./features/step_definitions/steps.rb:64:in `/^the following path and params:$/'
      features/search_with_auth.feature:7:in `And the following path and params:'
@Nerian
Copy link
Owner

Nerian commented May 15, 2012

Hi,

It seems that calling /search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma?zipcode=98115 results in 21 redirections and HTMLUnit has a limit to the number of redirections it can handle.

Why is there so many redirections?

@awesome
Copy link
Author

awesome commented May 15, 2012

hello. Redirection issue is probably due to overly clever routing or a before_filter... not my code, just writing the tests for it. Since the user is not logged in, there is a redirect to a login--the only thing is the login is cas and on another host. I'm looking into it now

@Nerian
Copy link
Owner

Nerian commented May 15, 2012

Ah, the joys of testing software that you didn't write. I will never get why managers do things like that.

@awesome
Copy link
Author

awesome commented May 15, 2012

fixed it. brew installed memcached and flipped it on. This was the log before:

Started GET "/search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma?zipcode=98115" for 127.0.0.1 at 2012-05-15 14:30:13 -0700
Processing by SearchCmaController#search_cma as JSON
  Parameters: {"zipcode"=>"98115", "agent_uuid"=>"3c2b0dba-435c-45a5-8ff7-6c1f05d33943"}
Guessed service url: "http://127.0.0.1:49811/search/3c2b0dba-435c-45a5-8ff7-6c1f05d33943/cma?zipcode=98115"
Generated login url: http://example.com/service/v1/auth/login?service=http%3A%2F%2F127.0.0.1%3A49811%2Fsearch%2F3c2b0dba-435c-45a5-8ff7-6c1f05d33943%2Fcma%3Fzipcode%3D98115
Dalli::Server#connect 127.0.0.1:11211
127.0.0.1:11211 failed (count: 0)
Session::DalliStore#get: No server available
Redirecting to "http://example.com/service/v1/auth/login?service=http%3A%2F%2F127.0.0.1%3A49811%2Fsearch%2F3c2b0dba-435c-45a5-8ff7-6c1f05d33943%2Fcma%3Fzipcode%3D98115&gateway=true"
Redirected to http://example.com/service/v1/auth/login?service=http%3A%2F%2F127.0.0.1%3A49811%2Fsearch%2F3c2b0dba-435c-45a5-8ff7-6c1f05d33943%2Fcma%3Fzipcode%3D98115&gateway=true
Filter chain halted as RubyCAS::Filter rendered or redirected
Completed 302 Found in 15ms (ActiveRecord: 0.0ms)
Dalli::Server#connect 127.0.0.1:11211
127.0.0.1:11211 failed (count: 1)
127.0.0.1:11211 is down
Session::DalliStore#set: No server available

Thanks for this gem, Akephalos2 rocks!

@Nerian
Copy link
Owner

Nerian commented May 15, 2012

Good job!

@Nerian Nerian closed this as completed May 15, 2012
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