# Testsuite failed: make testsuite: package github.com/docker/libcompose: cannot download

**URL:** <https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 22, 2019, 12:18pm UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220 "2019-05-22T12:18:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [May 22, 2019, 12:18pm UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/1 "2019-05-22T12:18:13Z")

</div>

Hi Team,

I'm trying to perform testing for filebeat, but getting below problem with libcompose.  
`package github.com/docker/libcompose: cannot download, $GOPATH must not be set to $GOROOT. For more details see: 'go help gopath`

**go version**  
`go version go1.12.5 linux/amd64`

**virtualenv --version**  
`16.5.0`

**Command:**  
`make testsuite`

**Full logs:**

> ```
> make[1]: Entering directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> /root/.magefile cleaned
> No LICENSE.txt / LICENSE found in source
> New python executable in /usr/local/go/src/github.com/elastic/beats/libbeat/build/python-env/bin/python2
> Also creating executable in /usr/local/go/src/github.com/elastic/beats/libbeat/build/python-env/bin/python
> Installing setuptools, pip, wheel...
> done.
> DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
> DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
> make[2]: Entering directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> mage -v fields
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> Running target: Fields
> Found Elastic Beats dir at /usr/local/go/src/github.com/elastic/beats
> exec: go run /usr/local/go/src/github.com/elastic/beats/libbeat/scripts/cmd/global_fields/main.go -es_beats_path /usr/local/go/src/github.com/elastic/beats -beat_path /usr/local/go/src/github.com/elastic/beats/libbeat processors
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> Generated fields.yml for libbeat
> make[2]: Leaving directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> Updating generated files for libbeat
> cat: _meta/beat.yml: No such file or directory
> cat: _meta/beat.yml: No such file or directory
> if [-d /usr/local/go/src/github.com/elastic/beats/libbeat/_meta/kibana]; then \
> cp -pr /usr/local/go/src/github.com/elastic/beats/libbeat/_meta/kibana/* /usr/local/go/src/github.com/elastic/beats/libbeat/_meta/kibana.generated ; \
> fi
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> -- The index pattern was created under /usr/local/go/src/github.com/elastic/beats/libbeat/_meta/kibana.generated/5/index-pattern/libbeat.json
> -- The index pattern was created under /usr/local/go/src/github.com/elastic/beats/libbeat/_meta/kibana.generated/6/index-pattern/libbeat.json
> make unit-tests
> make[2]: Entering directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> mkdir -p /usr/local/go/src/github.com/elastic/beats/libbeat/build/coverage
> # gotestcover is needed to fetch coverage for multiple packages
> go get github.com/elastic/beats/vendor/github.com/pierrre/gotestcover
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> # testify is needed for unit and integration tests
> go get github.com/elastic/beats/vendor/github.com/stretchr/testify/assert
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> # libcompose is needed for integration tests
> go get github.com/docker/libcompose
> warning: GOPATH set to GOROOT (/usr/local/go) has no effect
> package github.com/docker/libcompose: cannot download, $GOPATH must not be set to $GOROOT. For more details see: 'go help gopath'
> make[2]: *** [prepare-tests] Error 1
> make[2]: Leaving directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> make[1]: *** [testsuite] Error 2
> make[1]: Leaving directory `/usr/local/go/src/github.com/elastic/beats/libbeat'
> make: *** [testsuite] Error 1
> 
> ```

Please help me to get out of this.

Thanks in advance!

Best Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 22, 2019, 6:34pm UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/2 "2019-05-22T18:34:25Z")

</div>

Hi @harshbajaj16,

The error mentions that `$GOPATH` is set to `$GOROOT`, what is the value of these environment variables?  
You cah see it with `echo $GOPATH` and `echo $GOROOT`.

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [May 23, 2019, 4:04am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/3 "2019-05-23T04:04:18Z")

</div>

HI @jsoriano,

Thank you for your reply.

i didn't set GOROOT path and also checked with `echo $GOROOT` its showing nothing.

However, if i run `go env` command it is showing by default GOPATH and GOROOT as same.

`> #go env`

> ```
> -----
> GOPATH="/usr/local/go"
> GORACE=""
> GOROOT="/usr/local/go"
> -----
> 
> ```

could you pls help that how to unset the same in go env ??

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 23, 2019, 6:42am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/4 "2019-05-23T06:42:30Z")

</div>

You will need to set a `GOPATH` for your user so packages can be installed there, you can for example create a `gocode` directory in your home and `export GOPATH=$HOME/gocode`.

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [May 24, 2019, 6:58am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/5 "2019-05-24T06:58:34Z")

</div>

Hi @Jasonespo,

Thank you for your reply!

It was helpful for me. However, after this step i was getting `bin/gotestcover: No such file or directory` error and test suite failed.

**Solution:**  
I've copied the `bin/` directory from go lang installed directory i.e. `/usr/local/go/bin` into `$GOPATH` ($HOME/gocode) directory to resolve this problem.

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 24, 2019, 10:34am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/6 "2019-05-24T10:34:56Z")

</div>

@harshbajaj16 you can also add the `$GOPATH/bin` directory to your `$PATH` instead of copying the binaries.

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [May 24, 2019, 10:55am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/7 "2019-05-24T10:55:43Z")

</div>

HI @jsoriano,

Thank you but i'm not able to understand this. because i've copied the full `bin/` directory from `/usr/local/go` and as per you`$GOPATH/bin` directory should contains `bin/` directory to set $PATH and for this i need to copy the bin directory in GOPATH.

Please let me know if i misunderstood you.

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 24, 2019, 11:00am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/8 "2019-05-24T11:00:22Z")

</div>

Just modify your [PATH](https://kb.iu.edu/d/acar) with something like `export PATH=$GOPATH/bin:$PATH`, so your terminal can find the commands installed in the `GOPATH` without needing to copy them 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2019, 11:00am UTC](https://discuss.elastic.co/t/testsuite-failed-make-testsuite-package-github-com-docker-libcompose-cannot-download/182220/9 "2019-06-21T11:00:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
