# How to use Drone runner with Gitlab and DRONE\_RUNNER\_CAPACITY \> 1?

**URL:** <https://drone.discourse.group/t/how-to-use-drone-runner-with-gitlab-and-drone-runner-capacity-1/14200>\
**Category:** Drone Support\
**Tags:** basic\
**Created:** [June 20, 2023, 7:46am UTC](https://drone.discourse.group/t/how-to-use-drone-runner-with-gitlab-and-drone-runner-capacity-1/14200 "2023-06-20T07:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobrom](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bobrom/32/8970_2.png) [@bobrom](https://drone.discourse.group/u/bobrom)\
**Post date:** [June 20, 2023, 7:46am UTC](https://drone.discourse.group/t/how-to-use-drone-runner-with-gitlab-and-drone-runner-capacity-1/14200/1 "2023-06-20T07:46:21Z")

</div>

I’m using Drone server and docker runner with the following configuration:

```auto
services:
  drone:
    image: drone/drone:2.17
    container_name: drone-srv
    restart: always
    ports:
      - "5100:80"
    volumes:
      - /var/lib/drone:/data
    environment:
      DRONE_GITLAB_SERVER: <server>
      DRONE_GITLAB_CLIENT_ID: <client_id>
      DRONE_GITLAB_CLIENT_SECRET: <secret>
      DRONE_GITLAB_SKIP_VERIFY: "true"
      DRONE_RPC_SECRET: <secret>
      DRONE_SERVER_HOST: <host>
      DRONE_SERVER_PROTO: https
      DRONE_USER_CREATE: username:admin,admin:true
      DOCKER_API_VERSION: 1.39
  runner:
    image: drone/drone-runner-docker:1.8
    container_name: drone-runner
    restart: always
    ports:
      - "5110:3000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      DRONE_RPC_PROTO: https
      DRONE_RPC_HOST: <host>
      DRONE_RPC_SECRET: <secret>
      DRONE_RUNNER_CAPACITY: 5
      DRONE_RUNNER_NAME: drone-docker-runner-1
      DRONE_RUNNER_ENVIRON: GIT_SSL_NO_VERIFY:false                               

```

GitLab version is 16.0.

When having DRONE\_RUNNER\_CAPACITY\>1, the runners can’t use GitLab OAuth correctly: pipelines are stuck and I get plenty of messages in the runner log, like the following:

```auto
time="2023-06-20T07:27:05Z" level=error msg="cannot get stage details" error="The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client." stage.id=7170 stage.name="..." stage.number=1 thread=5

```

With DRONE\_RUNNER\_CAPACITY=1 everything works like a charm. However, I’d like to increase the capacity. Could you please advise?

It feels like multiple threads (when capacity is higher than 1) are using the same authorization grant and somehow interfering with each other. As a result, only one thread is actually working and others are failed with the mentioned authorization error and therefore get stuck.
