<p>I install GoCD using helm in Kubernetes and found that pod status is CrashLoopBackOff. I am using minikube with hyper-v in Windows 10 Pro. What's the problem? How can I find error root? Where can I find definition for exit code 111?</p>

<p>Here's my kubectl describe pod  info:</p>

<pre><code>Name:               gocd-app-server-7fd8f8b48d-r6sn9
Namespace:          gocd
Priority:           0
PriorityClassName:  &lt;none&gt;
Node:               minikube/192.168.88.82
Start Time:         Thu, 21 Feb 2019 15:57:15 +0700
Labels:             app=gocd
                    component=server
                    pod-template-hash=7fd8f8b48d
                    release=gocd-app
Annotations:        &lt;none&gt;
Status:             Running
IP:                 172.17.0.16
Controlled By:      ReplicaSet/gocd-app-server-7fd8f8b48d
Containers:
  gocd-server:
    Container ID:   docker://907271ebbe383b533ef1eb892021eaabc4cf6264a7052e2e453fcf97fdb28de7
    Image:          gocd/gocd-server:v19.1.0
    Image ID:       docker-pullable://gocd/gocd-server@sha256:34204533eb0e0c6f7544c6aa29f2da815d972bd22124b32307ca4ca8f40abd61
    Ports:          8153/TCP, 8154/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    111
      Started:      Fri, 22 Feb 2019 09:55:42 +0700
      Finished:     Fri, 22 Feb 2019 09:55:43 +0700
    Ready:          False
    Restart Count:  4
    Liveness:       http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
    Readiness:      http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
    Environment:
      GOCD_PLUGIN_INSTALL_kubernetes-elastic-agents:        https://github.com/gocd/kubernetes-elastic-agents/releases/download/2.1.0-123/kubernetes-elastic-agent-2.1.0-123.jar
      GOCD_PLUGIN_INSTALL_docker-registry-artifact-plugin:  https://github.com/gocd/docker-registry-artifact-plugin/releases/download/1.0.0-25/docker-registry-artifact-plugin-1.0.0-25.jar
    Mounts:
      /docker-entrypoint.d from goserver-vol (rw)
      /godata from goserver-vol (rw)
      /home/go from goserver-vol (rw)
      /preconfigure_server.sh from config-vol (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from gocd-app-token-kbdjx (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  config-vol:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      gocd-app
    Optional:  false
  goserver-vol:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  gocd-app-server
    ReadOnly:   false
  gocd-app-token-kbdjx:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gocd-app-token-kbdjx
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          &lt;none&gt;
</code></pre>

<p>I also checked nodes condition using kubectl describe nodes, here's the result</p>

<pre><code>Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Fri, 22 Feb 2019 10:25:48 +0700   Thu, 14 Feb 2019 18:16:55 +0700   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Fri, 22 Feb 2019 10:25:48 +0700   Thu, 14 Feb 2019 18:16:55 +0700   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Fri, 22 Feb 2019 10:25:48 +0700   Thu, 14 Feb 2019 18:16:55 +0700   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            True    Fri, 22 Feb 2019 10:25:48 +0700   Thu, 21 Feb 2019 13:22:10 +0700   KubeletReady                 kubelet is posting ready status
</code></pre>

<p>Nodes condition seems to be alright.</p>

<p>Thank you for your assistance.</p>

roscoe_x
<p>Try to check preconfigure logs while pods still running:</p>

<pre><code>kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat  /godata/logs/preconfigure.log
kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat  /godata/logs/preconfigure_complete.log
</code></pre>

<p>I had some error in end, different code but, it could helps to find your issue:</p>

<pre><code>checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
HTTP/1.1 200 OK
Date: Sat, 09 Mar 2019 14:59:05 GMT
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: chrome=1
Set-Cookie: JSESSIONID=node01oiy3yzw700oc1kq79gazxg27m1.node0;Path=/go;Expires=Sat, 23-Mar-2019 14:59:05 GMT;Max-Age=1209600;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/vnd.go.cd.v1+json;charset=utf-8
ETag: "f710a37eb9543dcd53aa78be26c62ae6"
X-Runtime: 1248
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked

{
  "_links" : {
    "self" : {
      "href" : "http://localhost:8153/go/api/elastic/profiles/demo-app"
    },
    "doc" : {
      "href" : "https://api.gocd.org/19.2.0/#elastic-agent-profiles"
    },
    "find" : {
      "href" : "http://localhost:8153/go/api/elastic/profiles/:profile_id"
    }
  },
  "id" : "demo-app",
  "plugin_id" : "cd.go.contrib.elasticagent.kubernetes",
  "properties" : [ {
    "key" : "Image",
    "value" : "gocd/gocd-agent-docker-dind:v19.2.0"
  }, {
    "key" : "PodConfiguration",
    "value" : "apiVersion: v1\nkind: Pod\nmetadata:\n  name: pod-name-prefix-{{ POD_POSTFIX }}\n  labels:\n    app: web\nspec:\n  serviceAccountName: default\n  containers:\n    - name: gocd-agent-container-{{ CONTAINER_POSTFIX }}\n      image: gocd/gocd-agent-docker-dind:v19.2.0\n      securityContext:\n        privileged: true"
  }, {
    "key" : "SpecifiedUsingPodConfiguration",
    "value" : "true"
  }, {
    "key" : "Privileged",
    "value" : "true"
  } ]
}Trying to configure plugin settings.
HTTP/1.1 100 Continue

checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
/ # command terminated with exit code 137
</code></pre>

<p>also there some other logs files which could help you to define it:</p>

<pre><code>/ # ls -l /godata/logs/
total 212
-rw-r--r--    1 go       go               0 Mar  9 14:53 go-server-perf.log
-rw-r--r--    1 go       go          105813 Mar  9 15:10 go-server.log
-rw-r--r--    1 go       go               0 Mar  9 14:53 go-shine.log
-rw-r--r--    1 go       go           26788 Mar  9 15:09 plugin-cd.go.artifact.docker.registry.log
-rw-r--r--    1 go       go            1482 Mar  9 15:09 plugin-cd.go.authentication.ldap.log
-rw-r--r--    1 go       go            1626 Mar  9 15:09 plugin-cd.go.authentication.passwordfile.log
-rw-r--r--    1 go       go           58970 Mar  9 15:09 plugin-cd.go.contrib.elasticagent.kubernetes.log
</code></pre>

<p>in my case there were error in <code>plugin-cd.go.contrib.elasticagent.kubernetes.log</code></p>

<p>But also you can disable preconfigure in values.yaml</p>

<pre><code>server:
  shouldPreconfigure: false
</code></pre>

<p>and redeploy it with </p>

<pre><code>helm delete --purge gocd-app
helm install stable/gocd --name gocd-app --namespace gocd -f path/to/values.yaml
</code></pre>

<p>values.yaml for chart you can get there <a href="https://raw.githubusercontent.com/helm/charts/master/stable/gocd/values.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/helm/charts/master/stable/gocd/values.yaml</a></p>
