[Cloning Failure] Operation Timed Out

I’m able to broadcast the actual IP of the GOGS container instead of localhost. And Drone container is also possibly able to view it. However, I’ve a new error. Connection timeout during cloning of the repo. Logs are as followed:

Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: unable to access 'http://172.19.0.2:3000/wahal/test.git/': Failed to connect to 172.19.0.2 port 3000: Operation timed out

Do note that:
[1] Ping request from Drone container to GOGS container works fine.
[2] And so does vice versa ^
[3] Payload is also successfully sent by GOGS to Drone with proper 200 status code – at least that’s what GOGS webhook says.
[4] I also get error in Drone in case something is wrong with drone’s config yaml file, like ``image is missing` or something like that. So, drone is definitely able to not just receive my payload from GOGS but also read it.

I don’t understand the operation timeout after just 2 minutes. Even if I’ve explicitly increased DRONE_TIMEOUT to 30m.

And Drone container is also possibly able to view it.

the code is not clone inside the Drone container so this is not really relevant. Drone spawns a separate container for each pipeline step, including the clone step, on the host machine. Each pipeline has its own separate bridge network. It is therefore likely that Gogs is on a separate network and is therefore unreachable from the clone container. Most people solve this by setting DRONE_RUNNER_NETWORKS=<network>, where <network> is the name of the docker network to which pipeline containers should attach. You should be able to search this discourse forum for DRONE_RUNNER_NETWORKS to get more details.

1 Like

@bradrydzewski DRONE_RUNNER_NETWORKS did the job. Thanks a ton!