Gitea <> drone: fresh setup throws 404

Hi, I just installed drone with the drone:latest container and the drone-runner-ssh_1 pipeline. gitea is version 1.17.2, oauth was set up according to Gitea | Drone. The initital login from drone to gitea throws a 404 with the following endpoint:[xxx]&[xxx]

I double checked the drone config and see no obvious error there and the older posts here about 404 do not help. Any ideas for debugging?

Thx, Thommie

Hi @thommierother can you regenerate the API key and refresh the oauth2 client secret and try again.


Hi Shruthi,
I did that already, two times ;-). This is the server.env (security-sensitive values are XXX-ed)

Do we have a chance to see a bit more about the 404 root cause?

@thommierother sure let me check and get back to you.


@thommierother it must be an issue around oauth2 app creation.

Can you share the screenshot of oauth2 app in gitea?


@thommierother your initial message in this loop has this URL[xxx]&[xxx]

we can see that URL ends up twice.

Can you pass DRONE_LOGS_DEBUG=true to the server and see if any of the debug output shows the URL twice?


@Shruthikini Here is a log excerpt starting with the click on the “continue” button on the welcome page at Drone CI , created with “docker logs --follow”

{"level":"debug","msg":"api: authentication required","request-id":"2FxI8XDHBczBXT0ME09s1kzZKNJ","time":"2022-10-10T18:39:09Z"}
{"level":"debug","msg":"api: guest access","request-id":"2FxI8XDHBczBXT0ME09s1kzZKNJ","time":"2022-10-10T18:39:09Z"}
{"level":"debug","msg":"events: stream opened","request-id":"2FxI8byQPYagQvyauAES2Jb9b2E","time":"2022-10-10T18:39:09Z"}
{"error":"sql: no rows in result set","level":"debug","msg":"api: repository not found","name":"login","namespace":"gitea.netzwissen.
{"level":"debug","msg":"api: guest access","request-id":"2FxI8eNeSQRrihJQV8SRPh4Vmu8","time":"2022-10-10T18:39:09Z"}

I don’t understand that

"error":"sql: no rows in result set",

I guess that the 404 we see is just a result of something going wrong even earlier …
Any ideas ??

@thommierother let me check and get back to you.


Operation in the gitea web UI is normal, same goes for all git actions through vscode. I looked into the sql database behind gitea and there is nothing “obviously wrong”, I dont know which “row” is expected here …

1 Like

Re-installation of drone and re-creating the sqlite database fixed the issue. Root cause was a space character in the client secret, (paste/copy error)

1 Like