vmware-tanzu / kubeapps

A web-based UI for deploying and managing applications in Kubernetes clusters
Other
4.92k stars 708 forks source link

Request failed with status code 502 #1164

Closed eravindar12 closed 4 years ago

eravindar12 commented 5 years ago

image

I am facing an issue with kubeapps, after i login seeing this error. Please advice.

FYI,..

Sorry! Something went wrong. Request failed with status code 502 Troubleshooting:

Check for network issues. Check your browser's JavaScript console for additional errors. Check the health of Kubeapps components helm status . Open an issue on GitHub if you think you've encountered a bug.

andresmgot commented 5 years ago

What's in your browser console? How did you deploy Kubeapps?

I have usually seen this issue when trying to access the service kubeapps-internal-dashboard instead of just kubeapps. Maybe that's your case?

andresmgot commented 4 years ago

@eravindar12 I am going to close this ticket due to inactivity. If you still find problems please let us know and reopen this issue.

camgab commented 4 years ago

I have the same problem every time I try to deploy an application for example in my case It was an Nginx Ingress that I want to deploy. kubeappss

andresmgot commented 4 years ago

Hello @camgab,

Can you let us know which version of Kubeapps you are running and how are you accessing the application (e.g. with an ingress or doing a port-forward)?

Also, can you let us know any additional info that you can get from the developer console? Like the error in the console or the request that is returning the 502.

camgab commented 4 years ago

Version of kubeapps is 1.6.0. Chart version of Nginx-ingress is 1.24.3 Im accessing the application with an ingress. I even didn't make any change in the YAML and have also errors. I have errors below in the console.

Failed to load resource: the server responded with a status of 401 ()

When I try to deploy it using command line , It Works. So...

andresmgot commented 4 years ago

Hi, I am still not sure how we can reproduce your issue. Can you send a screenshot of the browser console and the network tabs? (Also if you can include the URL you are using to access Kubeapps?) You can find that if you do secondary click -> Inspect in Chrome or Firefox.

When I try to deploy it using command line , It Works. So...

What's the difference between the deployments? How do you deploy it without using the command line?

ybabel commented 4 years ago

Same problem here. I'm new to kubernetes/helm. I have access to the dashboard but got a 502. I'm using microk8s on ubuntu server 18.04 On the dashboard I can see kubeapps deployed and running.

helm list --namespace kubeapps NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION kubeapps kubeapps 1 2019-12-02 20:51:54.683604797 +0000 UTC deployed kubeapps-3.1.0 v1.7.1

I access to it on the browser after kubectl port-forward --address 0.0.0.0 --namespace kubeapps kubeapps-7c65cdb8fb-78vlf 8080:8080

I got : helm status --namespace kubeapps kubeapps NAME: kubeapps LAST DEPLOYED: Mon Dec 2 20:51:54 2019 NAMESPACE: kubeapps STATUS: deployed REVISION: 1 and : microk8s.status microk8s is running addons: cilium: disabled dashboard: enabled dns: enabled fluentd: disabled gpu: disabled helm: disabled ingress: disabled istio: disabled jaeger: disabled juju: disabled knative: disabled kubeflow: disabled linkerd: disabled metallb: disabled metrics-server: disabled prometheus: disabled rbac: disabled registry: disabled storage: enabled

Do I have to enable some more modules ?

andresmgot commented 4 years ago

Hi @ybabel,

It seems that something in your cluster is not healthy. What's the output of executing kubectl get po -n kubeapps? Are all the pods running?

Also, can you send a screenshot of your browser console? The "Network" tab should show more info of the error. You can open that view doing right-click -> Inspect -> Network and reloading the page.

ybabel commented 4 years ago

Hello @andresmgot,

thank you for help.

Here is my pods :

