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

Error: write EPIPE when writing 'start\n' to this[monitor] #25

Closed
m4chinations opened this issue Jan 22, 2020 · 6 comments
Closed

Error: write EPIPE when writing 'start\n' to this[monitor] #25

m4chinations opened this issue Jan 22, 2020 · 6 comments

Comments

@m4chinations
Copy link
Contributor

Machina started!
events.js:298
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:780:11)
    at Socket._write (net.js:792:8)
    at doWrite (_stream_writable.js:454:12)
    at writeOrBuffer (_stream_writable.js:436:5)
    at Socket.Writable.write (_stream_writable.js:327:11)
    at MachinaFFXIV.start (...\node_modules\node-machina-ffxiv\node-machina-ffxiv.js:225:33)
    at Object.<anonymous> (...\index.js:26:9)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
Emitted 'error' event on Socket instance at:
    at errorOrDestroy (internal/streams/destroy.js:128:12)
    at onwriteError (_stream_writable.js:463:3)
    at processTicksAndRejections (internal/process/task_queues.js:86:21) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}

I wasn't really able to track down the root cause (looks similar to nodejs/node#947), but I found that initializing Machina w/ the logging option

const Machina = new MachinaFFXIV({logger: console.log});

will make it so this error does not occur, oddly enough.

@karashiiro
Copy link
Owner

I just tried running the program without a logger, and it worked just fine. Are you on the latest version? There was a piping error that I fixed a couple days ago related to the exe path being set up incorrectly.

@m4chinations
Copy link
Contributor Author

Just double checked from a fresh install, using both PowerShell & Command Prompt in administrator mode. The exe path is whitelisted in my firewall too. Windows 10.0.18362 Build 18362.

  • mkdir MachinaTest && cd MachinaTest
  • npm i node-machina-ffxiv (installs node-machina-ffxiv@2.31.35)
  • node test.js

test.js

const MachinaFFXIV = require('node-machina-ffxiv');
const Machina = new MachinaFFXIV();

Machina.start(() => {
    console.log("Machina started!");
});

output

PS Desktop\MachinaTest> node .\test.js
Machina started!
events.js:298
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:780:11)
    at Socket._write (net.js:792:8)
    at doWrite (_stream_writable.js:454:12)
    at writeOrBuffer (_stream_writable.js:436:5)
    at Socket.Writable.write (_stream_writable.js:327:11)
    at MachinaFFXIV.start (MachinaTest\node_modules\node-machina-ffxiv\node-machina-ffxiv.js:225:33)
    at Object.<anonymous> (MachinaTest\index.js:4:9)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
Emitted 'error' event on Socket instance at:
    at errorOrDestroy (internal/streams/destroy.js:128:12)
    at onwriteError (_stream_writable.js:463:3)
    at processTicksAndRejections (internal/process/task_queues.js:86:21) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}
(Program exits) 

@m4chinations
Copy link
Contributor Author

Looking into it more, just the existence of the options object in the initialization will prevent me from getting this error...
const Machina = new MachinaFFXIV({});

@m4chinations
Copy link
Contributor Author

it looks like, if the options object isn't passed, then the exe is being called without any arguments. But if options exist, then the arguments are [ '--Port', 13346 ].

Could that be the cause?

@karashiiro
Copy link
Owner

That certainly sounds right, I'll fix that real quick.

@karashiiro
Copy link
Owner

429101f should fix this issue.

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