VSTS Release Failing due to file in use on remote server - c#

Before I state the question I am aware this may be more of a server administration question however I am seeking an answer that involves fixing / modifying the VSTS release process instead of dealing with server permissions (I don't believe this is a server issue).
I have a VSTS Build definition and Release definition.
The release definition copies the files from the build to a remote server (an IIS site).
My problem is that this process fails roughly 60% of the time.
Log files showing failure error:
2017-04-06T17:06:07.3886551Z Executing the powershell script: D:\BuildAgent\agent\tasks\IISWebAppDeploy\1.4.3\Main.ps1
2017-04-06T17:06:07.5605268Z Starting deployment of IIS Web Deploy Package : \\server01\Deploy\patrol\dev\rest_service\822\822.zip
2017-04-06T17:06:07.6542742Z Performing deployment in parallel on all the machines.
2017-04-06T17:06:07.6542742Z Deployment started for machine: SERVER01 with port 5985.
2017-04-06T17:06:27.9820654Z Deployment status for machine SERVER01 : Failed
2017-04-06T17:06:28.0133029Z Deployment failed on machine SERVER01 with following message : System.Exception: Error Code: ERROR_FILE_IN_USE
2017-04-06T17:06:28.0445759Z ##[error]Microsoft.PowerShell.Commands.WriteErrorException: Deployment on one or more machines failed.
2017-04-06T17:06:28.0445759Z ##[error]For more info please refer to http://aka.ms/iisextnreadme
I circumvate the problem by manually remoting into the server and deleting the contents of the target directory manually. I've discovered that each time the release is failing, my manual delete causes a warning to popup that an .exe file is being used by another process. My suspicion is that this is the reason the release is failing.
Is there some extra step that can be added to a release to force delete / clear the target directory?

You can use Windows Machine File Copy task to copy files from build to a remote server. And select Clean Target so that before copy files to remote server, it will clean the target destination folder firstly.

Related

JetBrains Rider remote debugger error : Unable to start debugging. The system cannot find the file specified

I just ran into problem described in header. Trying to connect to w3wp process on remote server.
Rider cannot find the path described in error to upload it's files on server. You need just create this folder

Cannot send build results to SonarQube server

I'm working on a POC and I'm able to create a project and send the build results to SonarQube localhost server without any errors.
But when I build the same project and send the the results to production server, build will succeed but the results on the server is empty.
In the server, I'm getting the following warning.
SCM provider autodetection failed. Please use “sonar.scm.provider” to define SCM of your project, or disable the SCM Sensor in the project settings.
I found that, its not creating the output-cs folder. when i run these commands in local its creating those files and folders but for production server its not.
Path to output-cs
C:\Users\Administrator\Desktop\my-project.sonarqube\out\0
Code I ran for localhost:
C:\Users\Administrator\Desktop\sonar-scanner-msbuild-5.1.0.28487-net46\SonarScanner.MSBuild.exe begin
/k:"my-test-project" /d:sonar.verbose=true /d:sonar.host.url="http://localhost:9000"
/d:sonar.login="project-token"
MsBuild.exe /t:Rebuild
C:\Users\Administrator\Desktop\sonar-scanner-msbuild-5.1.0.28487-net46\SonarScanner.MSBuild.exe end
/d:sonar.login="project-token"
Code I ran for Production Sever:
C:\Users\Administrator\Desktop\sonar-scanner-msbuild-5.1.0.28487-net46\SonarScanner.MSBuild.exe begin
/k:"my-test-project" /d:sonar.verbose=true /d:sonar.host.url="http://prod-server-url"
/d:sonar.login="sonarqube_project_token"
MSBuild.exe /t:Rebuild
C:\Users\Administrator\Desktop\sonar-scanner-msbuild-5.1.0.28487-net46\SonarScanner.MSBuild.exe end
/d:sonar.login="sonarqube_project_token"
Difference between those two codes is only the SonarQube project name and token only.
I went through the build stack trace and found some warnings.
WARN: No coverage report can be found with
sonar.coverage.jacoco.xmlReportPaths='build/reports/jacoco/test/jacocoTestReport.xml'.
Using default locations:
target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
Doubt:
Do we need to specifically mention some additional parameters when building for server compared to localhost?
Note: This is c# application.

asp.net core 2.0 app publishing taking over 20 mins -- then won't load

I have an application with about 6 Nuget packages and 3-4 local project references. The local build is fast and runs as expected. When I set up a profile to publish in release mode to local folder for file deployment, it will list out thousands of lines in build output resolving tons of packages for easily 20-25 mins.
Once this process completes, the site errors out in a 500 complaining about missing:
An unhandled exception has occurred: No service for type 'Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration' has been registered.
I have tried to disable AI on entire application. removed all references and even disabled via the JSON config using:
ASPNETCORE_preventHostingStartup": "True"
waiting 20-25 for each publish process to complete is painful. but to then have it fail because of this error repeatedly is driving me mad.
What am I missing?

Failed to convert the downloaded code coverage tool to XML

I have code coverage enabled on TFS 2013. I work with MSBuild.SonarQube.Runner 1.0.1. When I run the End phase of the Analysis. I get the following error messages:
11:36:00.269 Failed to convert the downloaded code coverage tool to XML. No code coverage information will be uploaded to SonarQube.<br/>
Check that the downloaded code coverage file (C:\Builds\39\[product name]\System_Main_Release_Code_Analysis\.sonarqube\out\VSCodeCoverageReport.coverage) is valid by opening it in Visual Studio. If it is not, check that the internet security settings on the build machine allow files to be downloaded from the Team Foundation Server machine.
Post-processing failed. Exit code: 1
An error occurred while copying diagnostic activity logs to the drop location. Details: Forbidden
On the build server there is no VSCodeCoverageReport.coverage file - at least not at the indicated location and with that name. However, when I click on (Coverage Results) in the TFS Build summary, a coverage file is downloaded that opens up in Visual Studio in the Code Coverage Results Window.
What could be the issue?
The problem is solved.
The proxy settings on the build agent had changed. This resulted in http requests to the TFS server or any local addresses to fail.
It was particularly challanging to figure out, because the Agent build log that tells you all the details of a build is the file that could not be transferred to the drop location. So I used ProcMon from Sysinternals with File monitor enabled during a build. A comparison between a successful build in the past and a current failed build showed me which file was missing (the agent log file). A search in ProcMon for this file revealed where that file was located on the build agent. The Agent Log file contained the Downloading coverage file from {0} to {1} line Dinesh was looking for in his attempt to help me. That http address pasted into a browser showed an "Access denied" message.
From there it was a logical step to analyse the Proxy settings. What finally solved it was to check "Bypass proxy server for local addresses" in the Local Area Network (LAN) Settings"

Error deploying to AWS through visual studio

My co-worker is able to deploy our projects to AWS Elastic beanstalk fine. However I have issues on both my work machine and my home laptop. Both computers have the same error in AWS window pane.
I get a pop up as follows:
Deployment of the website failed due to errors during build of the deployment archive,
check visual studio output window 'Build' and/ or 'Amazon Web Service' panes for more details.
Then in the amazon window pane I get a different error everytime I try to run the deployment.
Example 1:
...package build 'CopyPipelineFiles': error in 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets' at (1413,5): Copying file Web.config to obj\AmazonDev\TransformWebConfig\original\Web.config failed. Could not find file 'Web.config'.
Example 2:
...package build 'TransformXml': error in 'C:\Users\Andrew\colony\colony-website\Colony.Web\Colony.Web.csproj' at (840,5): Could not open Transform file: Could not find file 'C:\Users\Andrew\colony\colony-website\Colony.Model\Web.AmazonDev.config'.
Seems to be a different error each time -- I'm not sure how to even begin to look for any issues.
Jim Flangagan's comment is the answer: ReSharper 8.2 is causing this problem. To resolve either disable resharper ( Tools>Options>ReSharper>General>Suspend Now) or upgrade Resharper.

Categories

Resources