We're working on an upgrade from v19.7 to v21.3. For the upgrade, I've 
restored postgres and config backups into a whole new environment.
* Ran the db-migrator and upgraded from old to new db schema
* Purged some nodes from the cruise-config.xml (to get rid of all elastic 
configs, including all elastic and non-elastic agents), and changed other 
values to prevent conflict with "prod" instance.
* Installed latest "release" version (7.0.0-4) of the ECS Elastic Plugin 
and configured a new cluster

I then unpaused a single pipeline and assigned it the Elastic profile. The 
task gets created in ECS and I can see it running on the EC2 instance. This 
is where the trouble starts. At this point, the agent tries to 
"auto-register" with the server and is rejected

2021-11-09 02:23:30,499 ERROR [qtp1711838422-42] 
AgentRegistrationController:242 - Rejecting request for registration. 
Error: HttpCode=[422] Message=[Elastic agent registration requires an 
auto-register agent key to be setup on the server. The 
agentAutoRegisterKey: [89a52addc1b241c0be4c81e9fd2068cb] is either not 
provided or expired. Agent-id: [GoCD64cbbd28b581471386946cc75bc03ad2], 
Plugin-id: [com.thoughtworks.gocd.elastic-agent.ecs]] 
UUID=[78552c7b-e179-4713-8a96-4df9ba7845a0] 
Hostname=[727b6411a118]ElasticAgentID=[GoCD64cbbd28b581471386946cc75bc03ad2] 
PluginID=[com.thoughtworks.gocd.elastic-agent.ecs]

I've checked on the agentAutoRegisterKey and made sure that the value in 
the cruise-config.xml and the one being sent by the agent match. I've 
switched it over to new GUIDs several times (with and without dashes) and 
every time I get the same message logged on the server and a similar 
message on the elastic agent:

2021-11-09 02:24:25,694 ERROR [scheduler-1] SslInfrastructureService:173 - 
Error occurred during agent registration process: Elastic agent 
registration requires an auto-register agent key to be setup on the server. 
The agentAutoRegisterKey: [89a52addc1b241c0be4c81e9fd2068cb] is either not 
provided or expired. Agent-id: [GoCD64cbbd28b581471386946cc75bc03ad2], 
Plugin-id: [com.thoughtworks.gocd.elastic-agent.ecs]

There is an NGINX reverse proxy that sits in front of the server and is 
configured according 
to 
https://docs.gocd.org/21.3.0/installation/configure-reverse-proxy.html#agents-and-reverse-proxies.

The way it seems to me is that the 
agentAutoRegisterKey="89a52addc1b241c0be4c81e9fd2068cb 
key inside the server node in the XML is not being parsed properly as the 
server is unaware of this key having been set.

On a side note, I came across from discussions and (merged) PRs about using 
ephemeral EA autoregister keys, but wasn't able to find much in the way of 
documentation. Is this "ephemeral" autoregistration process implemented? Is 
the process documented anywhere?

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/d182055c-2d35-40ca-b492-dbdef9f47b30n%40googlegroups.com.

Reply via email to