uselagoon / lagoon

Lagoon, the developer-focused application delivery platform
https://docs.lagoon.sh/
Apache License 2.0
557 stars 148 forks source link

Error on make tests #369

Closed JeffVeit closed 6 years ago

JeffVeit commented 6 years ago

I get this error on make tests (or pretty much anything else I try)

Using project "lagoon". Error response from daemon: Get https://192.168.99.100:30000/v2/: dial tcp 192.168.99.100:30000: getsockopt: connection refused Makefile:605: recipe for target 'minishift/login-docker-registry' failed make[1]: [minishift/login-docker-registry] Error 1 make[1]: Leaving directory '/home/jeff/projects/lagoon-learning/lagoon' Makefile:581: recipe for target 'minishift' failed make: [minishift] Error 2

The full output from make tests:

starting minishift with name lagoon ./local-dev/minishift/minishift --profile lagoon start --cpus 6 --memory 2GB --disk-size 30GB --vm-driver virtualbox --openshift-version="v3.7.2" -- Starting profile 'lagoon' -- Checking if requested OpenShift version 'v3.7.2' is valid ... OK -- Checking if requested OpenShift version 'v3.7.2' is supported ... OK -- Checking if requested hypervisor 'virtualbox' is supported on this platform ... OK -- Checking if VirtualBox is installed ... OK -- Checking the ISO URL ... OK -- Checking if provided oc flags are supported ... OK -- Starting local OpenShift cluster using 'virtualbox' hypervisor ... -- Minishift VM will be configured with ... Memory: 2 GB vCPUs : 6 Disk size: 30 GB -- Starting Minishift VM ........................... OK -- Checking for IP address ... OK -- Checking for nameservers ... OK -- Checking if external host is reachable from the Minishift VM ... Pinging 8.8.8.8 ... OK -- Checking HTTP connectivity from the VM ... Retrieving http://minishift.io/index.html ... OK -- Checking if persistent storage volume is mounted ... OK -- Checking available disk space ... 0% used OK Importing 'openshift/origin:v3.7.2' ............ OK Importing 'openshift/origin-docker-registry:v3.7.2' ... OK Importing 'openshift/origin-haproxy-router:v3.7.2' ... OK -- OpenShift cluster will be configured with ... Version: v3.7.2 Starting OpenShift using openshift/origin:v3.7.2 ... OpenShift server started.

The server is accessible via web console at: https://192.168.99.100:8443

You are logged in as: User: developer Password:

To login as administrator: oc login -u system:admin

replacing IP in local-dev/api-data/api-data.gql and docker-compose.yaml with the IP '192.168.99.100' eval $(./local-dev/minishift/minishift --profile lagoon oc-env); \ oc login -u system:admin; \ bash -c "echo '{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"docker-registry-external\"},\"spec\":{\"ports\":[{\"port\":5000,\"protocol\":\"TCP\",\"targetPort\":5000,\"nodePort\":30000}],\"selector\":{\"docker-registry\":\"default\"},\"sessionAffinity\":\"None\",\"type\":\"NodePort\"}}' | oc --context="default/$(./local-dev/minishift/minishift --profile lagoon ip | sed 's/./-/g'):8443/system:admin" create -n default -f -"; \ oc --context="default/$(./local-dev/minishift/minishift --profile lagoon ip | sed 's/./-/g'):8443/system:admin" adm policy add-cluster-role-to-user cluster-admin system:anonymous; \ oc --context="default/$(./local-dev/minishift/minishift --profile lagoon ip | sed 's/./-/g'):8443/system:admin" adm policy add-cluster-role-to-user cluster-admin developer; Logged into "https://192.168.99.100:8443" as "system:admin" using existing credentials.

You have access to the following projects and can switch between them with 'oc project ':

default
kube-public
kube-system
  • myproject openshift openshift-infra openshift-node

