asciinema / asciicast2gif

Generate GIF animations from asciicasts (asciinema recordings)
MIT License
1.21k stars 82 forks source link

Fails with error write EPIPE on local file #79

Closed yannham closed 2 years ago

yannham commented 3 years ago

Trying to convert an existing local cast file always fails with EPIPE:

~asciinema rec
asciinema: recording asciicast to /tmp/tmpbmwoim06-ascii.cast
asciinema: press <ctrl-d> or type "exit" when you're done
~this is a test!
zsh: command not found: this
[1]    224148 exit 127   this is a test!
~[Ctrl+D] 
asciinema: recording finished
asciinema: press <enter> to upload to asciinema.org, <ctrl-c> to save locally
asciinema: asciicast saved to /tmp/tmpbmwoim06-ascii.cast
~cp /tmp/tmpbmwoim06-ascii.cast .
~asciicast2gif tmpbmwoim06-ascii.cast test.gif
==> Loading tmpbmwoim06-ascii.cast...
==> Spawning PhantomJS renderer...
==> Generating frame screenshots...
node:events:346
      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:774:11)
    at Socket._write (node:net:786:8)
    at writeOrBuffer (node:internal/streams/writable:395:12)
    at Socket.Writable.write (node:internal/streams/writable:340:10)
    at of (/usr/local/lib/node_modules/asciicast2gif/main.js:706:266)
    at Function.e [as c] (/usr/local/lib/node_modules/asciicast2gif/main.js:293:156)
    at /usr/local/lib/node_modules/asciicast2gif/main.js:295:256
    at /usr/local/lib/node_modules/asciicast2gif/main.js:295:280
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}
[1]    224208 exit 1     asciicast2gif tmpbmwoim06-ascii.cast test.gif

System information:

AdmiralNemo commented 3 years ago

I encountered this same error today. It occurred when I tried to convert the same file locally or over HTTP.

c12yptonic commented 3 years ago

Same error experienced

OlaoluwaM commented 2 years ago

Same with node v17+. Error also occurs with remote conversion attempts

trev-dev commented 2 years ago

Also happening for me with Node version 16.14, local and remote

initialjie commented 2 years ago

Also happening for me with Node version 16.15, local and remote

mathieu-aubin commented 2 years ago

i dont have the issue

Make-sure there is ONLY ONE install of nodejs on local environment - reinstall.. try again

npm i asciicast2gif -g

trev-dev commented 2 years ago

I definitely only have 1 global on path. What did work for me was following the docker instructions.

mathieu-aubin commented 2 years ago

make sure 'gifsicle' is installed, too

trev-dev commented 2 years ago

It was :)

raspiduino commented 2 years ago

I got the same issue :((

mathieu-aubin commented 2 years ago

Okay... well, then i have to say, without certainty, that its a file pdrmission issue. The user cant create/write file (or disk/partirion full) thus, the pipe fails.

How long does it take before it crashes after the output process status?

Why did you do this? That looks like an extra step that has no real good use and which can create some issues in some specific cases. ~cp /tmp/tmpbmwoim06-ascii.cast .

btw, as everything is a file under linux, it also include potential issues at creating folders or accessing them (i dont remember if the temporary png files get dumped to a folder while converting)

as i said before, i dont get this problem using same versions, on now 3 different sysrems. I can see potential for filesystem/permission issues and without more environment details... it doesnt seem to be software related is what i mean.

raspiduino commented 2 years ago

Okay... well, then i have to say, without certainty, that its a file pdrmission issue. The user cant create/write file (or disk/partirion full) thus, the pipe fails.

I tried running everything with root permission but still got this issue

trev-dev commented 2 years ago

Okay... well, then i have to say, without certainty, that its a file pdrmission issue. The user cant create/write file (or disk/partirion full) thus, the pipe fails.

I tried running everything with root permission but still got this issue

With all of my respect for the writers of this software, you should never have to run it as root. Just use the docker image if you have the stomach for it

raspiduino commented 2 years ago

Okay... well, then i have to say, without certainty, that its a file pdrmission issue. The user cant create/write file (or disk/partirion full) thus, the pipe fails.

I tried running everything with root permission but still got this issue

With all of my respect for the writers of this software, you should never have to run it as root. Just use the docker image if you have the stomach for it

I used docker but it failed with the same error :((

jukefr commented 2 years ago

having the same issue

asciicast2gif testing.json testing.gif
==> Loading testing.json...
==> Spawning PhantomJS renderer...
==> Generating frame screenshots...
node:events:505
      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:817:11)
    at Socket._write (node:net:829:8)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at Socket.Writable.write (node:internal/streams/writable:334:10)
    at of (/home/user/.node_modules_global/lib/node_modules/asciicast2gif/main.js:706:266)
    at Function.e [as c] (/home/user/.node_modules_global/lib/node_modules/asciicast2gif/main.js:293:156)
    at /home/user/.node_modules_global/lib/node_modules/asciicast2gif/main.js:295:256
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}
mathieu-aubin commented 2 years ago

I have no stake in this program and am not part of its develop team but this issue bugw me. It would be nice to have more infos on your environment so at least the issue could be reproducible. It would greatly help in determining the cause...

whish you get it sorted...

ku1ik commented 2 years ago

Hey! I just published a successor to this tool: https://github.com/asciinema/agg - please try it instead. There will be no more work on asciicast2gif from me.