siamaksade / openshift-jenkins-demo

CI/CD Demo on OpenShift
http://www.openshift.com
530 stars 928 forks source link

ERROR: Failed to create Gogs admin #76

Open ppalaga opened 6 years ago

ppalaga commented 6 years ago
$ minishift version
minishift v1.13.1+75352e5
$ oc login -u system:admin
$ cd scripts
$ ./provision.sh deploy --user developer

The provision.sh script finishes successfully, but the init pot fails when creating the gogs user:

replication controller "gogs-1" successfully rolled out
++ curl -o /tmp/curl.log -sL --post302 -w '%{http_code}' http://172.30.96.22:3000/user/sign_up  --form user_name=gogs --form password=gogs --form retype=gogs --form email=admin@gogs.com
+ _RETURN=404
+ sleep 5
+ '[' 404 '!=' 200 ']'
+ '[' 404 '!=' 302 ']'
+ echo 'ERROR: Failed to create Gogs admin'
+ cat /tmp/curl.log
ERROR: Failed to create Gogs admin

Full init pod log: cicd-demo-installer-xskl2.log

mipam007 commented 6 years ago

Hi All,

Same on my side. With fresh clone from today, and reserved 12G of RAM for minishift I've got working CI-CD pipeline, but with this error on installer POD, which I do not understand:

mipam@sangha ~/Documents/Pracovní/GitRepos/openshift-cd-demo/scripts $ oc get pods --all-namespaces
NAMESPACE        NAME                            READY     STATUS      RESTARTS   AGE
cicd-developer   cicd-demo-installer-v8rn7       0/1       Error       0          48m
cicd-developer   gogs-1-rvzct                    1/1       Running     0          42m
cicd-developer   gogs-postgresql-1-rvr9m         1/1       Running     0          42m
cicd-developer   jenkins-3-tsl2x                 1/1       Running     0          42m
cicd-developer   nexus-1-57z76                   1/1       Running     0          41m
cicd-developer   sonarqube-1-xc7ws               1/1       Running     0          41m
default          docker-registry-1-7gd86         1/1       Running     0          1h
default          persistent-volume-setup-sg2fr   0/1       Completed   0          1h
default          router-1-kwgkb                  1/1       Running     0          1h

and logs from this error POD

replication controller "gogs-1" successfully rolled out
++ curl -o /tmp/curl.log -sL --post302 -w '%{http_code}' http://172.30.110.93:3000/user/sign_up --form user_name=gogs --form password=gogs --form retype=gogs --form email=admin@gogs.com
+ _RETURN=404
+ sleep 5
+ '[' 404 '!=' 200 ']'
+ '[' 404 '!=' 302 ']'
+ echo 'ERROR: Failed to create Gogs admin'
+ cat /tmp/curl.log
ERROR: Failed to create Gogs admin`

Full logs attached. cicd-demo-installer-v8rn7.txt

Can you guys kick me to right place, why this POD is not able to inject admin user into the Gogs?

ppalaga commented 6 years ago

For some reason, the creation of gogs admin does not succeed immediatelly. I was able to work around this by re-attempting:

  # add gogs admin
  for i in {1..10}
  do
    sleep 5
    _RETURN=$(curl -o /dev/null -sL --post302 -w "%{http_code}" http://$GOGS_ROUTE/user/sign_up \
      --form user_name=gogs \
      --form password=gogs \
      --form retype=gogs \
      --form email=admin@gogs.com)
    if [ "200" == "$_RETURN" ]
    then
      break
    fi
  done
dmc5179 commented 4 years ago

I was able to solve the issue in my cluster using something similar to what @ppalaga added. I've created a PR for it here:

https://github.com/siamaksade/openshift-cd-demo/pull/135