Drone

Problems cloning with Gitea

I wanted to address a common error when attempting to clone a repository from Gitea, when Drone and Gitea are running on the same machine (usually with Docker compose). These errors may manifest as one of the following:

Fatal: could not read Username for
Fatal: unable to access

First, we should clear up some misconceptions:

  1. Drone does not clone your code inside the agent or runner container. The fact that the agent or runner or server can communicate with Gitea is irrelevant.
  2. The clone container is attached to a user-defined network. The fact that you can clone code inside a Docker container is irrelevant because that container is probably attached to the bridge network.

In order for the clone container to communicate with Gitea you probably need to attach the Gitea network to the clone container. You can attach additional networks to all pipeline containers using this runner configuration parameter:

DRONE_RUNNER_NETWORKS=<name>