Yarn: Timout instead of terminated process with exit code <> 0 on error.

Created on 17 Oct 2016  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?

bug

What is the current behavior?

When I am executing yarn install an error message is displayed.

$ yarn install
yarn install v0.15.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occured, please open a bug report with the information provided in "/home/xxxxx/www/releases/20161017172004/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

After the error message is displayed the process keeps running. These will timout the build process without no further information what actually fails. Running the yarn install manually allowed me to cancel the process with CTRL+C. By doing that more information about the error got visible:

^Cfs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/home/xxxxx/.yarn/.roadrunner.json'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1224:33)
    at /usr/share/yarn/node_modules/roadrunner/index.js:25:6
    at /usr/share/yarn/node_modules/roadrunner/index.js:12:12
    at process.sigint (/usr/share/yarn/node_modules/roadrunner/index.js:46:5)
    at emitNone (events.js:85:20)
    at process.emit (events.js:179:7)
    at processEmit [as emit] (/usr/share/yarn/node_modules/signal-exit/index.js:146:32)
    at Signal.wrap.onsignal (internal/process.js:134:44)

I checked and the yarn files in my home directory and they are owned by _root_ instead of the current user. That issue can be resolved removing the folders so the current user can create those files. I can鈥檛 give no information about how and why _root_ generated these folders.

xxxxx@xxxxx:~/www/release$ ll ~/ | grep yarn
drwxr-xr-x   2 root   root     4096 Okt 17 08:35 .yarn/
drwxr-xr-x   3 root   root     4096 Okt 17 08:35 .yarn-cache/
drwxr-xr-x   4 root   root     4096 Okt 17 08:35 .yarn-config/

The actual bug is that the process does not terminate by itself.

If the current behavior is a bug, please provide the steps to reproduce.

Make root owner of yarn directories in another user鈥檚 home directory. Please see description above.

What is the expected behavior?

The process should terminate by itself on error with an exit code that is not 0. Calling yarn --version is exactly doing this:

xxxxx@xxxxx:~/www/release$ yarn --version
0.15.1
/usr/share/yarn/bin/yarn.js:48
      throw err;
      ^

Error: EACCES: permission denied, open '/home/xxxxx/.yarn/.roadrunner.json'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1224:33)
    at /usr/share/yarn/node_modules/roadrunner/index.js:25:6
    at /usr/share/yarn/node_modules/roadrunner/index.js:12:12
    at emitOne (events.js:95:20)
    at process.emit (events.js:182:7)
    at processEmit [as emit] (/usr/share/yarn/node_modules/signal-exit/index.js:140:35)
    at process.exit (internal/process.js:79:15)
    at Command.<anonymous> (/usr/share/yarn/node_modules/commander/index.js:825:13)
xxxxx@xxxxx:~/www/release$ echo $?
1

Please mention your node.js, yarn and operating system version.

  • Yarn: 0.15.1
  • NodeJs: v5.12.0
  • OS Version: Ubuntu 14.04.5 LTS

FYI @lindemann-medien

cat-bug triaged will-close

Most helpful comment

Haven't had this problem in three years so I can assure you it's resolved on my end 馃檪

All 6 comments

should you try rm -rf ~/.yarn and try again?

We have this issue too and we use a build server which triggers our builds through run scripts with Yarn instead of Npm since a week ago. Today we noticed it had over 20 unterminated Node processes used by Yarn.

Node v6.9.1
Yarn v0.17.9
Windows

@frenic @markuspoerschke can either of you confirm that this is still an issue on v1.21.1? If not, I'd like to close

Also, check out v2:

Haven't had this problem in three years so I can assure you it's resolved on my end 馃檪

Awesome, thanks!

I agree. Ticket can be closed.

Was this page helpful?
0 / 5 - 0 ratings