Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

argocd login is failing with "received the unexpected content-type" error

Tags:

argocd

When attempting to login using CLI, I get an error

FATA[0004] rpc error: code = Internal desc = transport: received the unexpected content-type "text/plain; charset=utf-8"

Here is our Ingress config:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  tls:
    - hosts:
      - argocd.foo.dev
      secretName: argocd-foo-dev-tls
  rules:
    - host: argocd.foo.dev
      http:
        paths:
        - backend:
            serviceName: argocd-server
            servicePort: https
          path: /

The web UI works as expected.

I am using command:

argocd login argocd.foo.dev

What is missing?

like image 898
Gajus Avatar asked Dec 05 '25 08:12

Gajus


2 Answers

While I am not 100% what is the reason for the above error, using --grpc-web works around it:

argocd login argocd.foo.dev --grpc-web

Documentation says that this flag is needed when HTTP2 is not supported:

Enables gRPC-web protocol. Useful if Argo CD server is behind proxy which does not support HTTP2.

In our case, our ingress controller is nginx and it does support http2.

like image 80
Gajus Avatar answered Dec 12 '25 04:12

Gajus


You need to login first:

argocd login localhost:8080
like image 38
Oğuzcan Budumlu Avatar answered Dec 12 '25 04:12

Oğuzcan Budumlu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!