Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown error (200): Http failure during parsing for https://<site>/api/v1/csrftoken/login #8829

Closed
noelashford opened this issue Mar 24, 2024 · 17 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@noelashford
Copy link

noelashford commented Mar 24, 2024

What happened?

I use an ingress controller to access the dashboard and even thought the backend and frontend are https, it seems to think there is an HTTP parsing issue somewhere ? <site. is obfuscation for the actual site.

What did you expect to happen?

I should be able to browse the dashboard.

How can we reproduce it (as minimally and precisely as possible)?

Create a backend https ingress w front end HTTPS as well, you will see this: Unknown error (200): Http failure during parsing for https://<site>/api/v1/csrftoken/login

Anything else we need to know?

The ingress is as follows:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    cert-manager.io/cluster-issuer: letsencrypt-production
  generation: 1
  name: dashboard
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: <site>
    http:
      paths:
      - backend:
          service:
            name: kubernetes-dashboard-kong-proxy
            port:
              number: 443
        path: /
        pathType: Prefix
  tls:
    - hosts:
      - <site>
      secretName: k8s-dashboard

What browsers are you seeing the problem on?

Chrome

Kubernetes Dashboard version

current

Kubernetes version

Client Version: v1.25.0 Kustomize Version: v4.5.7 Server Version: v1.23.3

Dev environment

No response

@noelashford noelashford added the kind/bug Categorizes issue or PR as related to a bug. label Mar 24, 2024
@TheoMorkel
Copy link

Is there any update on this issue? I am experiencing it as well.

@floreks
Copy link
Member

floreks commented Mar 28, 2024

That does not look like an issue on our side. Most likely it's a configuration issue on your side.

@floreks floreks added kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels Mar 28, 2024
@noelashford
Copy link
Author

noelashford commented Mar 28, 2024 via email

@floreks
Copy link
Member

floreks commented Mar 28, 2024

You could try checking for logs in auth pod. Right now I am unsure how it could originate on our side.

@garymm
Copy link

garymm commented Apr 1, 2024

I'm seeing this also.

@noelashford which version worked for you?

I tried both 7.1.3 and 6.0.8 and seeing the same issue. Connecting via kubectl port-forward works fine. So I think maybe it has something to do with the hostname?

@tynianov1
Copy link

tynianov1 commented Apr 4, 2024

I had the same issue. Do we have any updates here? Thanks

P.S. logs for all related pods (dashboard, API, auth, metrics-scraper, kong) look good to me and I don't see any suspicious lines. Additionaly, when I try to send request to the https://{domain_name}/api/v1/csrftoken/login via the Postman it returns me the 200 status code.

@floreks
Copy link
Member

floreks commented Apr 4, 2024

Is there anything in the browser console/network tab in the dev tools that could help?

Another thing I can think of is that there is an issue with SSL passthrough. You might try adding the below annotations to the ingress.

    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"

This is our default ingress that I am using to expose it locally:
https://github.com/kubernetes/dashboard/blob/master/charts/kubernetes-dashboard/templates/networking/ingress.yaml

@juvivas
Copy link

juvivas commented Apr 8, 2024

i resolved this issue modifying the kong configuration.

kong:
  proxy:
    http:
      enabled: true

so my ingressroute target the kong service at 80 port

@meekara
Copy link

meekara commented Apr 10, 2024

I have same issue and changing kong proxy http enable does not fix issue and no log in auth pod. I'm using traefik ingress.
It work with port forward as well.
001
002

@juvivas
Copy link

juvivas commented Apr 12, 2024

I have same issue and changing kong proxy http enable does not fix issue and no log in auth pod. I'm using traefik ingress. It work with port forward as well. 001 002
i used these parameters for helm installation

api:
  containers:
    args:
      - '--disable-csrf-protection=true'
web:
  scaling:
    replicas: 2
    args:
      - '--disable-csrf-protection=true'
kong:
  proxy:
    http:
      enabled: true

@thunko
Copy link

thunko commented Apr 14, 2024

I was facing the same issue and thought it could have relation with this one here

I configured the same settings as above, except for the web container, which doesn't support the disable csrf argument:

# helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard --set 'api.containers.args={--disable-csrf-protection=true}' --set kong.proxy.http.enabled=true

Accessed the kong proxy service and authenticated with admin-user token.

@c0desurfer
Copy link

That does not look like an issue on our side. Most likely it's a configuration issue on your side.

Probably is, getting same error on fresh install.

@nevillelyh
Copy link

I ran into this as well and it works after clearing cookies.

@djereg
Copy link

djereg commented May 16, 2024

In my case something went wrong at first try, and the /api/v1/csrftoken/login endpoint has returned the index page what is an html content and MY BROWSER CACHED IT, and every time the frontend called the enpoint, the response was returned from the cache. After disabling the cache it worked well.

Knowing this, you can imagine the 5 hours I spent the last night exploring this. But at least I was able to deepen my relationship with Ingresses and IngressRoutes.

@floreks
Copy link
Member

floreks commented May 16, 2024

This does not look like a bug on our side. Every comment with a solution indicates that. If there will be any evidence suggesting otherwise, we can reopen.

/close

@k8s-ci-robot
Copy link
Contributor

@floreks: Closing this issue.

In response to this:

This does not look like a bug on our side. Every comment with a solution indicates that. If there will be any evidence suggesting otherwise, we can reopen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kk-technical
Copy link

I have same problem...but still in problem.....
I tried every method... not work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests