How to download artifact in TFS Linux agent? - tfs

I have created build and release definition in TFS 2017. In build definition I am publishing artifacts at windows server share path like \server\drop, When I am using those artifact in release pipeline which runs on Linux based agent getting below error.
An error occurred during download: System.NotSupportedException: Cannot download artifacts from a file share using OSX or Linux agent. You can download artifact from server or use a Windows agent.
at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.BuildArtifact.<DownloadArtifactAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.BuildArtifact.<DownloadAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Release.ReleaseJobExtension.<>c__DisplayClass34_2.<<DownloadArtifacts>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Release.RetryExecutor.<ExecuteAsync>d__20.MoveNext()

The error message also includes two possible solutions to the problem. Choose one:
Cannot download artifacts from a file share using OSX or Linux agent. You can download artifact from server or use a Windows agent.
Stop using file shares to store your artifacts and use the Server option instead
Use a Windows agent
There's really no compelling reason to use File Share artifact storage anymore; it was included in TFS 2015 for backwards compatibility with XAML builds.

Related

TFS fail to build with "sqlite3\db.lock' because it is being used by another process"

We have switched from the old xaml-build definitions to the new build definitions in TFS 2017. When we try to build the project it fails with the following error:
Starting: Build
******************************************************************************
Current agent version: '2.117.2'
******************************************************************************
Starting: Initialize Job
******************************************************************************
Prepare build directory.
One or more errors occurred. (One or more errors occurred. (The process cannot access the file 'E:\agent builds\agent1\1\s\Server\.vs\Server\v15\Server\sqlite3\db.lock' because it is being used by another process.)) (The process cannot access the file 'E:\agent builds\agent1\1\s\Server\.vs\Server\v15\Server\sqlite3\db.lock' because it is being used by another process.)
******************************************************************************
Finishing: Initialize Job
******************************************************************************
******************************************************************************
Finishing: Build
******************************************************************************
Why is it locking an sqlite database when building? What can be configured wrong to cause this?
I found out that one of our developers built the project manually in Visual Studio 2017 on the TFS server recently, and even if VS was closed the files seems to be locked by it. A reboot of the TFS server solved the issue.
Make sure that you're not checking in files and folders that you don't need (i.e. bin, obj, and .vs folders). In order to exclude such things, you might want use a .tfignore file if you're using TFVC or a .gitignore file if you're using git.
.vs and the files in it should not checked into TFS.

Perforce Translation of file error while Synching in Jenkins

