You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass output of the aqua to a pipe that doesn't read the whole output, aqua throws write EPIPE error.
Simple way to reproduce is to send any aqua command to head -n1, as in aqua ... | head -n1.
A real-life example is passing aqua getInterface to jq . for JSON parsing. jq detects incorrect JSON, and stops reading. Aqua complains.
Instead, it should handle writing to pipes correctly. As I understand it, if stdout/stderr is closed, simply don't write there.
This is a rather critical bug for a CLI tool, because it makes it impossible to use for automation and scripting.
% aqua getInterface --addr /dns4/kras-00.fluence.dev/tcp/19990/wss/p2p/12D3KooWSD5PToNiLQwKDXsu8JSysCwUt8BVUJEqCHcDe7P5h45e --id nonexistent-service | jq .
parse error: Invalid numeric literal at line 1, column 5
call failed with an error `Local service error, ret_code is 1, error message is '"Error: Service with id 'nonexistent-service' not found"'`, peerId `12D3KooWSD5PToNiLQwKDXsu8JSysCwUt8BVUJEqCHcDe7P5h45e`
xor caught an error: Local service error, ret_code is 1, error message is '"Error: Service with id 'nonexistent-service' not found"'
node:events:368
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:795:11)
at Socket._write (node:net:807:8)
at writeOrBuffer (node:internal/streams/writable:390:12)
at _write (node:internal/streams/writable:331:10)
at Socket.Writable.write (node:internal/streams/writable:335:10)
at ReadableWorkerStdio.ondata (node:internal/streams/readable:777:22)
at ReadableWorkerStdio.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:324:12)
Emitted 'error' event on Socket instance at:
at Socket.onerror (node:internal/streams/readable:796:14)
at Socket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
Node.js v17.3.0
The text was updated successfully, but these errors were encountered:
If you pass output of the aqua to a pipe that doesn't read the whole output, aqua throws
write EPIPE
error.Simple way to reproduce is to send any aqua command to
head -n1
, as inaqua ... | head -n1
.A real-life example is passing
aqua getInterface
tojq .
for JSON parsing.jq
detects incorrect JSON, and stops reading. Aqua complains.Instead, it should handle writing to pipes correctly. As I understand it, if stdout/stderr is closed, simply don't write there.
This is a rather critical bug for a CLI tool, because it makes it impossible to use for automation and scripting.
The text was updated successfully, but these errors were encountered: