Drone has limit of 500 characters to store user token in “users” table. Latest Gitea can issue token that is longer than that as result even after authorizing in drone, user session is created but old token is uses as result accessing any build will show 404 error.
Drone will log error:
cannot update user: pq: value too long for type character varying(500)
I was able to fix problem on my instance by changing drone database using SQL:
alter table users alter column user_oauth_token type bytea using convert_to(user_oauth_token, 'LATIN1'); alter table users alter column user_oauth_refresh type bytea using convert_to(user_oauth_refresh, 'LATIN1');