Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
How to reproducte:
Add 'Publish Build Artifacts' task to a build. I choose for 'Path to publish' a specific file from my build, for instance:
$(Build.SourcesDirectory)/mybuild.msi
For 'Artifact publish location' I choose 'Visual Studio Team Services/TFS'. Publishing of the msi works perfectly!
Now when I choose (same build) in the 'Artifact publish location' the value 'a file share' and with that a proper 'File share path' I get the following error when publishing:
2017-10-31T06:50:42.9295926Z 2017/10/31 07:50:42 ERROR 123 (0x0000007B) Accessing Source Directory D:_vso_work\26\s\mybuild.msi\
2017-10-31T06:50:42.9295926Z The filename, directory name, or volume label syntax is incorrect.
2017-10-31T06:50:42.9295926Z
2017-10-31T06:50:42.9295926Z ##[debug]robocopy exit code '16'
2017-10-31T06:50:42.9452179Z ##[error]Publishing build artifacts failed with an error: powershell.exe failed with return code: 1
Hi,
The task "Publish Build Artifacts" copying files to a file share, requires a folder as the "Path to publish" input value. You're specifying a file path: $(Build.SourcesDirectory)/mybuild.msi.
You can stage the artifact file before you publish it. Add one more task before your "Publish Build Artifacts" one that will copy your MSI file to the $(build.artifactstagingdirectory) folder and the publish the latter.
Task: Copy Files
Source Folder: $(build.sourcesdirectory)
Contents: mybuild.msi
Target Folder: $(build.artifactstagingdirectory)
Task: Publish Build Artifacts
Path to publish: $(build.artifactstagingdirectory)
...
Alex
Hi Alex,
Thank you for your reaction.
I do know how to workaround it, but it is strange that when chosing 'File share', a perfectly running task is sudden causing an error just because you change the 'artifact publish location'. It shouldn't make a difference where your artifact publish location is: on Visual Studio Team Services/TFS or a custom chosen location. That shouldn't create an error, period.
And do mind you can selecting a file (instead of a folder) when clicking the 3 dots next to 'Path to publish'. The information symbol is also saying folder or file path, not mentioning that filenames are not supported when using 'File Share' as 'Artifact publish location' (only that wildcards are not supported)!
In my opinion this is plain wrong.
Dear all,
we are creating a .zip file from our build outputs and want to publish this .zip into a separate build artifact called "zipped_drop". Unfortunately we spend a lot of time to create a working build configuration just because of this bug.
The task (robocopy behind) always handles the "Path to Publish" as a folder, no matter whether you specify a file path.
It's explanation also says "folder or file path to publish".
It just makes things complicated if you have to workaround with additional folders you actually don't need, just to get it work as it actually should.
In my opinion this must be fixed asap.
A fix for this issue (7cf7ed1d4a14fbb7af30a6b5738fc93a5fc15a4c) has been deployed to all accounts in VSTS. Please let us know if you still see a problem.
Any clue when this will be available for on-premise version?
@RomanMik: It will be in the next feature update for TFS 2018, we don't have a timeline yet.
Most helpful comment
A fix for this issue (7cf7ed1d4a14fbb7af30a6b5738fc93a5fc15a4c) has been deployed to all accounts in VSTS. Please let us know if you still see a problem.