Why am I getting "Exit code 100 returned from process: file name 'tf'" - azure-devops

I'm using Azure DevOps (visualstudio.com) and trying to get a Linux Build Agent up and running on a local server. This was working previously, but I upgraded the Linux server from Ubuntu 16.04 to 18.04. That broke my previous build agent.
So I removed the previous build agent and installed an up to date one. The new one registered easily, but when I try and run a build, it fails to check out sources.
Anybody know what might cause this problem, or where I can go for help? I don't manage our Azure DevOps. I'm just trying to get the Linux part working as it was.
Edit: I should note that running ./externals/tee/tf produces zero output (and returns with the same 100 code). Maybe it has something to do with java. I'm running Java(TM) SE Runtime Environment (build 12.0.2+10).
##[debug]Evaluating condition for step: 'Checkout'
##[debug]Evaluating: SucceededNode()
##[debug]Evaluating SucceededNode:
##[debug]=> True
##[debug]Result: True
##[section]Starting: Checkout
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
##[debug]Processed: ##vso[plugininternal.updaterepositorypath alias=__designer_repo;]/home/***/myagent/_work/1/s
##[debug]Repository requires to be placed at '/home/***/myagent/_work/1/s', current location is '/home/***/myagent/_work/1/s'
Prepending PATH environment variable with directory containing 'tf'.
##[debug]Processed: ##vso[task.prependpath]/home/***/myagent/externals/tee
##[debug]PATH: '/home/***/myagent/externals/tee:/home/***/bin:/home/***/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
Querying workspace information.
##[debug]tf workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt
##[debug]Starting process:
##[debug] File name: 'tf'
##[debug] Arguments: 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'
##[debug] Working directory: '/home/***/myagent/_work/1/s'
##[debug] Require exit code zero: 'True'
##[debug] Encoding web name: ; code page: ''
##[debug] Force kill process on cancellation: 'False'
##[debug] Redirected STDIN: 'False'
##[debug] Persist current code page: 'False'
##[debug] Keep redirected STDIN open: 'False'
##[debug] High priority process: 'False'
##[debug]Updated oom_score_adj to 500 for PID: 1921.
##[debug]Process started with process id 1921, waiting for process exit.
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Finished process 1921 with exit code 100, and elapsed time 00:00:03.3458546.
##[error]Exit code 100 returned from process: file name 'tf', arguments 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'.
##[debug]Processed: ##vso[task.logissue type=error;]Exit code 100 returned from process: file name 'tf', arguments 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'.
##[debug]Processed: ##vso[task.complete result=Failed;]
##[debug] at Agent.Plugins.Repository.TeeCliManager.WorkspacesAsync(Boolean matchWorkspaceNameOnAnyComputer)
at Agent.Plugins.Repository.TfsVCSourceProvider.GetSourceAsync(AgentTaskPluginExecutionContext executionContext, RepositoryResource repository, CancellationToken cancellationToken)
at Agent.Plugins.Repository.CheckoutTask.RunAsync(AgentTaskPluginExecutionContext executionContext, CancellationToken token)
at Agent.PluginHost.Program.Main(String[] args)
##[section]Finishing: Checkout

When I saw that the tf command produced no output, I was pretty sure it had to be a java problem. I had tried many different versions of java and none of them worked. But with Oracle java 1.8.0_221 it finally worked.
I downloaded the .tar.gz file, extracted it, and overwrote the /usr/bin/java* symlinks to point to the 1.8 copies and then it worked.

Related

Unknown command error in Jenkins when running Cake script using Powershell

Our Jenkins server has been successfully building projects for years using Powershell to run a cake script. Out of the blue today, we started getting the following error on multiple projects:
12:10:46 Running build script...
12:10:46
12:10:46 Error: Unknown command 'Default'.
12:10:46
12:10:46 .\scripts\build.cake -target=Default -configuration=Release
12:10:46 -verbosity=Verbose -environment=dev -certificatePath=C:/Program Files
12:10:46 (x86)/xxxxx/Verisign Certificate -certificateName=xxxxxxxx_cert.pfx
12:10:46 -certificatePassword=xxxxxxxxxxx
12:10:46 ^^^^^^^ No such command
12:10:46
12:10:47 Build step 'Windows PowerShell' marked build as failure
The build.ps1 script has not changed. The build.cake script has not changed. Jenkins was not updated since the last successful builds nor any of the add-ins.
If I remove "-target=Default" from the argument list, I just get the same error on "-configuration=Release" indicating unknown command: "Release".
Has anyone else experienced this?
The possible root cause of this failure is the cake version update (0.38.x --> 1.0)
You have two ways to fix this issue
Change the Argument Syntex - arguments should always be called with multi-dash syntax (e.g. --target=Foo) instead of (e.g. -target=Foo)
Refer: https://cakebuild.net/docs/getting-started/upgrade
Pinning the cake version
Specified the version of Cake in the tools/packages.config file
Refer: https://cakebuild.net/docs/writing-builds/reproducible-builds/pinning-cake-version

