Azure-pipelines-tasks: Path too long: Node Tool Installer 8.8.1 Node.js - 7zdec.exe exit code 1

Created on 27 Oct 2017  路  23Comments  路  Source: microsoft/azure-pipelines-tasks

Environment

VSTS: Account: krolldiscovery
Team: Hosting/nebula
nebula-frontend/Build nebula-frontend-develop_20171027.1

  • Agent Private, queue Default
  • Windows 2012 R2
  • Agent.Version 2.120.2
  • Agent.OSVersion 6.3.9600

Issue Description

Node Tool installer has problem with installing latest node
Task : Node Tool Installer
Version : 0.124.0

Manual extraction of https://nodejs.org/dist/v8.8.1/node-v8.8.1-win-x64.7z works fine.

Error logs

Extraction of 7zip returns in logs:

Extracting node-v8.8.1-win-x64/node_modules/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/load-json-file/node_modules/parse-json/node_modules/error-ex/node_modules/is-arrayish/.editorconfig
ERROR: can not open output file
ERROR #11
##[debug]7zdec.exe exit code '1'
[Insert error from the logs here]

Core

Most helpful comment

For me, the issue was (also) with the Agent.TempDirectory directory. Again this would be solved by having a much shorter agent work path.

echo ##vso[task.setvariable variable=agent.tempDirectory]c:\at

All 23 comments

I'm facing the same issue. v7 and below work great.

This is likely a path-too-long issue. What is your agent work folder? I just tested on the Hosted VS2017 image and it works. The hosted agent is configured to have a very short work folder (d:\a).

The Agent directory is : "D:\Builds\Agent6" so not too long.
I found in the NodeJS 8.8.1 file path with 236 characters.
node-v8.8.1-win-x64/node_modules/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/load-json-file/node_modules/parse-json/node_modules/error-ex/node_modules/is-arrayish/.editorconfig

Destination folder is D:\Builds\Agent6_tempn - 25 characters.
Windows limit is 260. Our path is 261 :)
I will try to change work Agent paths to d:\Ax . I have 8 Agents on host.

Unfortunately I don't have access to change my agent directory =(.

Maybe we can truncate the downloaded folder name? node-v8.8.1-win-x64 down to n881 or something ?

For an immediate workaround if you just need to save a couple characters, prior to the node installer task, you can add a command line task that does the following:

echo ##vso[task.setvariable variable=agent.toolsDirectory]$(agent.workFolder)\__t

@ericsciple When using Node > 8 it looks like we need to shave more than a few characters...

Extracting node-v8.9.1-win-x64/node_modules/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/node_modules/shebang-command/node_modules/shebang-regex/package.json

I don't think it's logging the offending file path though as that is only 211.

For me, the issue was (also) with the Agent.TempDirectory directory. Again this would be solved by having a much shorter agent work path.

echo ##vso[task.setvariable variable=agent.tempDirectory]c:\at

The issues same with Windows 10 where enabled Long paths, so long paths should not be applied here, unless 7zdec doesnot support working with long paths on Windows

+1, I'm experiencing the same issue. Strangely, it only affects some of our VSTS agent queues. I'm not quite sure if the path length is really causing it at this point.

2018-04-20T19:54:36.3748389Z Extracting node-v8.11.1-win-x64/node_modules/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/load-json-file/node_modules/parse-json/node_modules/error-ex/node_modules/is-arrayish/.editorconfig
2018-04-20T19:54:36.3748389Z ERROR: can not open output file
2018-04-20T19:54:36.3748389Z 
2018-04-20T19:54:36.3748389Z ERROR #11
2018-04-20T19:54:36.3748389Z ##[debug]7zdec.exe exit code '1'
2018-04-20T19:54:36.4060910Z ##[debug]rc:1
2018-04-20T19:54:36.4060910Z ##[debug]success:false
2018-04-20T19:54:36.4060910Z ##[debug]task result: Failed

We just ran into this as well. Any update from MSFT?

Node 8, 9 and 10 are affected. Tried setting Agent.TempDirectory to be prefixed with '\?\' without success. Is there any progress on this?

Hate to be another "Me too" but we have the same issue. We just moved to VSTS and the default directory it tries to download Node to ends up adding too many characters to the already long install path names it seems.

@AStoker - did you try @ericsciple solution from the beginning of the thread? The agent or node tasks don't have the limitation. It appears to be 7zdec.exe. The real fix would be to ship full 7z exe with the agent and have the task defer to that if it's there.

Also note that even if windows is set for long paths, there's things like other apps and desktop clr which has the limitation (node, coreclr and core windows does not).

Workaround is to have agent configured with a shorter working folder (e.g. d:a, helps with other path too long potential issues like ps1 and desktop clr) or you can set dynamically by

mkdir d:\a
echo ##vso[task.setvariable variable=agent.toolsDirectory]d:\a

account for multiple agents on the same box if that's a scenario ...

We will look for a permanent fix

We're going to bump the priority on a real fix ...

for anyone needing a temporary workaround, we created a junction symlink and replaced the Agent.TempDirectory using an inline Powershell script task

The fix is in master now. It will roll out across all scale units within the next few weeks.

Any way to get it on prem?

It will be in the next on prem release. The current workaround (above) is also viable (shorten the work path).

@ericsciple Is there a way to know what the version number of the task will be when this rolls out? I have several builds dependent on this issue, but I'm not sure what the "signal" will be to know when I should re-test. I'm seeing version 0.136.0 in the task.json on master and my current builds are showing a task version of 0.124.0, so I'm guessing there must be some other driving force behind the version number?

We roll out service updates in stages. The first stage (first group of accounts) is rolling out today. The rest will follow over the next couple weeks.

If you are using a private agent, a workaround is to configure a short work folder when configuring the agent.

Looks like node.js 10.8.0 distributive has shorter filenames )) Have success with Node Tool Installer with this version...

Was this page helpful?
0 / 5 - 0 ratings