[Kubernetes] Drone Login: "We're sorry but Drone does not work properly without JavaScript enabled. Please enable it to continue."

I am using Drone and Gogs as helm subcharts. The installation works fine. I was able to register at Gogs, got the auth token and I can authenticate via Drone at Gogs, because the logs of the Gogs pod says:

[Macaron] 2019-03-14 17:00:14: Started GET / for
2019/03/14 17:00:14 [TRACE] Session ID: 237b28e27dd4282d
2019/03/14 17:00:14 [TRACE] CSRF Token: AagPEb2hSel1hJWbLMskrwrNEZs6MTU1MjU4MjgxNDg3NjAxOTQwNA==
2019/03/14 17:00:14 [TRACE] Template: home

So the authentication went fine. Unfortunatelly, Drone returns:
401 Unauthorized (http://localhost:8002/api/user)

And the response of the login page (http://localhost:8002/login/) says:
" invalid character '>' looking for beginning of value"
The corresponding HTML is the rendered message: " We’re sorry but Drone does not work properly without JavaScript enabled. Please enable it to continue."

My values file is this:

      serverDomain: "localhost"
      serverRootUrl: "http://localhost"

  sharedSecret: "supersecret"
    adminUser: "anja"
      DRONE_SERVER_HOST: "http://example-setup-drone.cicd"
      DRONE_USER_CREATE: "username:anja,machine:false,admin:true,token:40fc3882bde41b458e23c3949cd112d7a9871a32"
    provider: "gogs"
      server: "http://example-setup-gogs.cicd?skip_verify=true"

from what I can see, drone is trying to reach Gogs at localhost, however localhost is pointing the drone server. This would tell me that something is wrong with the Gogs url, which should be pointing to a non-loopback address.

unfortunately the helm chart is not something I am involved with, but perhaps others in the forum can provide some further assistance. I can say with certainty that it must be some sort of configuration issue, because the DRONE_GOGS_SERVER should point to your Gogs server address and not localhost.

The values for the drone chart specify the right address:

    provider: "gogs"
      server: "http://example-setup-gogs.cicd?skip_verify=true"

The logs of Gogs also indicate, that the authentication was successful.

From within the Kubernetes cluster the addresses are:

via the browser, I access the sites via port forwarding

one thing I notice is that you appended ?skip_verify=true. This is not something that Drone supports. Is this a convention of the helm chart?

unfortunately I cannot offer support for the Helm chart, but I can say with certainty that we have hundreds of active Gogs and Gitea installations. Drone works fine as long as the DRONE_GOGS_SERVER environment variable is correctly passed to the server. If this is not the case, I would encourage you to explore the possibility that the Helm chart is not working properly because I can say with confidence Drone is working.

This should be easy to verify, by the way. You should be able to inspect the environment variables that were used to create your container in kubernetes …

Thanks, the query was the issue.
I would like to contribute to drone’s documentation. Several colleagues struggled to set up drone on Kubernetes because of the lacking documentation.
How can I contribute?

I wrote an article series about Drone 0.8 on Kubernetes + Helm that you can see here and how to also deploy from Drone to Kube with Helm. Maybe it can help ?

It would be great to have an updated 1.0 guide :slight_smile: