Cannot authenticate with Gitea

I’m running both in Swarm (for now). I am deploying a stack with the following:

version: "3.4"
services:
    drone-server:
        image: drone/drone:latest
        volumes:
            - drone_data:/var/lib/drone
        ports:
            - "8000:8000"
            - 9000
        environment:
            - DRONE_OPEN=true
            - DRONE_HOST=<my-drone-url>
            - DRONE_GITEA=true
            - DRONE_GITEA_URL=https://<my-gitea-url>
            - DRONE_SECRET=notverysecret
        networks:
            - drone
            - traefik-net

When I enter my Gitea username/password, the UI says “The system failed to process your Login request” and in the logs I see :

 level=error msg="cannot authenticate user. invalid character '<' looking for beginning of value"

This error message would indicate that the API call to authenticate with Gitea is not reaching the API endpoint, and is instead being presented with an html response. The < refers to the opening tag of html document.

This could indicate an issue with your reverse proxy (Traefik) or could indicate a configuration issue. Can you confirm the authentication request is reaching Gitea by checking the Gitea logs? What do you see?

One common root cause for this error is using the wrong protocol scheme when you configure your Gitea address. For example, if you provide Drone with the http address instead of the https address, the API call will return a 302 redirect with an HTML body, resulting in an error message similar to the one you’ve posted.

:slight_smile: That was it - I had changed over to using my-company.net from my-company.com and had forgotten to update that line in my docker-compose.yml

I’ll get my coat …