JoshCheek / atom-seeing-is-believing

Seeing is Believing integration for the Atom text editor.
Do What The F*ck You Want To Public License
62 stars 4 forks source link

Uncaught Error: write EPIPE #35

Closed turtleWarrior88 closed 6 years ago

turtleWarrior88 commented 7 years ago

[Enter steps to reproduce:]

  1. I installed the package following the instructions in the README, using both package installer and the command line (it happened in both cases) 2.Wrote a simple Ruby Program (saved in .rb format) 3.Called SeeingIsBelieving functionalities from Command Palette
  2. The following message appears: 'seeing_is_believing' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.
  3. I check from command line that the gem is correctly installed. When I try to use the testing command ( $seeing_is_believing -e '1+1') the program runs but showing no output, even when the timeout option is set

Atom: 1.15.0 ia32 Electron: 1.3.13 OS: Windows 10 Ruby Version Installed: 2.3.3p222 (uses neither rbenv nor rvm, since its Windows) Thrown From: seeing-is-believing package 2.2.3

Stack Trace

Uncaught Error: write EPIPE

At events.js:160

Error: write EPIPE
    at exports._errnoException (util.js:1026:11)
    at Socket._writeGeneric (net.js:706:26)
    at Socket._write (net.js:725:8)
    at doWrite (_stream_writable.js:307:12)
    at writeOrBuffer (_stream_writable.js:293:5)
    at Socket.Writable.write (_stream_writable.js:220:11)
    at Socket.write (net.js:651:40)
    at Object.invokeSib (/packages/seeing-is-believing/lib/seeing-is-believing.coffee:93:15)
    at Object.run (/packages/seeing-is-believing/lib/seeing-is-believing.coffee:71:6)
    at /packages/seeing-is-believing/lib/seeing-is-believing.coffee:46:58)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at Object.didConfirmSelection (/app.asar/node_modules/command-palette/lib/command-palette-view.js:106:29)
    at SelectListView.confirmSelection (/app.asar/node_modules/atom-select-list/src/select-list-view.js:301:20)
    at SelectListView.didClickItem (/app.asar/node_modules/atom-select-list/src/select-list-view.js:220:10)
    at ListItemView.onclick (/app.asar/node_modules/atom-select-list/src/select-list-view.js:156:33)
    at ListItemView.didClick (/app.asar/node_modules/atom-select-list/src/select-list-view.js:349:10)

Commands

Non-Core Packages

atom-autocomplete-php 0.22.2 
atom-beautify 0.29.17 
atom-bootstrap3 1.2.12 
atom-html-preview 0.1.22 
atom-material-syntax 1.0.2 
atom-material-ui 1.3.9 
autoclose-html 0.23.0 
autocomplete-clang 0.10.0 
autocomplete-java 1.2.5 
autocomplete-modules 1.6.8 
autocomplete-python 1.8.61 
autocomplete-xml 0.9.4 
color-picker 2.2.5 
drunken-php 0.2.3 
emmet 2.4.3 
file-icons 2.1.1 
git-plus 7.3.3 
gpp-compiler 3.0.7 
java-generator 2.2.3 
java-importer 1.4.1 
jquery-snippets 11.0.0 
language-glsl 2.0.1 
minimap 4.26.8 
script 3.14.1 
seeing-is-believing 2.2.3 
todo-show 1.11.0 
JoshCheek commented 7 years ago

Sounds like something is wrong with the Ruby environment, can you try running each of these commands and tell me what happens?

$ seeing_is_believing -e '1+1'
$ seeing_is_believing -v
$ ruby -v
$ ruby -S seeing_is_believing -e '1+1'
$ gem list seeing_is

For comparison, this is what I see on my computer.

screenshot 2017-03-21 21 00 19

JoshCheek commented 7 years ago

When you ran seeing_is_believing -e '1+1' you say there was no output, did it execute and not print anything or did hang indefinitely?

turtleWarrior88 commented 7 years ago

When I ran seeing_is_believing -e '1+1' (in cmd), It shows no output and remains active indefinetly, unless I press Ctrl + C , then It shows the folloving message:

C:/Ruby23/lib/ruby/gems/2.3.0/gems/childprocess-0.5.9/lib/childprocess/windows/lib.rb:385:in check_error': Access denied. (5) (ChildProcess::Error) from C:/Ruby23/lib/ruby/gems/2.3.0/gems/childprocess-0.5.9/lib/childprocess/windows/handle.rb:64:in send' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/childprocess-0.5.9/lib/childprocess/windows/process.rb:15:in stop' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/evaluate_by_moving_files.rb:154:in ensure in evaluate_file' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/evaluate_by_moving_files.rb:158:in evaluate_file' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/evaluate_by_moving_files.rb:52:in block in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/hard_core_ensure.rb:32:in invoke_code' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/hard_core_ensure.rb:14:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/hard_core_ensure.rb:4:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/evaluate_by_moving_files.rb:47:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/evaluate_by_moving_files.rb:27:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing.rb:44:in block in call' from C:/Ruby23/lib/ruby/2.3.0/tmpdir.rb:89:in mktmpdir' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing.rb:38:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing.rb:27:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/binary/engine.rb:39:in evaluate!' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/lib/seeing_is_believing/binary.rb:40:in call' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/seeing_is_believing-3.2.0/bin/seeing_is_believing:7:in <top (required)>' from C:/Ruby23/bin/seeing_is_believing:22:in load' from C:/Ruby23/bin/seeing_is_believing:22:in <main>'

