Could not get repo list drone gitlab

Hi guys,

Running microk8s kubernetes gitlab and drone server. I am able to connect to gitlab through oauth but is unable to sync repo list. Getting this error message:

{"error":"500 Internal Server Error","level":"warning","login":"root","msg":"syncer: cannot get remote repository list","time":"2021-10-16T04:57:17Z"}
{"error":"500 Internal Server Error","level":"debug","msg":"api: cannot synchronize account","time":"2021-10-16T04:57:17Z"}

Full logs:

{"level":"debug","login":"root","msg":"syncer: begin repository sync","time":"2021-10-16T04:57:17Z"}
{"fields.time":"2021-10-16T04:57:17Z","latency":439798,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:54176","request":"/api/user","request-id":"1zZerhYUjXQMBfVEYdjx6dGI7o4","time":"2021-10-16T04:57:17Z"}
{"error":"500 Internal Server Error","level":"warning","login":"root","msg":"syncer: cannot get remote repository list","time":"2021-10-16T04:57:17Z"}
{"error":"500 Internal Server Error","level":"debug","msg":"api: cannot synchronize account","time":"2021-10-16T04:57:17Z"}
{"fields.time":"2021-10-16T04:57:27Z","latency":383799,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:54176","request":"/api/user","request-id":"1zZesytopHI5JDDYqWMPY3k7zdX","time":"2021-10-16T04:57:27Z"}
{"fields.time":"2021-10-16T04:57:27Z","latency":709698,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:54176","request":"/api/user/repos?latest=true","request-id":"1zZet1r83CAHA8Ko1Ir59TqIgq5","time":"2021-10-16T04:57:27Z"}
{"fields.time":"2021-10-16T04:57:27Z","latency":561498,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:54176","request":"/api/user/repos?latest=true","request-id":"1zZet0iFzKDJtbgIGZ0wIZ32H4p","time":"2021-10-16T04:57:27Z"}
{"fields.time":"2021-10-16T05:00:52Z","latency":24000,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:44031","request":"/","request-id":"1zZfIhTCXCwNKXxzeuX8C2q0hPh","time":"2021-10-16T05:00:52Z"}

Build:

        env:
          - name: "DRONE_TLS_AUTOCERT"
            value: "false"
          - name: "DRONE_GITLAB_SKIP_VERIFY"
            value: "false"
          - name: "DRONE_LOGS_DEBUG"
            value: "true"
          - name: "DRONE_USER_CREATE"
            value: "username:root,admin:true,token:ZMtLxBzrFusRCofpUmn-"
          - name: "DRONE_SERVER_HOST"
            value: "HIDDEN"
          - name: "DRONE_SERVER_PROTO"
            value: "https"
          - name: "DRONE_GITLAB_SERVER"
            value: "HIDDEN"
          - name: "DRONE_GITLAB_CLIENT_ID"
            value: "HIDDEN"
          - name: "DRONE_GITLAB_CLIENT_SECRET"
            value: "HIDDEN"
          - name: "DRONE_RPC_SECRET"
            value: "HIDDEN"
          - name: "DRONE_DATABASE_DRIVER"
            value: "sqlite3"
          - name: "DRONE_DATABASE_DATASOURCE"
            value: "drone.sqlite"

Any help would be appreciated. Thanks!

@dev852com ,

Could you please share the below details:

  1. The drone server version that you are running along with runner version
  2. How many repo are there in gitlab?

Hi! Thank you for getting back to me.

  1. image: drone/drone:latest
  2. Just default repos
{"level":"debug","login":"root","msg":"syncer: begin repository sync","time":"2021-11-18T18:32:39Z"}
{"error":"500 Internal Server Error","level":"warning","login":"root","msg":"syncer: cannot get remote repository list","time":"2021-11-18T18:32:41Z"}
{"error":"500 Internal Server Error","level":"debug","msg":"api: cannot synchronize account","time":"2021-11-18T18:32:41Z"}
{"fields.time":"2021-11-18T18:32:49Z","latency":315803,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:38062","request":"/api/user","request-id":"216T7SVSEWRVva4lm3Y51pFoxao","time":"2021-11-18T18:32:49Z"}
{"fields.time":"2021-11-18T18:32:49Z","latency":503505,"level":"debug","method":"GET","msg":"","remote":"10.0.2.4:38062","request":"/api/user/repos?latest=true","request-id":"216T7UqhrrqBQM2xSXJjVdipEoe","time":"2021-11-18T18:32:49Z"}

The root account in your example needs to be an active GitLab account that you have linked to Drone (by going through the oauth2 process). Have you done this? Otherwise you should check your GitLab server logs, which is returning a 500 Internal Server Error, which could indicate a GitLab problem.

That solves it! root account does not sync repo! Thank you so much!!!

[Solution]
Use drone helm chart
Create user account