Build Agent is Offline - tfs

I m using TFS 2015, I saw that my build Agent is Offline :
I launch the VsoWorker.exe to see the logs and understand the error, Here is what I get but I found nothing from the internet : Any Idea please ?
16:07:57.649004 Sending trace output to log files: C:\Users\Administrator\Downloads\agent\_diag
16:07:57.649004 vsoWorker.exe was run with the following command line:
"C:\Users\Administrator\Downloads\agent\Agent\Worker\VsoWorker.exe"
16:07:57.649004 VsoWorker.Main(): Create AgentLogger
16:07:57.649980 VsoWorker.Main(): Parse command line
16:07:57.655848 ---------------------------------------------------------------------------
16:07:57.657635 System.Exception: The /name command line option is required and must have a value.
16:07:57.657635 at VsoWorker.CommandLine.ValidateCommandLine()
16:07:57.657635 at VsoWorker.CommandLine..ctor(String[] args)
16:07:57.657635 at VsoWorker.Program.Main(String[] args)
16:07:57.657635 at VsoWorker.CommandLine.ValidateCommandLine()
16:07:57.657635 at VsoWorker.CommandLine..ctor(String[] args)
16:07:57.657635 at VsoWorker.Program.Main(String[] args)
16:07:57.657635 ---------------------------------------------------------------------------
16:07:57.658878 BaseLogger.Dispose()

When you install the Build Agent you are instructed to make a C:\Agents folder:
If you have not first configured the Build Agent, open Powershell and run this command:
PS C:\agent> .\config.cmd
In the config setup there is an option to run the Build Agent as a Window Service. This way you don't need to start it each time the machine reboots.
If you've found the BuildAgent has been installed but is offline, it's probably not been configured to run as a Service
and you will need execute this command to run the Build Agent or just double click the file:
PS C:\agent> .\run.cmd
This should bring the Build Agent online.
Note: The 1st time I tried this and it worked. The second time it didn't and I ran the C:\agent\bin\Agent.Listener.exe instead. I tried a 3rd time running the run.cmd and this time I waited a minute or 2 and it worked:
Note: You're better off making the agent run as a Service, this way you only need to run the config.cmd once and never need to run the run.cmd.

Make sure you deploy the Windows build agent by exactly following this article.
Make sure the account that the agent is run under is in the "Agent Pool Service Account" role.
Try to change a domain account which is a member of the Build Agent Service Accounts group and belongs to "Agent Pool Service Account" role, to see whether the agent would work or not.

Don't run the VsoWorker.exe application directly. Use the RunAgent.cmd file.

Related

how to run jenkins-agent.jnlp at startup as admin

I have downloaded the jenkins-agent.jnlp to windows and created shortcut to windows startup folder.
the agent connected successfully. however when Jenkins trigger cmd, access denied error is occured.
I tried to terminated Jenkins agent and open cmd as admin, run the jenkins-agent.jnlp from cmd then the error is not happend.
How do I execute above automatically instead of manual run cmd as admin then execute the jenkins-agent.jnlp?
Create a task on task scheduler and select user like this.
write administrator name and check the name and create the task as admin.

Failed to provisioning worker for TestDataflowRunner in asia-southeast1 zone

