asciinema / asciicast2gif

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

Docker executable cannot read a file (ENOENT) #72

Closed 1999 closed 2 years ago

1999 commented 4 years ago

I'm trying to run asciicast2gif on my computer like this:

docker run --rm -v $PWD:/data asciinema/asciicast2gif ~/Downloads/271556.cast ~/Downloads/271556.gif

For this command, I get this output:

==> Loading /Users/dsorin/Downloads/271556.cast...
/app/main.js:697
Qe)}function ep(a){try{var b=a[0];return b.h?b.h(a):b.call(null,a)}catch(c){if(c instanceof Object)throw b=c,Yo(a[6]),b;throw c;}}function fp(a,b,c){c=Zo(c,dp(function(c){a[2]=c;a[1]=b;return ep(a)}));return r(c)?(a[2]=Nb(c),a[1]=b,dj):null}function gp(a,b){a=a[6];null!=b&&a.Dc(null,b,dp(function(){return function(){return null}}(a)));Yo(a);return a}
                                                                                                   ^

Error: ENOENT: no such file or directory, open '/Users/dsorin/Downloads/271556.cast'
    at Error (native)
    at Object.fs.openSync (fs.js:642:18)
    at Object.fs.readFileSync (fs.js:510:33)
    at wp (/app/main.js:705:131)
    at /app/main.js:710:501
    at Function.b (/app/main.js:709:287)
    at ep (/app/main.js:697:48)
    at /app/main.js:713:317
    at Immediate.Po (/app/main.js:685:331)
    at runCallback (timers.js:672:20)

But when I cd into /Users/dsorin/Downloads/ and run:

docker run --rm -v $PWD:/data asciinema/asciicast2gif 271556.cast 271556.gif

looks like everything works.

umrashrf commented 4 years ago

You can't provide relative paths like ~/Downloads/271556.cast and ~/Downloads/271556.gif. They don't exist inside docker container.

ipatch commented 4 years ago

You can't provide relative paths like ~/Downloads/271556.cast and ~/Downloads/271556.gif. They don't exist inside docker container.

@umrashrf

not sure if that is entirely true or not as i just passed the below commmand on macOS,

docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 ./git-squash-commits.json ./wtfff.gif 

and it seems the docker process begins to process the path to file, and on a separate note you can see the node process expands ~ to /Users/dsorin his stacktrace.

All that said, I believe the issue relies in how he has docker configured on his system, 99% sure he/she is running macOS due to seeing the following directory structure /Users/dsorin and the issue is related to how he/she has setup bind mounted directories within the preferences of the docker app itself, as I was running into the exact same issue as described by @1999 ,but when I moved my recorded cast file to a path specified within the File Sharing tab of docker preferences window, the container was able to process the cast file.

Screen Shot 2019-11-04 at 1 38 18 PM
umrashrf commented 4 years ago

Error: ENOENT: no such file or directory, open '/Users/dsorin/Downloads/271556.cast'

It evaluates the path correctly based on current host user but that path might not exist in guest docker.

ku1ik commented 2 years ago

Closing as asciicast2gif is dead. Try https://github.com/asciinema/agg instead.