I am using gitea with drone and it doesn’t work.
When I go to /login
it redirects to /login/error?message=unexpected EOF
and has a 401 unauthorized error for a request to /api/user
I have no idea why it doesn’t work?
I am using gitea with drone and it doesn’t work.
When I go to /login
it redirects to /login/error?message=unexpected EOF
and has a 401 unauthorized error for a request to /api/user
I have no idea why it doesn’t work?
Drone debug logs:
{"fields.time":"2022-03-21T01:13:40Z","latency":39866,"level":"debug","method":"GET","msg":"","remote":"172.17.0.1:58478","request":"/login","request-id":"26fqvhAXi92oDc6T6JiofkZsMzh","time":"2022-03-21T01:13:40Z"}
{"level":"error","msg":"oauth: cannot exchange code: zOya3slJTpomrLWHzgUsDb1P7k3OLsqf62see2qN4nBf: unexpected EOF","time":"2022-03-21T01:13:40Z"}
{"level":"debug","msg":"cannot authenticate user: unexpected EOF","time":"2022-03-21T01:13:40Z"}
{"fields.time":"2022-03-21T01:13:40Z","latency":152125949,"level":"debug","method":"GET","msg":"","remote":"172.17.0.1:58478","request":"/login?code=zOya3slJTpomrLWHzgUsDb1P7k3OLsqf62see2qN4nBf\u0026state=9408d2ac22c4d294","request-id":"26fqvmTCw9B3W78s7gEKZ5L9MEL","time":"2022-03-21T01:13:40Z"}
{"fields.time":"2022-03-21T01:13:41Z","latency":31180,"level":"debug","method":"GET","msg":"","remote":"172.19.0.1:42400","request":"/login/error?message=unexpected%20EOF","request-id":"26fqvoW2l4f1sd81vD6FK1XEB4M","time":"2022-03-21T01:13:41Z"}
I also checked logs through my proxy server and the returned data from gitea seems to be a valid json structure:
{
"access_token": "xxxxx",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "xxxxx"
}
I believe it was a bug with my proxy service but I have fixed it now. Strange that my browser and curl didn’t throw the same error. I guess they just ignore it.
Could you explain the issue you had with your proxy service? I do encounter the same error / issue, but I don’t really see what should be wrong with my proxy…
It was a custom proxy implementation I wrote. Using the default http reverse proxy library for the language was the fix. I can’t really help very much as you are either using apache/nginx or your own custom proxy service. Neither of which I know anything about.