gocd / kubernetes-elastic-agents

Kubernetes Elastic agent plugin for GoCD
https://www.gocd.org
Apache License 2.0
34 stars 32 forks source link

After the gocd db data is migrated, the following error message is displayed: #320

Closed peter-zxh closed 1 year ago

peter-zxh commented 2 years ago

Perform data backup as described in admin backup, and migrate the data to the new gocd environment. Click plugin-cd.go.contrib.elasticagent.kubernetes The following error is reported in the log file. It is found that the cruise.h2.db database using the new gocd is normal, but there will be problems using the migrated cruise.h2.db file. Please help me

The log is as follows, please help analyze: 2022-11-23 03:15:09,988 ERROR [101@MessageListener for WorkFinder] KubernetesPlugin:127 - Failed to handle request cd.go.elastic-agent.should-assign-work io.fabric8.kubernetes.client.KubernetesClientException: Operation: [list] for kind: [Pod] with name: [null] in namespace: [A namespace name] failed. [...] com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:303) [....] Caused by: java.net.SocketTimeoutException: connect timed out

chadlwilson commented 2 years ago

Please supply more information, e.g

This doesn't sound related to database change, but may relate to the upgrade you performed or just your new environment. This indicates the plugin cannot talk to your cluster's API server. Try comparing the config for the cluster profile before and after to check the cluster URL/token/cluster CA cert is correct for the new environment. If you are trying to load the config in a new cluster, you will need to correct the configuration for the new cluster in your elastic agents configuration at the very least.

peter-zxh commented 2 years ago
  1. The gocd image and plug-in version after migration are consistent with those before migration (gocd==19.5.0, plug-in version==3.0.0-156)
  2. I found that the problem was not cluster URL/token/cluster CA certificate, because the plug-in can call the cluster api to create the pod of go agent
  3. What places do you need to configure to load the configuration in the new cluster? I have configured the k8s cluster profile and Elastic Agent Profiles under the administrative profiles of GOCD. Is there anything else you need to configure?
chadlwilson commented 2 years ago

The error above says 'connect timed out' which would indicate a connectivity issue calling the API server so I don't understand what problem you are having if you say it can create pods successfully.

chadlwilson commented 2 years ago

Other than that what is different about your new clusterr to the old cluster? Which k8s version? These are very old versions you are dealing with. No guarantees they work on new k8s and docker.

chadlwilson commented 1 year ago

Closing this for now - if you can supply additional info we can re-open it.