microsoft / tfs-cli

Cross-platform CLI for Microsoft Team Foundation Server and Visual Studio Team Services
MIT License
369 stars 132 forks source link

VSIX does not validate if file path depth exceeds 105 characters #227

Open jgovednik opened 6 years ago

jgovednik commented 6 years ago

Creating new VSTS extension where I intended to include the xWebAdministration (v1.18.0.0 from the PSGallery) module within the ps_modules folder. The tfx utility packaged and published the vsix, but the marketplace hung while "verifying" (tfx calls it "validate") the extension package. I let the validation run overnight and it never completed. I tracked it down to the length of the files within the VSIX package. When I removed folders from the xWebAdministration module, the package "verified" successfully. Specifically, some of the paths within just the xWebAdministration module folder structure approach 100 characters; which when combined with the name of the task folder and the ps_modules folder approach 120 characters).

With some testing, it appears that file paths (at least, within the ps_modules folder - I haven't tested outside of that space) greater than 105 characters deep causes the VSIX package to not "verify".

Specific to my plugin, a folder path (within the VSIX) that DOES validate is (105 characters long): xWebsite\ps_modules\xWebAdministration\DSCResources\MSFT_xWebApplication\MSFT_xWebApplication.schema.mof And a file path that does NOT validate is (106 characters long): xWebsite\ps_modules\xWebAdministration\DSCResources\MSFT_xWebApplication\MSFT_xWebApplication.schema1.mof The issue occurred with multiple directories in the xWebAdministration module and had no relevence to the content of the files themselves, as this was eventually tested with an empty file.

Unfortunately, no error is ever returned for this and the only indication of failure in TFX is:

Checking if this extension is already published
It isn't, create a new extension.
Waiting for server to validate extension package...
This is taking longer than usual. Hold tight...
error: Validation timed out. There may be a problem validating your extension. Please try again later.

image

If this is a hard limit, please have the Marketplace fail verification immediately and return a usable error response so TFX doesn't time out; else, please fix the verification routine on the Marketplace to not hang on medium-length file paths (possible to support std char[260] path lengths?)

Thanks!

note: crossposted this from and issue in vsts-tasks, where this was originally posted, however its clearer now that this is related to the publish/validation part of the process and likely unrelated to the vsts-tasks code.)

pkuma-msft commented 6 years ago

Thanks for reporting this @jgovednik and apologies for the long delay in response. We are tracking a fix for this on the marketplace side, first part of the fix would fail the validation immediately instead of going to hung state, and the second part we will increase the path length to be 260 characters.

I will update this thread once we have the fix deployed. Thank you!