Continue after a failing command in appveyor

In appveyor I use the statement:
- initexmf --admin --force --mklinks
but due to a problem it gives the message:
initexmf --admin --force --mklinks
Sorry, but "MiKTeX Configuration Utility" did not succeed for the following reason:
Script configuration file not found.
The log file hopefully contains the information to get MiKTeX going again:
C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log
The system cannot find the path specified.
Command exited with code 1
due to the error code the process terminates and I cannot type the C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log anymore, so a bit hard to debug ...
questions:
How to continue after an error
How to stop after the outputting the file (exit 1 ?)
To run a script on failure use on_failure section, for example to push initexmf_admin.log to artifacts:
on_failure:
- appveyor PushArtifact C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log

Allure plugin for VSTS returns error: Unknown Test Runner

The VSTS task: Generate Allure Report is failed.
The error is :
Unable to process command '##vso[results.publish type=Allure;mergeResults=true;publishRunAttachments=true;resultFiles=D:\a\1\s\allure-report\34;]' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
Unknown Test Runner.
Question: can it be a bug or problem connected to configs?
Configurations:
.Net version: 4.6.1, Nunit3, Nunit3 allure adapter
Task to run tests is a Command Line task where I used nunit3-console.exe to run test.
Configurations for Allure plugin:
Results directory : allure-results
Target directory : allure-report/$(Build.BuildNumber)
The output logs:
****************************************************************************** Starting: Generate Allure Report
============================================================================== Task : Generate Allure Report Description : Generates Allure
report based on the test results Version : 1.0.0 Author :
Molecula Help : More
Information
============================================================================== C:\Program Files\nodejs\node.exe
D:\a_tasks\AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb\1.0.0\node_modules\allure-commandline\bin\allure
generate --output D:\a\1\s\allure-report\34 D:\a\1\s\allure-results
Command aborted due to exception {}.
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1 (Exit value: 1) at
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at
ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at
ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46)
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1 (Exit value: 1) at
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at
ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at
ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46) at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Exception in thread "main"
ru.yandex.qatools.allure.data.ReportGenerationException: Could not
find any allure results at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Unable to process command '##vso[results.publish
type=Allure;mergeResults=true;publishRunAttachments=true;resultFiles=D:\a\1\s\allure-report\34;]'
successfully. Please reference documentation
(http://go.microsoft.com/fwlink/?LinkId=817296) Unknown Test Runner.
The default setting directory "allure-results" in the Allure task usually does not point to the actual path to result directory correctly since the path is different in different projects and environment. You need to update the setting to configure it to the actual path to the result directory manually.
According to the information you provided, the path to the result could be like this:
$(Build.SourcesDirectory)\SolutionFolder\ProjectFolder\bin\$(BuildConfiguration)\allure-results

Windows Machine File Copy won't work without shared folder

I am using VSTS Release Management. The first step is to do a "Windows Machine File Copy". The settings are below. This fails when doing the robocopy with an error message of "Access Denied". The file path shown in the settings below gets translated to \\machine\e$\xxxx\TargetFolder. Why am I getting access denied? I don't get this message if I create a shared folder on the target folder and change the destination folder to: \\machine\TargetFolder. The Admin user is a local admin on the machine.
My question is why do I need to setup a shared folder in order to get this to work. Why can't it use the admin share (i.e. \\machine\e$\xxxx\TargetFolder)
Here is the log. The source and destination servers are both Win 2012R2 servers. UAC is turned off on the destination server. I have tried /B and /ZB as arguments and that didn't work.
2017-02-20T12:21:10.4545267Z Downloading artifact
2017-02-20T12:21:11.4375965Z Cleaning artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a
2017-02-20T12:21:11.6306012Z Cleaned artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a
2017-02-20T12:21:11.6396014Z Starting artifacts download...
2017-02-20T12:21:11.6426015Z Downloading linked artifact Release Build of type Build...
2017-02-20T12:21:11.6486018Z Ensuring artifact folder C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build exists and is clean.
2017-02-20T12:21:11.6856039Z Preparing to get the list of available artifacts from build
2017-02-20T12:21:12.0926382Z Preparing to download artifact: release
2017-02-20T12:21:12.1066374Z Artifact Type: ServerDrop
2017-02-20T12:21:12.5536635Z Caching items under 'release' in the file container...
2017-02-20T12:21:12.7186787Z Caching complete. (165 ms)
2017-02-20T12:21:17.8480056Z Download complete.
2017-02-20T12:21:17.8500047Z 51 placed file(s): 51 downloaded, 0 empty
2017-02-20T12:21:17.8500047Z 11 MB downloaded at 2188 KB/sec. Download time: 00:00:05.0976254. Parallel download limit: 4.
2017-02-20T12:21:17.8510054Z Downloaded linked artifact Release Build
2017-02-20T12:21:17.8510054Z Finished artifacts download
2017-02-20T12:21:17.8610039Z ##[section]Finishing: Download Artifacts
2017-02-20T12:21:17.8690051Z ##[section]Starting: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release
2017-02-20T12:21:17.9680113Z ==============================================================================
2017-02-20T12:21:17.9680113Z Task : Windows Machine File Copy
2017-02-20T12:21:17.9680113Z Description : Copy files to remote machine(s)
2017-02-20T12:21:17.9690126Z Version : 1.0.39
2017-02-20T12:21:17.9690126Z Author : Microsoft Corporation
2017-02-20T12:21:17.9690126Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=627415)
2017-02-20T12:21:17.9690126Z ==============================================================================
2017-02-20T12:21:18.0380182Z Preparing task execution handler.
2017-02-20T12:21:19.8101219Z Executing the powershell script: C:\VSTS_agent\ReleaseManagementVSTS\_tasks\WindowsMachineFileCopy_xxxx\1.0.39\WindowsMachineFileCopy.ps1
2017-02-20T12:21:24.0233892Z Copy started for - 'machine'
2017-02-20T12:21:28.8116953Z
2017-02-20T12:21:28.8116953Z -------------------------------------------------------------------------------
2017-02-20T12:21:28.8116953Z ROBOCOPY :: Robust File Copy for Windows
2017-02-20T12:21:28.8116953Z -------------------------------------------------------------------------------
2017-02-20T12:21:28.8116953Z
2017-02-20T12:21:28.8146952Z Started : Monday, February 20, 2017 7:21:28 AM
2017-02-20T12:21:28.8156949Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Getting File System Type of Destination \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8156949Z Access is denied.
2017-02-20T12:21:28.8156949Z
2017-02-20T12:21:28.8156949Z
2017-02-20T12:21:28.8156949Z Source : C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build\release\
2017-02-20T12:21:28.8167052Z Dest - \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z Files : *.*
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z ------------------------------------------------------------------------------
2017-02-20T12:21:28.8186939Z
2017-02-20T12:21:28.8196951Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Creating Destination Directory \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8196951Z Access is denied.
2017-02-20T12:21:28.8196951Z
2017-02-20T12:21:28.8977003Z \\machine was deleted successfully.
2017-02-20T12:21:28.8977003Z
2017-02-20T12:21:28.9177039Z ##[error]System.Management.Automation.RuntimeException: Copying failed for resource : machine
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details. ---> System.Management.Automation.RuntimeException: Copying failed for resource : machine
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details.
2017-02-20T12:21:28.9177039Z --- End of inner exception stack trace ---
2017-02-20T12:21:28.9177039Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-02-20T12:21:28.9187021Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2017-02-20T12:21:28.9407042Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2017-02-20T12:21:28.9427038Z ##[section]Finishing: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release
2017-02-20T12:21:28.9507042Z ##[section]Finishing: Release
This issue was resolved by using an Active Directory account. This fixed the issue of not being able to Robocopy with the admin share. This worked on machines that the AD user had access, and for machines where the AD didn't have access but where a local admin windows account was setup with the same name as the AD account.

