Capybara-Webkit "Unable to load URL" - ruby-on-rails

I've been struggling with this issue for a few days and can't figure out what's causing the problem. The test suite runs fine on TravisCI, and locally when I restart my computer. After doing something locally though, I keep getting the same error message:
Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)
Here is the full webkit-debug trace:
Using the default profile...
..........Finished "EnableLogging" with response "Success()"
Wrote response true ""
Received "Visit"
Started "Visit"
Load started
"Visit" started page load
Started request to "http://localhost.dev:3001/en/users/sign_in"
Finished "Visit" with response "Success()"
Received 0 from "http://localhost.dev:3001/en/users/sign_in"
Page finished with false
Load finished
Page load from command finished
Wrote response false "{"class":"InvalidResponseError","message":"Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error"}"
F-Received "Reset"
Started "Reset"
undefined|0|SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
Finished "Reset" with response "Success()"
Wrote response true ""
Received "FindXpath"
Started "FindXpath"
Finished "FindXpath" with response "Success()"
Wrote response true ""
..........F--------
(::) failed steps (::)
Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)
This comes up anywhere in the app that I try to visit a path. From what I understand, the "Unknown error" is from qt, not capybara-webkit, but I'm not quite sure who would be best to ask. I am using DNSmasq for subdomains and we have multiple languages so localhost:3000 is redirected to www.localhost.dev:3000/en.
Current versions of things:
capybara 2.4.1
capybara-webkit 1.1.0
cucumber 1.3.14
cucumber-rails 1.4.0
pg 0.7.1
rails 4.0.0
ruby 2.1.2
dnsmasq 2.71
postgresql 9.3.5
qt 4.8.6 OSX - Mavericks 10.9.4
Edit 1: Also posted on the capybara-webkit repo: https://github.com/thoughtbot/capybara-webkit/issues/667
Edit 2: Here is the test log file: https://gist.github.com/GolfyMcG/060053eba51a9ba69722

As I posted in the related Github issue, I found the solution here:
https://apple.stackexchange.com/questions/26616/dns-not-resolving-on-mac-os
Had nothing to do with Capybara-webkit and everything to do with how I had my ElasticSearch instance spinning up with testing.

Related

rails7 heroku deployment failure (internal server error)

trying to deploy my rails7 app to heroku The home screen is coming up but whenever I click on a link to another page I get a screen saying "sorry something went wrong". "if your the application owner check the logs". an in the logs it says
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
My Rails 7 app started up locally fine but failed on Heroku deployment because of class naming errors. Note that Rails 7 uses Zeitwerk as its autoloader. You can test this locally by running: bundle exec rake zeitwerk:check

Spree - Timeout when trying to access backend

Since this afternoon, access to the backend of my spree shop is suddenly unavailable. When I try to visit any page in the backend (/admin/users, /admin/orders, etc) the page just loads for a long time, until it times out and I get the generic error page.
When I look into the logs I always see either :
Processing by Spree::Admin::OrdersController#index as HTML
Completed 500 Internal Server Error in 127259ms
** [Airbrake] Success: Net::HTTPOK
Errno::ETIMEDOUT (Connection timed out - connect(2)):
app/middleware/flash_session_cookie_middleware.rb:18:in `call'
or
Processing by Spree::Admin::OrdersController#index as HTML
Completed 500 Internal Server Error in 127520ms
** [Airbrake] Success: Net::HTTPOK
SocketError (getaddrinfo: Name or service not known):
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
This started happening after the last deployment to production, which only changed images and stylesheets. I can't reproduce the error locally, despite having the same code and an exact copy of the production database.
I'm using Spree version 2.0.3
Run Spree::Config[:check_for_spree_alerts] = false in your console to fix this. You may also want to add this line to your initializers/spree.rb to ensure check_for_spree_alerts is not re-enabled in the future.
This is happening because the Spree Alerts website has been discontinued. See: https://github.com/spree/spree/pull/6516
To be specific, this is happening because when logging into the backend, Spree 2.0.x checks for any alerts from the Spree website here https://github.com/spree/spree/blob/2-0-stable/backend/app/controllers/spree/admin/base_controller.rb#L39 which then calls alert.rb:14 :
HTTParty.get('http://alerts.spreecommerce.com/alerts.json', query: params).parsed_response
At the moment, alerts.spreecommerce.com has been discontinued and is timing out, which explains the errors you're receiving.
The Spree Alerts code has been removed as of Spree 2.3, so you could also upgrade to that version to resolve this issue.

RadRails: An internal error occurred during: "Starting Server"

I've decided to learn some Ruby on Rails, but unfortunately I can't get the testing server to work. When I try to fire it up I get this message: RadRails: An internal error occurred during: "Starting Server", and when I click OK in the message window the server's status is frozen at Starting. I get no other errors or messages.
I use the RadRails - EasyEclipse for Ruby and Rails IDE (latest version as far as I'm concerned) and I've followed these instructions to set everyting up: http://www.easyeclipse.org/site/distributions/ruby-rails.html.
The Apache server is up and running when I click the Manage Servers-tab in Bitnami Ruby Stack
Any help is appriciated.

SSL connection error ONLY when I test my rails app (localhost:3000) on chrome. It works on firefox

I'm following Michael Hartl's Rails Tutorial, and for some reason, I am unable to test the sample app on Google Chrome. I test it by first running the rails server, then going to "localhost:3000" on the browser. When I run the rails server, and go to localhost:3000 on Firefox, it works fine and I can use the app. When then on Chrome, I get:
"SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error."
In CMD (I use windows 7), after I run the rails server, and I attempt to go to localhost:3000, I get these errors:
14:22:19] INFO WEBrick 1.3.1
14:22:19] INFO ruby 1.9.3 (2012-02-16) [i386-mingw32]
14:22:19] INFO WEBrick::HTTPServer#start: pid=3064 port=3000
14:22:48] ERROR bad URI `2r?f?\x06\x01\x1Akh/'f??\x10'?j?<\x00\x00H?'.
14:22:48] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x02Q"\x7F?\x18??#?X?F???#K???\x17?#?e??4?k`?\x00\x00H?'.
14:22:49] ERROR bad URI `?'.
14:22:49] ERROR bad URI `??x\x1F?\x06??M??IL?C\x00\x00*\x00?\x00?\x00?\x009\x008\x00?\x005\x00E\x00D\x00f\x003\x002\x00?\x00A\x00\x05\x00\x
I had the same problem. As #looseseal_90 said in comments, you should try to clear the cookies and reload the page.
(I know that everyone can read a comment, but it would be better the question to have the answer :-)

Spree error 500

Need some help here.
I have deployed spree (0.70.3) on slicehost (ubuntu, ruby1.8.7, Rails
3.1.3), installed the spree gem, loaded in the sample data
successfully following the steps on spree startup manual and I am
using passenger (it works on localhost:3000). When I upload to my
server, however, instead of seeing the spree interface, I am getting
an error message. From the production.log:
Processing by HomeController#index as HTML Completed 500 Internal
Server Error in 22ms ActiveRecord::StatementInvalid (Could not find
table 'product_groups'):
Any suggestions how I can get this to work?
Website: http://www.nutxboutique.com
production.log is the rails log. It appears your problem is occurring before rails completes loading. If you're using apache, check/post the apache logs, it might have more clues as to what's going on.

Resources