Failed rmRF: EPERM: operation not permitted, unlink .bowerrc - tfs

I am using TFS Online todo Continuous Integration The builds pass but the Release fail because I get the following error
Unhandled: Failed rmRF: EPERM: operation not permitted, unlink 'C:\path\.bowerrc'
The thing I did notice is that when i look at the files in TFS i can see the .bowerrc but once artifacts gets dropped after the build and i look at the Zip file the .bowerrc is not their is that possibly the reason

I faced the same issue in VSTS today. The error was :
##[error]Unhandled: Failed rmRF: EPERM: operation not permitted, unlink 'F:\...\UI\app.js'
This error was thrown in the copy step of my build definition. I just cleaned up the existing files in that path and the build was successful. You may even consider to have the "Overwrite" option turned on if you faces the same.

Try adding
<ItemGroup>
<Content Include=".bowerrc" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
to the csproj file

If your VM is Windows, put your services in other folder, not in C:\ directly.
For example, in C:\Services\path\.bowerrc.

Related

Invalid path on nuget restore step

I have TFS service on premise. I am trying to setup build and stuck on nuget restore step.
I have pass target solution to settings:
Path to solution or packages.config: $/MyProject/MySolution.sln
On log, nuget fails due to invalid directory
NuGet.exe restore -NonInteractive D:\TFS\agent01\_work\63\s -ConfigFile \\SomePath\Nuget.config -NoCache -Verbosity Detailed
As you can see, invalid target is passed to nuget.
It should be
D:\TFS\agent01\_work\63\s\$\MyProject\MySolution.sln
But is
D:\TFS\agent01\_work\63\s
In other projects works as expected. What could be wrong?
Do you have it declared as a build step? It looks like you somewhere put a remote path where it can't be resolved on the agent. I have a very similar setup running and it works with the NuGet-Installer build step:
It turned out that, the problem was Get Source step.
In Server path variable I had path to solution itself instead of( sln file) of folder to solution.

TFS build Get Sources step fail on WiX Toolset NuGet package

I'm working on a non-XAML TFS build; my solution includes a number of WiX installer projects. I've installed the WiX.Toolset.2015 NuGet package in each installer project. My solution builds successfully in Visual Studio and .msi installer files are produced for each WiX project as expected.
But, when I kick off a TFS build, the Get Sources step returns an error.
From the step logs, it appears that the WiX NuGet package content has been successfully copied to my build server (see log extract below, particularly ThmViewer.exe):
2018-07-27T09:25:08.2583873Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503:
2018-07-27T09:25:08.2583873Z Getting content
2018-07-27T09:25:08.2583873Z Getting readme.txt
2018-07-27T09:25:08.2583873Z Getting tools
2018-07-27T09:25:08.2583873Z Getting WiX.Toolset.2015.3.10.0.1503.nupkg
2018-07-27T09:25:08.2583873Z
2018-07-27T09:25:08.2583873Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\content:
2018-07-27T09:25:08.2583873Z Getting WiX.Toolset.DummyFile.txt
2018-07-27T09:25:08.3365150Z
2018-07-27T09:25:08.3365150Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools:
2018-07-27T09:25:08.3365150Z Getting Install.ps1
2018-07-27T09:25:08.3365150Z Getting Remove.psm1
2018-07-27T09:25:08.3990132Z Getting Uninstall.ps1
2018-07-27T09:25:08.4615127Z Getting wix
2018-07-27T09:25:08.4615127Z
2018-07-27T09:25:08.4615127Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix:
2018-07-27T09:25:08.4615127Z Getting candle.exe
2018-07-27T09:25:08.5084025Z Getting candle.exe.config
2018-07-27T09:25:08.5396418Z Getting darice.cub
2018-07-27T09:25:08.6490185Z Getting dark.exe
...
2018-07-27T09:25:10.3365325Z Getting smoke.exe.config
2018-07-27T09:25:10.4146591Z Getting ThmViewer.exe ***
2018-07-27T09:25:10.4615352Z Getting torch.exe
...
2018-07-27T09:25:12.5865476Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\doc:
2018-07-27T09:25:12.5865476Z Getting bal.xsd
2018-07-27T09:25:12.7584269Z Getting complus.xsd
2018-07-27T09:25:12.8209262Z Getting Dependency.xsd
2018-07-27T09:25:12.8834264Z Getting difxapp.xsd
...
Then, further down the logs for the same step (Get Sources), we see:
2018-07-27T09:25:35.1492409Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\ThmViewer.exe: Could not find file 'D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\ThmViewer.exe'.
2018-07-27T09:25:42.2586735Z
2018-07-27T09:25:42.2586735Z ---- Summary: 0 conflicts, 0 warnings, 1 errors ----
2018-07-27T09:25:42.2586735Z D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\ThmViewer.exe: Could not find file 'D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\ThmViewer.exe'. ***
2018-07-27T09:25:42.5868038Z ##[error]Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:887970 /recursive /overwrite D:\[build_folder]\[build_subfolder] /loginType:OAuth /login:.,******** /noprompt'.
2018-07-27T09:25:42.6024247Z ##[section]Finishing: Get Sources
I have other NuGet packages installed in other projects in this solution; all other sources are recovered without issue.
I've double-checked the packages source folder on my local machine and the ThmViewer.exe is in the \packages\WiX.Toolset.2015.3.10.0.1503\tools\wix folder as expected; all sources are checked into TFS.
I'm struggling to understand why the ThmViewer.exe file can't be found on the build server despite the logs indicating its successful copy. I'd be very grateful for any insights that may help to resolve the issue.
Thanks.
Just as Daniel said, we don't recommend to get the nuget packages in source control, you should use NugGet package restore.
Whatever just try below things to narrow down the issue:
Check if you can find the file
D:\[build_folder]\[build_subfolder]\Source\packages\WiX.Toolset.2015.3.10.0.1503\tools\wix\ThmViewer.exe
under the work folder on build server. If it's not there, then it
will not work.
Shrink the path length.
Cloak the packages folder, add a Nuget Restore task to restore the
packages