Using project "myproject". service "docker-registry-external" created cluster role "cluster-admin" added: "system:anonymous" cluster role "cluster-admin" added: "developer" wait 60secs in order to give openshift time to setup it's registry sleep 60 eval $(./local-dev/minishift/minishift --profile lagoon oc-env); \ for i in {10..30}; do oc --context="default/$(./local-dev/minishift/minishift --profile lagoon ip | sed 's/./-/g'):8443/system:admin" patch pv pv00${i} -p '{"spec":{"storageClassName":"bulk"}}'; done; persistentvolume "pv0010" patched persistentvolume "pv0011" patched persistentvolume "pv0012" patched persistentvolume "pv0013" patched persistentvolume "pv0014" patched persistentvolume "pv0015" patched persistentvolume "pv0016" patched persistentvolume "pv0017" patched persistentvolume "pv0018" patched persistentvolume "pv0019" patched persistentvolume "pv0020" patched persistentvolume "pv0021" patched persistentvolume "pv0022" patched persistentvolume "pv0023" patched persistentvolume "pv0024" patched persistentvolume "pv0025" patched persistentvolume "pv0026" patched persistentvolume "pv0027" patched persistentvolume "pv0028" patched persistentvolume "pv0029" patched persistentvolume "pv0030" patched make minishift/configure-lagoon-local push-docker-host-image make[1]: Entering directory '/home/jeff/projects/lagoon-learning/lagoon' if ! which oc; then eval $(./local-dev/minishift/minishift --profile lagoon oc-env); fi; \ oc new-project lagoon; \ oc adm pod-network make-projects-global lagoon; \ oc -n lagoon create serviceaccount openshiftbuilddeploy; \ oc -n lagoon create -f openshift-setup/clusterrole-openshiftbuilddeploy.yaml; \ oc -n lagoon adm policy add-cluster-role-to-user openshiftbuilddeploy -z openshiftbuilddeploy; \ oc -n lagoon create -f openshift-setup/shared-resource-viewer.yaml; \ oc -n lagoon create -f openshift-setup/policybinding.yaml | oc -n lagoon create -f openshift-setup/rolebinding.yaml; \ oc -n lagoon create serviceaccount docker-host; \ oc -n lagoon adm policy add-scc-to-user privileged -z docker-host; \ oc -n lagoon policy add-role-to-user edit -z docker-host; \ oc -n lagoon create serviceaccount cronjob; \ oc -n lagoon policy add-role-to-user edit -z cronjob; \ bash -c "oc process -n lagoon -f openshift-setup/docker-host.yaml | oc -n lagoon apply -f -"; \ bash -c "oc process -n lagoon -f openshift-setup/docker-host-cronjobs.yaml | oc -n lagoon apply -f -"; \ echo -e "\n\nAll Setup, use this token as described in the Lagoon Install Documentation:" \ oc -n lagoon serviceaccounts get-token openshiftbuilddeploy /home/jeff/.local/bin/oc Now using project "lagoon" on server "https://192.168.99.100:8443".

You can add applications to this project with the 'new-app' command. For example, try:

oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git

to build a new example application in Ruby. error: managing pod network is only supported for openshift multitenant network plugin See 'oc adm pod-network make-projects-global -h' for help and examples. serviceaccount "openshiftbuilddeploy" created clusterrole "openshiftbuilddeploy" created cluster role "openshiftbuilddeploy" added: "openshiftbuilddeploy" role "shared-resource-viewer" created rolebinding "shared-resource-viewers" created error: unable to recognize "openshift-setup/policybinding.yaml": no matches for /, Kind=PolicyBinding serviceaccount "docker-host" created scc "privileged" added to: ["system:serviceaccount:lagoon:docker-host"] role "edit" added: "docker-host" serviceaccount "cronjob" created role "edit" added: "cronjob" deploymentconfig "docker-host" created service "docker-host" created cronjob "cronjob-update-push-images" created cronjob "cronjob-prune-images" created

