# Drone: builds failing and clone related issue

**URL:** <https://drone.discourse.group/t/drone-builds-failing-and-clone-related-issue/10382>\
**Category:** Drone Support\
**Created:** [January 21, 2020, 11:42pm UTC](https://drone.discourse.group/t/drone-builds-failing-and-clone-related-issue/10382 "2020-01-21T23:42:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grv231](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/grv231/32/5522_2.png) [@grv231](https://drone.discourse.group/u/grv231)\
**Post date:** [January 21, 2020, 11:42pm UTC](https://drone.discourse.group/t/drone-builds-failing-and-clone-related-issue/10382/1 "2020-01-21T23:42:51Z")

</div>

Hey Guys,

New to using drone CI, running into some basic problems which I am sure someone can help (maybe I have been staring the problem for too long 🙂 )

I have been trying to test custom logic using this link: [Custom logic link](https://docs.drone.io/pipeline/docker/syntax/cloning/#custom-logic). Just removed the step _git checkout $DRONE\_COMMIT_. Here is the output:

```
+ git clone https://github.com/octocat/hello-world.git .
Cloning into '.'...
+ go build
can't load package: package .: no Go files in /drone/src

```

This fails in the **build** step. I tried looking for the path `/drone/src` but couldnt find this path anywhere

I did read the documents on how drone clones repository from the links [this](http://discuss.harness.io/t/how-drone-clones-a-repository/3135) and [this](https://docs.drone.io/pipeline/docker/syntax/workspace/). Some of my questions are:

- Is the git clone temporary? As I did try to find the cloned repos, and I couldn’t (both inside the agent and servers containers) or in shared docker volume.

More information, here is my docker-compose configuration:

```
version: '3.7'

services:
  drone-server:
    container_name: drone_server
    image: drone/drone:latest
    ports:
      - xxxx:xxxx
    volumes:
      - /var/lib/drone:/data
    env_file:
      - ./drone-server.env
    restart: always
    environment:
      - DRONE_GITHUB_SERVER=https://github.com
      - DRONE_AGENTS_ENABLED=true
      - DRONE_TLS_AUTOCERT=false
      - DRONE_LOGS_TRACE=true
      - DRONE_LOGS_PRETTY=true
      - DRONE_LOGS_COLOR=true

  drone-agent:
    container_name: drone_agent
    image: drone/agent:latest
    ports:
      - xxxx:xxxx
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - drone-server
    restart: always
    env_file:
      - ./drone-agent.env
    environment:
      - DRONE_RUNNER_CAPACITY=1
      - DRONE_RUNNER_NAME=mazdoor
      - DRONE_LOGS_TRACE=true
      - DRONE_LOGS_PRETTY=true
      - DRONE_LOGS_COLOR=true

```

Passing the env vars in two files **drone-agent.env** and **drone-server.env**.

Can someone assist in this. I know this community to be highly engaging and helpful, hoping someone to point out issues in either the docker config or the actual drone yaml file.

Thanks,  
Gaurav

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [January 21, 2020, 11:52pm UTC](https://drone.discourse.group/t/drone-builds-failing-and-clone-related-issue/10382/2 "2020-01-21T23:52:05Z")

</div>

```plaintext
+ git clone https://github.com/octocat/hello-world.git .
Cloning into '.'... + go build can't
load package: package .: no Go files in /drone/src

```

👋 hey there, based on the output you posted it would appear you copy / pasted the example from the documentation and you are using the configuration as-is.

Please note that this example in the documentation is more like pseudo code and is not meant to be a working example. You should replace the repository url and the build step with configuration parameters that are specific to your project.

```diff
kind: pipeline
type: docker
name: default

clone:
  disable: true

steps:
  - name: clone
    image: alpine/git
    commands:
- - git clone https://github.com/octocat/hello-world.git .
+ - git clone <insert your repository address here> .
    - git checkout $DRONE_COMMIT

  - name: build
- image: golang
+ image: <insert your docker image here>
    commands:
- - go build
- - go test
+ - <insert your commands here>

```

> [@On another topic](https://drone.discourse.group/t/6688/1):
>
> This fails in the build step. I tried looking for the path /drone/src but couldnt find this path anywhere

the workspace directory (read more [here](https://docs.drone.io/pipeline/docker/syntax/workspace/)), in which you are cloning your code, is a temporary docker volume that is destroyed when the pipeline is complete. Drone does not clone any code inside the agent or server container.

> [@On another topic](https://drone.discourse.group/t/6688/1):
>
> Is the git clone temporary? As I did try to find the cloned repos, and I couldn’t (both inside the agent and servers containers) or in shared docker volume.

This was somewhat answered above, but for completeness, the `/drone/src` directory is the workspace directory. It is the temporary volume mounted inside your pipeline containers. It is the working directory of all pipeline steps.

---

<div class="post-metadata">

**Author:** ![grv231](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/grv231/32/5522_2.png) [@grv231](https://drone.discourse.group/u/grv231)\
**Post date:** [January 22, 2020, 1:22am UTC](https://drone.discourse.group/t/drone-builds-failing-and-clone-related-issue/10382/3 "2020-01-22T01:22:08Z")

</div>

Hi Brad,

Thank you for the detailed explanation. It makes a lot of sense now.

On the GitHub repo, apologies for that, for some reason I was expecting some golang files to be there (which weren’t present my mistake, and it’s obvious **go** build step will fail ).

I am testing pipelines now, will let you know how it goes (hopefully they will work, i know there is a potential problem for SSH github-clone that i have to solve). Thank you for taking the time to give detailed explanation.

Gaurav
