geeklearningio / gl-vsts-tasks-yarn

Yarn Package Manager Visual Studio Team Services Build and Release Management extensions
MIT License
52 stars 18 forks source link

Task not working after a fresh install on a custom agent running as `Network Service` #11

Closed ruimserrano closed 7 years ago

ruimserrano commented 7 years ago

Hi, for me the task ends with a green check, but the whole process fails because yarn did nothing. Here are the logs:

2017-02-22T13:27:59.9407375Z ##[section]Starting: Yarn 
2017-02-22T13:28:06.3967413Z { [Error: ENOTSUP: operation not supported on socket, link 'f:\yarn\dist\node_modules\loose-envify\cli.js' -> 'f:\yarn\dist\node_modules\.bin\loose-envify']
2017-02-22T13:28:06.3967413Z   errno: -4049,
2017-02-22T13:28:06.3967413Z   code: 'ENOTSUP',
2017-02-22T13:28:06.3967413Z   syscall: 'link',
2017-02-22T13:28:06.3967413Z   path: 'f:\\yarn\\dist\\node_modules\\loose-envify\\cli.js',
2017-02-22T13:28:06.3967413Z   dest: 'f:\\yarn\\dist\\node_modules\\.bin\\loose-envify',
2017-02-22T13:28:06.3967413Z   fstream_type: 'SymbolicLink',
2017-02-22T13:28:06.3967413Z   fstream_path: 'f:\\yarn\\dist\\node_modules\\.bin\\loose-envify',
2017-02-22T13:28:06.3967413Z   fstream_linkpath: '../loose-envify/cli.js',
2017-02-22T13:28:06.3967413Z   fstream_class: 'LinkWriter',
2017-02-22T13:28:06.3967413Z   fstream_stack: 
2017-02-22T13:28:06.3967413Z    [ 'f:\\_tasks\\Yarn_0888c9a9-d1b2-4567-aae2-beadcb2059b3\\0.5.999\\node_modules\\fstream\\lib\\link-writer.js:76:26',
2017-02-22T13:28:06.3967413Z      'FSReqWrap.oncomplete (fs.js:82:15)' ] }
2017-02-22T13:28:06.4124088Z ##[section]Finishing: Yarn 

any thoughts ?

sandorfr commented 7 years ago

Hi,

Sorry for the inconvenience, I double checked, but the task is behaving correctly on my builds. So I have questions.

From what I see in your logs, you are on a custom agent and using a locally installed yarn version located in f:\yarn. Which version are you using, is the service account runing vsts agent having sufficient rights?

In addition, can you provide a debug log

ruimserrano commented 7 years ago

Hi,

So we had installed yarn with npm (npm install -g yarn). To check permissions like you said, we jumped into the box and tried to run it as Network Service (build agent runs as network service), didn't work.

So we installed again but with the .msi. Tried to run as network service: worked! En-queue a new build again, didn't work.

Restarted the build machine, tested again.... It worked!

Hope that experience will help others.

Thanks for your comment @sandorfr to put me into the right direction. And thanks for your work guys. Its awesome!

sandorfr commented 7 years ago

I'm thinking of writing some additional guidance, to point users in the right direction. Thank you for sharing your experience as it will help me. Two important points from your feedback:

ruimserrano commented 7 years ago

Hi @sandorfr,

In fact i don't know if a restart of the agent service would do the trick. But we didn't have any queued build, so we did a full reboot. Probably a restart of the service in enough. My understanding is that the agent has to restart so he gets the new environment vars.