Make package: yaml.v2': No such file or directory

I am getting the following error when i try to package a newly generated beat (with cookiecutter) on debian jessie:

$ make package
Cloning into '/go/src/'...
cp: cannot stat '/go/src/': No such file or directory
vendor/ recipe for target 'prepare-package' failed
make[1]: *** [prepare-package] Error 1
make[1]: Leaving directory '/go/src/'
vendor/ recipe for target 'package' failed
make: *** [package] Error 2

$ uname -ra
Linux dev1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux
$ echo $GOPATH
$ go version
go version go1.7.3 linux/amd64
$ python --version
Python 2.7.9

To reproduce:
$ mkdir $GOPATH/src/{user}
$ cd $GOPATH/src/{user}
$ cookiecutter $GOPATH/src/
project_name [Examplebeat]: test
github_name [your-github-name]: user
beat [countbeat]:
beat_path [{github id}]:
full_name [Firstname Lastname]: {Full Name}
$ cd $GOPATH/src/{user}/test
$ make setup
$ make package-setup
$ make package

I have also tried same steps under the roor user and with GOPATH=/go. This results in the same error.

Can you check if exists in your vendored copy of the beats project? In your case that would mean in: vendor/

With the most recent version of the generator you should only have to run make and then make package. No need for the package-setup part anymore.

The GOPATH is different from your gopath, as all this is running inside docker containers.

Additional comment: What is the version of your beats repository? Can you make sure to update it to master?

Thank you for a quick reply. The following folder exists with needed content:


I was also able to reproduce the issue today one more time just several minutes ago after clearing the $GOPATH completely (which i hope mean that i got the latest master version for beats ):

rm -rf $GOPATH/*
go get
mkdir $GOPATH/src/
cd $GOPATH/src/
cookiecutter $GOPATH/src/
project_name [Examplebeat]: test18112016
github_name [your-github-name]: user
beat [test18112016]:
beat_path [{github id}]:
full_name [Firstname Lastname]: 
cd $GOPATH/src/
make setup
make package

This resulted in the same error:

Cloning into '/go/src/'...
cp: cannot stat '/go/src/': No such file or directory



root dirictory is not available and as far i understand it should not look for it at all due to my


Thank you in advance.

The part i miss above is go get Do you run that after you removed all the content of the go directory? If not, I'm kind of confused why cookiecutter would still work?

Sorry, the following step was also done:

go get

As per documentation:

I updated my previous reply.

Can you update to Golang 1.7? I think it should also work under 1.6 but just to be sure we are testing the same version.

Seems like I already have the latest go version:

$ go version
go version go1.7.3 linux/amd64

Are you able to reproduce the issue on your side?

Strangely i can't but I'm working on OS X. Can you check if yaml.v2 exists in your vendor beats directory?

Yes, i see it is available:

user@dev1:~/go_workspace/src/$ find /home/user/go_workspace/ -name yaml.v2

And the error is:

Compiling import_dashboards for darwin/amd64
Cloning into '/go/src/'...
cp: cannot stat '/go/src/': No such file or directory
vendor/ recipe for target 'prepare-package' failed
make[1]: *** [prepare-package] Error 1

That is quite strange as all this happens inside the docker container. Which version of docker and docker-compose are you using?

As far as I understand running make to build the binary works?

Yep the


command does not return any errors. Docker version is:

user@dev1:~$ docker --version
Docker version 1.12.3, build 6b644ec

I don't have the docker-compose installed. Should it be?

That is quite strange. I assume you have yaml.v2 only in the vendor directory of beats and not in the global GOPATH? Docker version also looks good. You are right that compose is not needed for the packaging part.

My tests are done on Mac OS Sierra. I'm getting the impression there is something going wrong with mounting the volumes into the docker container. As far as I can see you are on Debian?

I have some unknown yaml.v2.a file, not directory, under the gopath:

user@dev1:~$ $echo $GOPATH
    -bash: /home/user/go_workspace: Is a directory
user@dev1:~$ ls -ltr /home/user/go_workspace/pkg/linux_amd64/
    -rw-r--r-- 1 user user 513782 Nov 22 15:29 /home/user/go_workspace/pkg/linux_amd64/

Yep, trying to make it work on debian:

~$ user@dev1:~$ lsb_release -da
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 8.3 (jessie)
    Release:        8.3
    Codename:       jessie

Sorry for the late reply. Is what you shared above the full output after make package or are there more lines? I would expect quite a few additional lines before.

I think I found the problem and here is the potential fix for it:

I was looking in the completely wrong place initially as I thought it happens directly after make package, but there are quite a lot of log lines in between. Not sure yet why it worked actually in the past :slight_smile:

Please let me know if you need me to reproduce the issue to get the make package output.

@Aliaksandr_Zabrodski It would be nice if you could keep an eye on the PR and retry as soon as it is merged and let me know if it fixes the issue for you.

Hi @ruflin,

I tried the PR and the problem is gone, but soon afterwards I run into another problem that the beat template file is not found, in my particular case I get the following message:

cp: cannot stat 'httpbeat.template.json': No such file or directory.

Please ignore the previous comment, the files where not in the correct place.
So I think the PR works as expected