kubectl get po -n kubeapps
NAME                                                          READY   STATUS             RESTARTS   AGE
apprepo-sync-bitnami-1575364200-dmmlc                         0/1     Completed          3          163m
apprepo-sync-bitnami-1575373800-b797q                         0/1     Error              0          3m37s
apprepo-sync-bitnami-8rzl9-cv7vn                              0/1     Completed          0          164m
apprepo-sync-bitnami-gkb5z-grfwr                              0/1     Error              0          4m13s
apprepo-sync-incubator-1575364200-skw7s                       0/1     Completed          0          163m
apprepo-sync-incubator-1575373800-2sjz5                       1/1     Running            0          3m32s
apprepo-sync-incubator-4mlft-nqlf6                            0/1     Completed          0          164m
apprepo-sync-incubator-8mqdn-2m699                            1/1     Running            1          4m14s
apprepo-sync-stable-1575373800-v7fgm                          1/1     Running            0          3m21s
apprepo-sync-stable-dvf57-dxm22                               1/1     Terminating        6          164m
apprepo-sync-stable-sgjbt-jh5kx                               0/1     Error              1          4m14s
apprepo-sync-svc-cat-1575364200-9jp7q                         0/1     Completed          0          163m
apprepo-sync-svc-cat-1575373800-44p97                         1/1     Running            0          3m
apprepo-sync-svc-cat-sf6cd-hdw2j                              1/1     Running            1          4m14s
apprepo-sync-svc-cat-snc4r-dtmpl                              0/1     Completed          0          164m
kubeapps-7c65cdb8fb-cb4vs                                     1/1     Running            2          173m
kubeapps-7c65cdb8fb-p2w64                                     1/1     Running            2          173m
kubeapps-internal-apprepository-controller-7955bfbf4d-tdf85   1/1     Running            1          173m
kubeapps-internal-chartsvc-58ff7bfbff-b4mvh                   0/1     CrashLoopBackOff   2          173m
kubeapps-internal-chartsvc-58ff7bfbff-cjjch                   0/1     Running            2          173m
kubeapps-internal-dashboard-59f9557d78-gw9gx                  1/1     Running            1          173m
kubeapps-internal-dashboard-59f9557d78-zzrgc                  1/1     Running            1          173m
kubeapps-internal-tiller-proxy-66bbfc9df8-d24n8               0/1     CrashLoopBackOff   9          173m
kubeapps-internal-tiller-proxy-66bbfc9df8-n66j9               0/1     CrashLoopBackOff   8          173m
kubeapps-mongodb-f54965b7-7zfv2                               1/1     Running            2          173m

I noticed many of them seem's to be duplicated, but I don't know if its normal or not. On my network tab, everything is 200 except a 502 at http://192.168.0.37:8080/api/tiller-deploy/v1/namespaces/default/releases

and "internal tiler proxy" if 0/1 CrashLoopBackOff : I suppose that is my problem ... But I have no idea how to fix it.

Sorry but after a while I got :

kubectl get po -n kubeapps
NAME                                                          READY   STATUS             RESTARTS   AGE
apprepo-sync-bitnami-1575364200-dmmlc                         0/1     Completed          3          172m
apprepo-sync-bitnami-1575373800-b797q                         0/1     Completed          2          11m
apprepo-sync-bitnami-1575374400-mgz4r                         0/1     Completed          0          2m2s
apprepo-sync-bitnami-8rzl9-cv7vn                              0/1     Completed          0          173m
apprepo-sync-bitnami-gkb5z-grfwr                              0/1     Completed          2          12m
apprepo-sync-incubator-1575364200-skw7s                       0/1     Completed          0          171m
apprepo-sync-incubator-1575373800-2sjz5                       0/1     Completed          1          11m
apprepo-sync-incubator-1575374400-gj48f                       0/1     Completed          0          2m1s
apprepo-sync-incubator-4mlft-nqlf6                            0/1     Completed          0          173m
apprepo-sync-incubator-8mqdn-2m699                            0/1     Completed          2          12m
apprepo-sync-stable-1575373800-v7fgm                          0/1     Completed          2          11m
apprepo-sync-stable-1575374400-b8pjz                          0/1     Completed          0          2m
apprepo-sync-stable-sgjbt-jh5kx                               0/1     Completed          2          12m
apprepo-sync-svc-cat-1575364200-9jp7q                         0/1     Completed          0          171m
apprepo-sync-svc-cat-1575373800-44p97                         0/1     Completed          1          11m
apprepo-sync-svc-cat-1575374400-bk64z                         0/1     Completed          0          119s
apprepo-sync-svc-cat-sf6cd-hdw2j                              0/1     Completed          2          12m
apprepo-sync-svc-cat-snc4r-dtmpl                              0/1     Completed          0          173m
kubeapps-7c65cdb8fb-cb4vs                                     1/1     Running            2          3h1m
kubeapps-7c65cdb8fb-p2w64                                     1/1     Running            2          3h1m
kubeapps-internal-apprepository-controller-7955bfbf4d-tdf85   1/1     Running            1          3h1m
kubeapps-internal-chartsvc-58ff7bfbff-b4mvh                   1/1     Running            3          3h1m
kubeapps-internal-chartsvc-58ff7bfbff-cjjch                   1/1     Running            3          3h1m
kubeapps-internal-dashboard-59f9557d78-gw9gx                  1/1     Running            1          3h1m
kubeapps-internal-dashboard-59f9557d78-zzrgc                  1/1     Running            1          3h1m
kubeapps-internal-tiller-proxy-66bbfc9df8-d24n8               0/1     CrashLoopBackOff   13         3h1m
kubeapps-internal-tiller-proxy-66bbfc9df8-n66j9               0/1     CrashLoopBackOff   12         3h1m
kubeapps-mongodb-f54965b7-7zfv2                               1/1     Running            2          3h1m
ybabel commented 4 years ago