I have a question I'd like to ask about TestDataflowRunner.
I created a beam pipeline (Java) that runs using DataflowRunner. I deployed the worker in zone asia-southeast1 belong with the network. The pipeline runs normally as expected in DataflowRunner. Therefore, I also want to create #ValidatesRunner tests using TestDataflowRunner. I've run the test using the same service account and the same network. The execution graph also looks loaded fine, but failed to provisioning the worker.
Following is the command that I use to run the tests.
task validatesRunnerTests(type: Test) {
group = "Verification"
description = "Run tests that require a Dataflow runner to validate that pipelines/transforms work correctly"
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=TestDataflowRunner",
"--project=$projectId",
"--region=us-central1",
"--workerZone=$zone",
"--usePublicIps=false",
"--network=$network",
"--subnetwork=$subnetwork",
"--tempRoot=$stagingBucket",
"--serviceAccount=$serviceAccount",
])
useJUnit {
includeCategories 'org.apache.beam.sdk.testing.ValidatesRunner'
}
}
The service account has included following roles.
roles/dataflow.admin
roles/dataflow.worker
I've only got following errors log, but I can't found any error logs in Stackdriver VM Instance.
2020-08-12 17:16:27.061 ICT Startup of the worker pool in zone asia-southeast1-a failed to bring up any of the desired 1 workers. The project quota may have been exceeded or access control policies may be preventing the operation; review the Stackdriver Logging "GCE VM Instance" log for diagnostics.
2020-08-12 17:16:27.095 ICT Workflow failed. Causes: Internal Issue (8c283568ab7f3c3c): 82159483:17
Does anyone know the problem and can help me?
Thank you
The issue seems to be getting the job to launch with private IPs only. I launched a Dataflow job using the TestDataflowRunner, disabling public IPs.
I first cloned the WordCount repo [1], and made three changes to WordCount.java.
Added the following libs:
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestPipelineOptions;
Changed:
public interface WordCountOptions extends PipelineOptions {
to
public interface WordCountOptions extends TestPipelineOptions {
and
Pipeline p = Pipeline.create(options);
to
Pipeline p = TestPipeline.create(options);
I used Maven, and ran the following command:
mvn clean compile exec:java \
-Dexec.mainClass=org.apache.beam.examples.WordCount \
-Dexec.args=" \
--project=$PROJECT_ID\
--tempRoot=gs://mcbuckety/tempf
--output=gs://$BUCKET_NAME/testrundf \
--runner=TestDataflowRunner
--usePublicIps=false
--subnetwork=regions/us-central1/subnetworks/private"
-Pdataflow-runner
The code compiled and launched a Dataflow job. I went to the GCE page to check that the VM did not have Public IPs, and that was indeed the case. I know the code is not strictly testing; I am not asserting anything, but I got the pipeline to launch.
[1] https://beam.apache.org/get-started/quickstart-java/#get-the-wordcount-code

kubectl set image throws error: the server doesn't have a resource type deployment"

Environment: Win 10 home, gcloud sdk v240.0 kubectl added as a gcloud sdk component, Jenkins 2.169
I am running a Jenkins pipeline in which I call a windows batch file as a post-build action.
In that batch file, I am running:
kubectl set image deployment/py-gmicro py-gmicro=%IMAGE_NAME%
I get this
error: the server doesn't have a resource type deployment
However, if I run the batch file directly from the command prompt, it works fine. Looks like it has an issue only if I run it from Jenkins.
Looked at a similar thread on stackoverflow, however that user was using bitbucket (instead of Jenkins).
Also, there was no certified answer on that thread. I cannot continue on that thread since I am not allowed to comment (50 reputation required)
Just was answered on this thread
I've had this error fixed by explicitly setting the namespace as an argument, e.g.:
kubectl set image -n foonamespace deployment/ms-userservice.....
Refrence:
https://www.mankier.com/1/kubectl-set-image#--namespace

Jenkins fails to execute while running as winservice

I am able to run my script successfully from jenkins when jenking is opened using war file.
If set the jenkinks as winservice my script is failing in middle.
I am trying to run a start.bat file from jenkinks, this bat file calls a java class. again this java class uses bat file to run a plink command.
Execution stops at this stepsif jenkinks is running as winservice and also I can't view the output as it is running in background.
Is there any way to make jenkinks behave normal while running as winservice
Thanks
Try this:
1. Go to services (hit windows key, type "services", select "Services" from the list of matches).
2. Find the Jenkins service and open it's properties
3. Switch to Log On tab
4. Change the service to run as you, instead of local system user.
5. Restart service.
Alternative is to fix local system user account (probably environment variables) so it works as local system user.

Hudson build server install as a windows service error

Problem
I am trying to install hudson build server on a windows server through remote desktop connection. I path to the Hudson folder in the C:\Hudson. The Hudson directory contains a folder called Home and the hudson.war file.
I tried to start it up using the following commands:
set JAVA_HOME=C:\Java\jdk1.6.0_20
set HUDSON_HOME=C:\Hudson\Home
java -jar C:\Hudson\hudson.war
Then I can navigate to http://localhost:8080 in internet explorer.
Question
When I try to use the Install as Windows Service function on the web interface, I get this error:
Installing a service
[Home] $ C:\Hudson\Home\hudson.exe install
WMI.WmiException: AccessDenied
at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result)
at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , ErrorControl , StartMode , Boolean , String[] )
at winsw.WrapperService.Run(String[] args)
at winsw.WrapperService.Main(String[] args)`
Why can't I install as a windows service and how can I fix this issue?
Answer
Found the solution.
When running the commands you need to open the command prompt by right clicking and selecting "run as administrator".
On the windows command prompt, execute: sc delete hudson
and for jenkins user, execute: sc delete jenkins
and then run install windows as a service.
Hope it helps :)
Try turning off User Account Control; that's what fixed it for me. Start > Run > UAC, then drag the dial to the lowest setting: "Never notify". May require a reboot.

Resources