Chain psexec and nunit is not working (psexec exit with code 1 and nunit is crashed)

Sorry for unclear subject but i really don't understand where problem.
I use a system for autotests c#+webdriver for chrome + nunit (2.6) + cc.net ( 1.6.7981.1)
And my tests is run on remote machine (Windows XP SP 2 x86)via psexec which start bat file on remote machine
bat file includes 2 commands:
run msbuild
run nunit-console
Well, psexec has next arguments
/accepteula \MachineName -u Login -p Pass -s Path\start.bat
Bat file has next command
nunit-console-x86.exe "%PROJECT_FOLDER%\Path\Tests.dll" "/xml=%TEST_RESULT_PATH%"
When cc.net launch psexec tests is started and the tests work during some time. Unexpected, psexec exit with code 1
message level="Error">Path\start.bat exited on MachineName with error code 1. message
But nunit-console on remote machine is continue working
And after some time console is crashed with error
szAppName : nunit-console-x86.exe szAppVer : 2.6.0.12051
szModName : kernel32.dll szModVer : 5.1.2600.2180 offset :
0001eb33
Message from Event log
Application: nunit-console-x86.exe Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.IOException Stack: at
System.IO._Error.WinIOError(Int32, System.String) at
System.IO._ConsoleStream.Write(Byte[], Int32, Int32) at
System.IO.StreamWriter.Flush(Boolean, Boolean) at
System.IO.StreamWriter.Write(Char[], Int32, Int32) at
System.IO.TextWriter.WriteLine(System.String) at
System.IO.TextWriter.WriteLine(System.String, System.Object) at
System.IO.TextWriter+SyncTextWriter.WriteLine(System.String,
System.Object) at System.Console.WriteLine(System.String,
System.Object) at NUnit.ConsoleRunner.Runner.Main(System.String[])
at NUnit.ConsoleRunner.Class1.Main(System.String[])
If run nunit locally than no problem(nunit-console works fun).
Some time ago system worked, and i don't know what is changed (This is most bad case)
How can i resolve this problem?
Thanks!
This problem is resolved!
Now system is working