My Jenkins Version: 2.46.2- LTS.
Jenkins OS: Ubuntu (This is Jenkins Master Server).
Perforce Plugin Version: 1.7.5
Slave Machine: OS Windows-7 (64Bit).
Perforce Visual Client Version: 2016.2
I have configured perforce to sync the code to slave machine from master server. But when i tried to download it shows below errors.
Jenkins Errors:-
Caught exception communicating with perforce.Error encountered while
force synching. Error: Translation of file content failed near Line.
Due to this i m unable to download the files.So any suggestions would be helpful.
This sounds like a Unicode translation error. Setting P4CHARSET to a different value may help, but if the files are corrupted on the back end (i.e. they aren't valid utf8, which is how the server normalizes its copy of all Unicode files) then it won't matter what you set on the client.
Good troubleshooting steps would be to try syncing the same file to another client, and to look in the history for the originally submitting client and try to figure out what character set it was using.

TFS Build failed due to InstallShield Exception

We are using InstallShield 2013 Limited Edition with TFS 2013 Build Server.
Occasionally our tfs XAML builds failed with error:
C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets (108): Exception Caught
License of InstallShield 2013 Limited Edition is successfully activated on Build Server Machine(WIN 7 machine).
Due to this error, complete build failed. To fix this, we need to restart tfs build server machine.
Please suggestion some permanent fix for this issue. Let me know if need any additional information.
If you get error saying InstallShield.Tasks.dll was not found or could not be loaded like screenshot below:
Solution:
Set the MSBuild Platform on your Build Definition to “X86” as shown
below:
If you get error saying InstallShield Licence has expired like screenshot below:
Solution:
Set your Build Service to run with a domain account instead of
“NT_AUTHORITY\Network Service”.

TFS2012 VSO Hybrid Build Service "Pending"

I need to create an on-prem build agent that pulls its source code from Visual Studio Online. I found a great blog post that describes how to do this here: blog post
My problem is, after following the steps my build service shows it's at a state of "Pending" rather than "Started" and I don't get to see the controller or agents in the TFS admin console as shown below:
I don't have a full on-prem TFS installation - I just have the newly installed build components.
I see the following error in the event log after 15 minutes:
Exception Message: The http request operation timed out after 00:15:00. (type TimeoutException)
Exception Stack Trace: at Microsoft.TeamFoundation.Build.Hosting.BuildMachine.StartOperation.End(IAsyncResult result, HttpRouter& router, TfsMessageQueue& messageQueue, List`1& processHosts, MachineLifecycleActivity& traceActivity)
at Microsoft.TeamFoundation.Build.Hosting.BuildMachine.EndStart(IAsyncResult result)
at Microsoft.TeamFoundation.Build.Machine.WindowsService.EndStartMachine(IAsyncResult result)
It turned out this problem was firewall related but nothing to do with port 9191. I think only port 443 is used. The problem seemed to relate to the fact that I had a domain account for the build service but need to use my hotmail account for the service to authenticate with visual studio online to pull down the source code. The build service was able to cope with this ok but the internet proxy service that "protected" the client's network needed additional configuration
Although that was the cause of the problem, whilst attempting a fix, I moved to using a TFS2015 build agent as Buck suggested. I downloaded the agent from the visual studio online site. I am now using the new web based build designer rather than xaml and I have found it to be excellent and it builds BizTalk solutions just fine - thanks for the advice Buck :)

How do I deploy my nuget package with Octopus Deploy and TFS 2013?

I am attempting to fully automate the deployment of a simple assembly onto two application servers (which have the Tentacle services installed), and I'm running into a few challenges.
What I have achieved:
I can create a NuGet package with /p:RunOctoPack=true.
I can manually upload (publish?) the package to my built-in feed on the Octopus Deploy server.
I can deploy the packages to both my application servers using the Octopus Deploy portal.
I can infer from the post (OctopusPublishPackageToHttp in TFS Service) that I should be able simply put all of the following on the Process/Build/Advanced/MSBuild Arguments box
/p:RunOctoPack=true
/p:OctopusPublishPackageToHttp=http://octoserver:8081/nuget/packages
/p:OctopusPublishApiKey=API-MYKEY.
However my builds are returning the error
Exception Message: Access to the path 'C:\Builds\1\Experiments\CIBuildDef\bin\ConsoleTibcoMefClient1.1.0.0.0.nupkg' is denied.
(type UnauthorizedAccessException)
With this assembly (a simple .NET Class Library). The builds are all being dropped into the same path (C:\Builds\1\Experiments\CIBuildDef\bin). I'm accustomed to a new folder being created by the build every time. I must be missing something in the build definition settings. Am I getting this error because I'm not changing the version number of the package yet? I cannot seem to delete the nupkg that was originally dropped in the Builds directory, even after deleting it from the feed.
How do put my NuGet package onto the feed with TFS?
How do run my Octopus Deploy steps from TFS?
Am I asking the right questions?
Thanks for any input you can provide.
Could you ping your octopus server from tfs build server? And could you telnet to 8081 port from your tfs build server? If you could, you should rebuild the project not build for the same repository. If the new nuget version is not higher than 1.0.0.0 octopack could fail. You must increment the nuget version from your tfs build template. The following commands must be work for you. This commands are for msdeploy deployment with powershell. If you want to use msdeploy you must install it to tentacles. I am using it for web project deployment.
Command line arguments:
/t:Rebuild /p:AutoParameterizationWebConfigConnectionStrings=False
/p:DebugSymbols=false /p:DebugType=None /p:IsAutoBuild=True
/p:CreatePackageOnPublish=true /p:Configuration=Release;DeployOnBuild=True;PackageLocation=".\obj\Release\Myproject.zip";PackageAsSingleFile=True /p:RunOctoPack=true
/p:OctoPackPackageVersion=%VERSION%-dev
/p:OctoPackPublishPackageToHttp=http://octopus.yourdomain.com/nuget/packages /p:OctoPackPublishApiKey=API-xxxxxxxxxxxxx

Resources