All Setup, use this token as described in the Lagoon Install Documentation: oc -n lagoon serviceaccounts get-token openshiftbuilddeploy eval $(./local-dev/minishift/minishift --profile lagoon oc-env); \ bash -c "oc process -n lagoon -p IMAGE=docker-registry.default.svc:5000/lagoon/docker-host:latest -p REPOSITORY_TO_UPDATE=lagoon -f openshift-setup/docker-host-minishift.yaml | oc -n lagoon apply -f -"; \ bash -c "oc process -n lagoon -p IMAGE=docker-registry.default.svc:5000/lagoon/docker-host:latest -p REPOSITORY_TO_UPDATE=lagoon -f openshift-setup/docker-host-cronjobs.yaml | oc -n lagoon apply -f -"; deploymentconfig "docker-host" configured service "docker-host" configured cronjob "cronjob-update-push-images" configured cronjob "cronjob-prune-images" configured eval $(./local-dev/minishift/minishift --profile lagoon oc-env); \ oc login --insecure-skip-tls-verify -u developer -p developer $(cat minishift):8443; \ oc whoami -t | docker login --username developer --password-stdin $(cat minishift):30000 Login successful.

You have access to the following projects and can switch between them with 'oc project ':

default
kube-public
kube-system
  • lagoon myproject openshift openshift-infra openshift-node

Using project "lagoon". Error response from daemon: Get https://192.168.99.100:30000/v2/: dial tcp 192.168.99.100:30000: getsockopt: connection refused Makefile:605: recipe for target 'minishift/login-docker-registry' failed make[1]: [minishift/login-docker-registry] Error 1 make[1]: Leaving directory '/home/jeff/projects/lagoon-learning/lagoon' Makefile:581: recipe for target 'minishift' failed make: [minishift] Error 2

The output of browsing to https://192.168.99.100:30000/v2/:

This site can’t provide a secure connection 192.168.99.100 sent an invalid response. ERR_SSL_PROTOCOL_ERROR

The output of curl -v https://192.168.99.100:30000/v2/:

  • Trying 192.168.99.100...
  • Connected to 192.168.99.100 (192.168.99.100) port 30000 (#0)
  • found 148 certificates in /etc/ssl/certs/ca-certificates.crt
  • found 610 certificates in /etc/ssl/certs
  • ALPN, offering http/1.1
  • gnutls_handshake() failed: An unexpected TLS packet was received.
  • Closing connection 0 curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received.

The output of curl -v http://192.168.99.100:30000/v2/:

  • Trying 192.168.99.100...
  • Connected to 192.168.99.100 (192.168.99.100) port 30000 (#0)

    GET /v2/ HTTP/1.1 Host: 192.168.99.100:30000 User-Agent: curl/7.47.0 Accept: /

    < HTTP/1.1 401 Unauthorized < Content-Type: application/json; charset=utf-8 < Docker-Distribution-Api-Version: registry/2.0 < Www-Authenticate: Bearer realm="http://192.168.99.100:30000/openshift/token" < X-Registry-Supports-Signatures: 1 < Date: Thu, 26 Apr 2018 12:59:29 GMT < Content-Length: 87 < {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

  • Connection #0 to host 192.168.99.100 left intact

Ideas?

Thank you.

rtprio commented 6 years ago

Most of that looks ok; what happens when you run make tests?

Does this happen every time? you can redo minishift with make minishift/clean and restart the process; with make minishift && make tests

JeffVeit commented 6 years ago

The stuff above is what happens on make tests. The error I gave at the top.

Yes, it happens every time. Even if I make minishift/clean.

I'm guessing you mean make build && make tests. Yes, even then.

It looks to me like a TLS problem. But I've no idea why that should happen.

Just to be absolutely certain it wasn't as a result of an old image I deleted all the images, and tried again. Same result.

rtprio commented 6 years ago

The local docker registry doesn't have ssl, which sort of explains the protocol errors. Did you add 192.168.99.0/24 to the insecure registry list in docker?

JeffVeit commented 6 years ago

Yes! That was my mistake. Thank you.

It's gotten me past that error, only to encounter another, but that's a different issue.