I got :

kubectl logs -n kubeapps kubeapps-internal-tiller-proxy-66bbfc9df8-n66j9
time="2019-12-03T12:04:34Z" level=info msg="Using tiller host: tiller-deploy.kube-system:44134"
time="2019-12-03T12:04:39Z" level=fatal msg="Unable to connect to Tiller: context deadline exceeded"

but I don't have a "tiller" in kube-system

get po -n kube-system
NAME                                              READY   STATUS    RESTARTS   AGE
coredns-9b8997588-d9ggq                           1/1     Running   1          3h19m
dashboard-metrics-scraper-687667bb6c-99q2v        1/1     Running   1          3h19m
heapster-v1.5.2-5c58f64f8b-9bfcf                  4/4     Running   4          3h19m
hostpath-provisioner-7b9cb5cdb4-r8zp8             1/1     Running   1          3h19m
kubernetes-dashboard-5c848cc544-l8sjw             1/1     Running   1          3h19m
monitoring-influxdb-grafana-v4-6d599df6bf-msqq7   2/2     Running   2          3h19m
ybabel commented 4 years ago

I have found at https://github.com/kubeapps/kubeapps/issues/916#issuecomment-452153041 and https://github.com/kubeapps/kubeapps/blob/master/chart/kubeapps/README.md Do I have to

helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set tillerProxy.host=tiller-deploy.192.168.0.37:44134 ?

I tried : helm upgrade kubeapps --namespace kubeapps bitnami/kubeapps --set tillerProxy.host=tiller-deploy.192.168.0.37:44134

but

kubectl logs -n kubeapps kubeapps-internal-tiller-proxy-55c6b8c998-4j8kj
time="2019-12-03T12:29:56Z" level=info msg="Using tiller host: tiller-deploy.192.168.0.37:44134"
time="2019-12-03T12:30:01Z" level=fatal msg="Unable to connect to Tiller: context deadline exceeded"
andresmgot commented 4 years ago

Indeed, if you have tiller running in a different namespace you need to change the host setting in order to point to the URL in which tiller is running. You just need to modify the namespace part with the real namespace:

--set tillerProxy.host=tiller-deploy.YOUR_TILLER_NAMESPACE:44134
ybabel commented 4 years ago

Yes, but the problem is that I did not had tiller running. I checked why and managed to correct it by enabling "helm" module in microk8s (which came with tiller pre-installed). The first time I installed it I did not notice there was an helm module and installed it manually. I suppose another solution would have been to install tiller with helm in kube-system ... I did manage to get kuppeapps working. The GUI is great. huge choice of pre-packaged applications. But it needs a fairly decent server. Thanks.

mucahitkumlay commented 4 years ago

@ybabel can you tell me ? how did you that? how to you solved problem?

ybabel commented 4 years ago

@mucahitkmlay in my case, I had to enable helm microk8s's module. That's all. sudo microk8s.enable helm