The outputs of the other commands are the following:

JoshCheek commented 7 years ago

Hmm, I'm probably going to have to dl Windows 10 to try reproducing it >.< Not sure my internet is good enough to do that here, though.

turtleWarrior88 commented 7 years ago

Any progress ?

zumoshi commented 7 years ago

I got the same error* on win8.1 however, in my case seeing_is_believing -e '1+1' gives 1+1 # => 2 as expected. I managed to work around the problem by changing Settings -> Seeing is believing command to seeing_is_believing.bat (it was in the path, but I think node's spawn method, unlike cmd.exe does not try appending .exe or .bat to the end of filenames)

more information:

OS: Win 8.1 x64 Atom: 1.19.5 ia32 atom-sib: 2.2.3 Stack Trace:

Error: write EPIPE
    at exports._errnoException (util.js:1022:11)
    at Socket._writeGeneric (net.js:715:26)
    at Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:332:12)
    at writeOrBuffer (_stream_writable.js:318:5)
    at Socket.Writable.write (_stream_writable.js:245:11)
    at Socket.write (net.js:661:40)
    at Object.invokeSib (file:///C:/Users/Bor/.atom/packages/seeing-is-believing/lib/seeing-is-believing.coffee:93:15)
    at Object.run (file:///C:/Users/Bor/.atom/packages/seeing-is-believing/lib/seeing-is-believing.coffee:71:6)
    at HTMLElement.subscriptions.add.atom.commands.add.seeing-is-believing:annotate-document (file:///C:/Users/Bor/.atom/packages/seeing-is-believing/lib/seeing-is-believing.coffee:46:58)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\command-registry.js:265:35)
    at C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\command-registry.js:3:65
    at Object.didConfirmSelection (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\node_modules\command-palette\lib\command-palette-view.js:106:35)
    at SelectListView.confirmSelection (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\node_modules\atom-select-list\src\select-list-view.js:313:26)
    at HTMLDivElement.core:confirm (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\node_modules\atom-select-list\src\select-list-view.js:81:20)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\command-registry.js:265:35)
    at C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\command-registry.js:3:65
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:610:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:401:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (C:\Users\Bor\AppData\Local\atom\app-1.19.5\resources\app\src\window-event-handler.js:3:65)

the output of mentioned commands:

image

* (not the exact same error, but atom displayed a popup saying error is already reported with a link to here)

while this workaround probably won't help solve the original issue (since that is related to seeing_is_believing not giving an output, not the atom extension), but it should be fixed regardless.

my guess is that since windows does not support shebangs, Ruby's gem (similar to node's npm/Python's pip/...) creates a file called module.bat with code to execute the original file. but child_proccess's spawn tries to run the original file instead (which to windows is a text file and not an executable one).

cesar225 commented 7 years ago

Goodnight

I am currently working with the programming language ruby on rails, and I have installed a package in my text editor that is atom, what happens is that when I run the code the program gets me an error. The package with the I am working on this project is SeeingIsBelieving that I can do so that I do not leave more error

Attached screen of the error that is generated to me when compiling the code.

evidenciaruby

JoshCheek commented 7 years ago

Hi, @cesar225, try gem pristine --all FWIW, it seems like your issue is different than the ones above, so if that doesn't do it, I'll open a different issue for it.

JoshCheek commented 7 years ago

Oh, and yeah, I'm back from Colombia, and have a better computer, so I can try downloading Windows and running it in a VM to see if I can reproduce it. Just gotta work up the motivation.

JoshCheek commented 6 years ago

I reproduced the error @zumoshi and @cesar225 had. Appending .bat worked for me. I'll look into whether that can be set by default for Windows. I'll leave this post open until I do.

Huge, shoutout to @zumoshi for figuring that out! My VM is unbearably slow right now, I don't think I would have gotten it >.<

sib_dot_bat

For @turtleWarrior88 I think that in your first post, it lists SiB as 2.2.3, in the second one, it's 3.2.0, I assume that upgrade fixed the problem from the first post. Next thing I'm noticing is that your version of child_process in the second one is 0.5.9, I think I had issues with that one, on one of these Ruby upgrades, and bumped the dependency to 0.7.1 for SiB 3.3, can you try installing that one with gem install seeing_is_believing -v 3.3.0?

JoshCheek commented 6 years ago

I updated it to default to .bat on Windows (my process.platform in my VM said "win32", the regex should work base on the docs). I should be releasing a new version of SiB soon (details), at which point I need to make a few small changes to this lib, and then I'll release it.

JoshCheek commented 6 years ago

IDK what changes I was talking about, but this is released, so I'm going to close it now.