TFS Online Build Fails with Could not find part of the path

My build fails with
Could not find a part of the path 'App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf'.
The file exists in in the file system
The file exists in Source Control
The get sources phase seems to find the file fine
2017-11-28T10:49:32.5448880Z Getting aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf (no errors here)
Things I've tried:
Excluding the file from the project
Deleting the file in visual studio and checking in
Deleting the file in Source Control Explorer and Checking in
Setting the file to copy if newer
Setting the file to copy always
Unticking build in configuration manager for the offending project
The error always comes back.
Copying App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf to obj\Release\Package\PackageTmp\App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf.
2017-11-28T10:50:48.4423213Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(2603,5): Error : Copying file App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf to obj\Release\Package\PackageTmp\App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf failed. Could not find a part of the path 'App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf'.
My final act of sheer desperation was to remove the entire project so at least the rest of the solution would build, but to my utter surprise the error still remains.
The solution was to set the file to do not copy and clear the MSBuild Arguments in the build definition.

"Access Denied" error during TFS XAML build process

I Have Source Controller And Team Project My Build Process Is
and when i build i Got Access Denied Error Like This:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (3678): Unable to copy file "C:\Builds\2\AcuatAgile\AcuatNFSBuild\src\AcuatAgile\Release001\Library\Kendo.Mvc.dll" to "C:\Builds\2\AcuatAgile\AcuatNFSBuild\bin\Kendo.Mvc.dll". Access to the path 'C:\Builds\2\AcuatAgile\AcuatNFSBuild\bin\Kendo.Mvc.dll' is denied.
and every time i got Access Denied To Different File DLL
I Searched The Net And Most Of The Answers are Clean WorkSpace As You Can See I Put True To Clean WorkSpace And I Got The Same Error in Build.
is there any other parameters to solve this problem?
Check the properties of bin folder to see whether it is read-only.
Try to add the following MSBUILD arguments in the build definition: /m:1 to make MSBUILD to use only one process to build.

tf.exe Unable to detrmine the workspace

I am trying to call TF get command via Team Build script. I am getting the following error
Unable to determine the workspace.
Folks over the internet tell that this error is because Team Build cannot find the workspace because it is being called from a directory which is not part of the workspace.
The solution presented is to specify the working directory. I do so. The mappings are ok in Build Definition path as well as in the workspace. But now i get the following error:
Could not find cmd.exe in the current
directory . The directory name is
invalid.
Kindly help.
Thanks
Solved the problem. I added one more binding in my build Definition Workspace Section and referenced files to get/checkin/checkout with the help of variable $(MSBuildSourceDirectory). Meanwhile I ensured that $(SourceDir) is used to specify mapping in the workspace section of my Build Definiton dialog.
(source: geekswithblogs.net)
At the same time i encountered 260-character path limit, so i modified the output directory in build path as described here
(source: geekswithblogs.net)

Resources