Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Errno::EPIPE: Broken pipe #535

Closed
remear opened this issue Jun 12, 2013 · 12 comments
Closed

Errno::EPIPE: Broken pipe #535

remear opened this issue Jun 12, 2013 · 12 comments
Labels

Comments

@remear
Copy link

remear commented Jun 12, 2013

I'm using capybara-webkit with rspec in a non-rails environment to test a list of pages. After a while the webkit_server process crashes with Errno::EPIPE: Broken pipe. I've tried calling session.reset! but that hasn't proven effective. Any ideas?

Here's one of the crash reports.

https://gist.github.com/remear/6abd100ba89bff25a557

QT is installed via homebrew.

I think this is the equivalent of ldd on OS X...

∞ otool -L ~/.rvm/gems/ruby-1.9.3-p392/gems/capybara-webkit-1.0.0/bin/webkit_server

/Users/remear/.rvm/gems/ruby-1.9.3-p392/gems/capybara-webkit-1.0.0/bin/webkit_server:
/usr/local/opt/qt/lib/QtWebKit.framework/Versions/4/QtWebKit (compatibility version 4.9.0, current version 4.9.3)
/usr/local/opt/qt/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.4)
/usr/local/opt/qt/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.4)
/usr/local/opt/qt/lib/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.4)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
@mhoran
Copy link
Collaborator

mhoran commented Jun 16, 2013

Thanks for the crash report. I can't tell much about what's going on here, but could you try upgrading to Qt 5 to see if it solves the issue? You can install it via a binary installer from qt-project.org in your home directory and set the QMAKE environment variable to the location of the qmake binary. This will allow Qt 4.8 from Homebrew and Qt 5 to coexist.

@bilus
Copy link

bilus commented Jun 18, 2013

I can confirm the same issue on two development machines in our shop running Mountain Lion with qt versions ranging from 4.8.1 to 4.8.4. We haven't tried qt 5 yet but will.

@bilus
Copy link

bilus commented Jun 19, 2013

UPDATE: After installing qt5, I'm getting the following error when running cucumber:

dyld: Library not loaded: /usr/local/lib/QtWebKit.framework/Versions/4/QtWebKit
  Referenced from: /Users/martinb/.rvm/gems/ruby-1.9.3-p374/gems/capybara-webkit-1.0.0/bin/webkit_server
  Reason: Incompatible library version: webkit_server requires version 4.9.0 or later, but QtWebKit provides version 4.7.0
      Can't assign requested address - connect(2) (Errno::EADDRNOTAVAIL)

Any ideas? :)

@remear
Copy link
Author

remear commented Jun 19, 2013

I received the same thing as @bilus and decided to remove qt4. So far I've been unsuccessful getting capybara-webkit to install correctly against qt5. Sometimes I get qmake errors. Sometimes I can get it to install but get lib errors with things like qt-everywhere not being found.

@aramprice
Copy link

We are seeing a similar issue with v1.5.1 using ruby 2.2.2, and brew-installed qt v4.8.6 on OSX 10.10.3:

Errno::EPIPE:
  Broken pipe
Test directory: /var/folders/07/1r0xmm4d08d6yk47263xltwc0000gn/T/ops-manager-20150528-48477-4e7t4j
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `write'
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `puts'
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `puts'
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/browser.rb:204:in `command'
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/browser.rb:18:in `visit'
# ~/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/driver.rb:41:in `visit'
# ~/.gem/ruby/2.2.2/gems/capybara-2.4.4/lib/capybara/session.rb:227:in `visit'
# ~/.gem/ruby/2.2.2/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'

When running:

visit '/login'

There are no errors when we run v1.5.0

Our capybara config is:

require 'capybara'
require 'capybara/rspec'
require 'capybara/webkit'

RSpec.configure do |_|
  Capybara.app = Rack::Builder.new do
    map('/') { run Rails.application }
  end.to_app

  Capybara.default_driver = :webkit
end

@mhoran
Copy link
Collaborator

mhoran commented May 29, 2015

Hey @aramprice, it looks like you're hitting #777. I'd recommend trying out the jf-reset-crash branch to see if that resolves the issue for you. If not, I'd love to spend some time debugging with you -- perhaps next week, as I'll be leaving early tomorrow.

Note that we recommend folks upgrade to Qt 5 if possible, as there are a number of bugs with Qt 4.8 that are outside of our control. However, it looks like you're hitting one of the issues addressed in the jf-reset-crash branch, or at least related to one of the changes we made in 1.5.1.

@aramprice
Copy link

@mhoran we didn't yet try the jf-reset-crash but we tried v1.5.1 with the homebrew version of Qt5[1] and saw the same error:

Is there an ETA on when the jf-reset-crash branch will make it into the published gem?

Errno::EPIPE:
  Broken pipe
Test directory: /var/folders/jp/ktd4dr7j0f17ss5qsqrphhnm0000gn/T/ops-manager-20150529-44784-81ubxj
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `write'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `puts'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/connection.rb:30:in `puts'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/browser.rb:204:in `command'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/browser.rb:18:in `visit'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.1/lib/capybara/webkit/driver.rb:41:in `visit'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-2.4.4/lib/capybara/session.rb:227:in `visit'
# ~/pivotal/.gem/ruby/2.2.2/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'

There were also (new in v1.5.1 + Qt 5) error when clicking a link because it is not visible. This may just be the exposure of existing behavior that Qt 4 was more tolerant of.

[1]

brew install qt5 && brew link qt5 --force # "Warning: qt5 is keg-only and must be linked with --force"

@jferris
Copy link
Contributor

jferris commented May 29, 2015

Is there an ETA on when the jf-reset-crash branch will make it into the published gem?

Travis was having some issues last week, so I waited for more than four hours before the build ran, and I haven't had a chance to look at the failures yet. I may have some time to mess with it this weekend. Otherwise, my next opportunity will likely be next Friday.

There were also (new in v1.5.1 + Qt 5) error when clicking a link because it is not visible. This may just be the exposure of existing behavior that Qt 4 was more tolerant of.

That's weird. We intentionally fail when trying to click on hidden elements (this is what Capybara expects). Have you looked at any screenshots to see if the elements were actually hidden before, or if they are hidden now?

@aramprice
Copy link

@jferris - We haven't had a chance to look into the v1.5.0 / v1.5.1 differences yet. We'll probably take a look early next week. I meant to put in a stack trace and more details but I lost the output when I swapped back to v1.5.0 to compare.

By the way thanks to both you and @mhoran for your quick responses here, it is great to get quick feedback!

@jferris jferris added the crash label Jun 5, 2015
@jferris
Copy link
Contributor

jferris commented Jun 5, 2015

@aramprice I just released 1.5.2 which includes some crash fixes. Can you give that a shot?

@aramprice
Copy link

@jferris - that seems to have done the trick, thanks!

Info:

ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
/Users/pivotal/.gem/ruby/2.2.2/gems/capybara-2.4.4
/Users/pivotal/.gem/ruby/2.2.2/gems/capybara-webkit-1.5.2
Darwin miramar 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

brew info qt
qt: stable 4.8.6 (bottled), HEAD
Cross-platform application and UI framework
https://www.qt.io/
/usr/local/Cellar/qt/4.8.6 (2790 files, 122M) *

@jferris
Copy link
Contributor

jferris commented Jun 8, 2015

@aramprice thanks!

@jferris jferris closed this as completed Jun 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants