Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Aravind SV
@arvindsv
Maybe, but I’d expect agent/registration.go to be the only one that registers.
The build_session.go one seems to be just reporting something.
Tomasz Sętkowski
@tomzo
I can change that and will check in few minutes
Aravind SV
@arvindsv
Ok, thanks.
I need to move on to something else for a bit. If it doesn’t work, I’ll check again in the evening.
Tomasz Sętkowski
@tomzo
OK, thanks a lot
Aravind SV
@arvindsv
You’re welcome. The other usage which leads to the runtime info including that boolean is: https://github.com/gocd-contrib/gocd-golang-agent/blob/61263063a9a975270aea5942cf233ab24898a508/agent/build_session.go#L282
Tomasz Sętkowski
@tomzo

I added the field to map

@@ -144,6 +144,7 @@ func registerData() map[string]string {
         "agentAutoRegisterHostname":     config.Hostname,
         "elasticAgentId":                config.AgentAutoRegisterElasticAgentId,
         "elasticPluginId":               config.AgentAutoRegisterElasticPluginId,
+        "supportsBuildCommandProtocol":  "true",
     }
 }

Agent does not crash anymore on alpine. But it executes a job without reporting it correctly. Server is still waiting for some confirmation. Agent log:

bash-4.3# ./gocd-golang-agent_linux_amd64
>>>>>>> go >>>>>>>
working directory: /godata/agent
fetching Go server[localhost:8154] CA certificate
fetching agent key and certificates from: https://localhost:8154/go/admin/agent
connect to: wss://localhost:8154/go/agent-websocket
--> ping
<-- acknowledge
--> ping
<-- acknowledge
<-- build
set buildLocator to test/19/defaultStage/1/defaultJob
set buildLocatorForDisplay to test/19/defaultStage/1/defaultJob
set runtimeStatus to Building
Build started, root directory: /godata/agent
--> ping
<-- acknowledge
--> reportCurrentStatus
ERROR: /godata/agent/pipelines/test is a directory
ERROR: /godata/agent/pipelines/test is a directory
ERROR: /godata/agent/pipelines/test/.git is a directory
ERROR: expected different with 'https://github.com/gocd-contrib/gocd-golang-agent'
ERROR: expected different with 'master'
ERROR: stat /godata/agent/pipelines/test/.git/shallow: no such file or directory
ERROR: /godata/agent/pipelines/test/.git is a directory
<-- acknowledge
ERROR: stat /godata/agent/pipelines/test/.git/shallow: no such file or directory
ERROR: stat /godata/agent/pipelines/test/.gitmodules: no such file or directory
ERROR: stat /godata/agent/pipelines/test/.gitmodules: no such file or directory
ERROR: stat /godata/agent/pipelines/test/.gitmodules: no such file or directory
--> reportCurrentStatus
<-- acknowledge
--> reportCompleting
<-- acknowledge
--> reportCurrentStatus
<-- acknowledge
build console closed
Build completed
done
set runtimeStatus to Idle
--> reportCompleted
<-- acknowledge
--> ping
<-- acknowledge

Server build log:

[go] Job Started: 2017-06-02 18:19:00 PDT
[go] Start to prepare test/19/defaultStage/1/defaultJob on da21151e139c [/godata/agent]
[go] Start to update materials 
[go] Start updating files at revision 61263063a9a975270aea5942cf233ab24898a508 from https://github.com/gocd-contrib/gocd-golang-agent
[GIT] Fetching changes
[GIT] Reset working directory pipelines/test
[GIT] Updating working copy to revision 61263063a9a975270aea5942cf233ab24898a508
[GIT] Cleaning all unversioned files in working copy
HEAD is now at 6126306 Merge pull request #45 from barrowkwan/master
[GIT] Cleaning all unversioned files in working copy
[go] Done.
[go] Start to build test/19/defaultStage/1/defaultJob on da21151e139c [/godata/agent]
setting environment variable 'GO_SERVER_URL' to value 'https://localhost:8154/go'
setting environment variable 'GO_TRIGGER_USER' to value 'anonymous'
setting environment variable 'GO_PIPELINE_NAME' to value 'test'
setting environment variable 'GO_PIPELINE_COUNTER' to value '19'
setting environment variable 'GO_PIPELINE_LABEL' to value '19'
setting environment variable 'GO_STAGE_NAME' to value 'defaultStage'
setting environment variable 'GO_STAGE_COUNTER' to value '1'
setting environment variable 'GO_JOB_NAME' to value 'defaultJob'
setting environment variable 'GO_REVISION' to value '61263063a9a975270aea5942cf233ab24898a508'
setting environment variable 'GO_TO_REVISION' to value '61263063a9a975270aea5942cf233ab24898a508'
setting environment variable 'GO_FROM_REVISION' to value '61263063a9a975270aea5942cf233ab24898a508'
[go] Current job status: passed
[go] Task: bash -c "echo hello"
hello
[go] Start to create properties test/19/defaultStage/1/defaultJob on da21151e139c [/godata/agent]
[go] Start to upload test/19/defaultStage/1/defaultJob on da21151e139c [/godata/agent]
[go] Job completed test/19/defaultStage/1/defaultJob on da21151e139c [/godata/agent]
server is still waiting for something then
Barrow Kwan
@barrowkwan
@tomzo are you using the latest code and add that flag?
Tomasz Sętkowski
@tomzo
yes, I just compiled that
Aravind SV
@arvindsv
What do you mean by: "server is still waiting for something then”? The job didn’t complete?
No, it is still yellow
Barrow Kwan
@barrowkwan
the agent log you show did show the job completed..
Aravind SV
@arvindsv
Ok, that’s a different problem. :) But, at least it goes ahead.
When I was trying it ...
… the previous crash left the build in a weird state.
The server was still waiting for it.
Did you try this change with a newly brought up server?
Container or otherwise.
Tomasz Sętkowski
@tomzo
I cancelled job, removed agents and restarted server. Then I registered agent and triggered a new job
Aravind SV
@arvindsv
Ok.
So, it is a problem.
Barrow Kwan
@barrowkwan
@arvindsv I still don’t get it why missing the supportsBuildCommandProtocol broke in docker but not the other. :confused:
Aravind SV
@arvindsv
For me it broke in both places. If I can reproduce it suceeding locally, I can find out why. But, looking at the code, it should fail always.
Of course, I know it works sometimes. :) Because it worked for you.
Tomasz Sętkowski
@tomzo
It is not just docker, it does not work locally with development server either
Barrow Kwan
@barrowkwan
:confused:
Tomasz Sętkowski
@tomzo
This kind of debugging reminds me of... https://twitter.com/_cancerian_/status/868521425182879744
Aravind SV
@arvindsv
:D
Barrow Kwan
@barrowkwan
:joy:
Barrow Kwan
@barrowkwan
@arvindsv do you think the issue is on GoCD server side or the agent?
Aravind SV
@arvindsv
@barrowkwan This one could be on the server side. Not very sure. I’ll need to try and reproduce it. I will, as soon as I can. Have you released 1.9 on to bintray with the supports build protocol flag fix?
Tomasz Sętkowski
@tomzo
I'll make a PR in a sec.
I tried to reproduce it, but locally it did not happen
Aravind SV
@arvindsv
Ok, thanks. I’m in whole-day meetings till Thursday. I might not find too much time early in this week - but I’ll try. Maybe tomorrow morning.
Oh, ok.
Tomasz Sętkowski
@tomzo
only with agent and server in alpine container
Aravind SV
@arvindsv
Oh, alright.
Well, that should be fine, if I can reproduce it.
Tomasz Sętkowski
@tomzo
@barrowkwan gocd-contrib/gocd-golang-agent#46 the fix for build protocol flag
arunnattarayan
@arunnattarayan
Hi anyone please tell me how to create a task which will execute sudo apt-get install ---- operation
Barrow Kwan
@barrowkwan
@/all Hi with GoCD 17.12 release, golang goagent will not be working because of few security fix. I am working on an update. If you need to use golang goagent, please don't upgrade your GoCD server , else you need to switch to the Java Go agent
Barrow Kwan
@barrowkwan
@/all Version 1.92 of goagent has been released! Grab it now from #bintray https://bintray.com/gocd-contrib/gocd_golang_goagent/goagent/1.92! This version is compatible with GoCD 17.12
Bashiirsinyore Osman
@bashiirsinyore_twitter
hi i am greatting all of you
tolajuwon
@tolajuwon
quick questions: 1. for windows agents, what user does the agent run as? 2. how do I configure GitHub authentication for the agent? I think i might have tried everything i can find.. not sure what im missing. but the agent wont pull from github.
The__se
@The__se_twitter
Hi. Is it possible to restrict an agent for jobs by resources:tags? In my current setup a job without a 'resources:tag' will scheduled on a random agent (of all agents). What i need is... a agent that runs only jobs with a sepacial 'resources:tag'. This agent has to ignore jobs without a 'resources:tag'.Is it possible to create a agent for this usecase? Thx
qinzl
@qinzl

Hi, I have the issues go-agent connect go-server retuern /go/agent-websocket 403 as ClusterA
it happen after go-server certificate update last week,
But I have tried below, but it still not work:

  1. rollbakc go-server keystore
  2. remove /var/lib/go-agent/agent-launcher.jar and /var/lib/go-agent/config/{agent.jks,guid.txt,token} to re-grenerate
  3. install a new vm with go-agent

I use the same scripts to install ClusterB go-server and go-agent, it work。
and I try to update ClusterB's agent to connect ClusterA' go-server it returen 403
But ClusterA's go-agent connect ClousterB's go-server success,
So I think the reason is in ClusterA go-server
Would you please help findout what happening in the server. thanks.