# Module "..." found, but does not contain package "..."

**URL:** <https://discuss.elastic.co/t/module-found-but-does-not-contain-package/356052>\
**Category:** Beats\
**Tags:** docker, libbeat\
**Created:** [March 24, 2024, 9:45am UTC](https://discuss.elastic.co/t/module-found-but-does-not-contain-package/356052 "2024-03-24T09:45:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeynepyz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeynepyz/32/114656_2.png) [@zeynepyz](https://discuss.elastic.co/u/zeynepyz)\
**Post date:** [March 24, 2024, 9:45am UTC](https://discuss.elastic.co/t/module-found-but-does-not-contain-package/356052/1 "2024-03-24T09:45:34Z")

</div>

Hello i am trying to create new metricbeat module for my self improvement. This is my [pr](https://github.com/elastic/beats/pull/38179). As you can see i get trouble with all at of tests. Some of them are mage check errors.

```auto
Error: ../../../../go/pkg/mod/github.com/docker/docker@v25.0.4+incompatible/pkg/ioutils/readers.go:14:2: no required module provides package github.com/containerd/log; to add it:
	go get github.com/containerd/log
# github.com/elastic/elastic-agent-autodiscover/kubernetes
Error: ../../../../go/pkg/mod/github.com/elastic/elastic-agent-autodiscover@v0.6.8/kubernetes/types.go:114:40: undefined: policyv1beta1.PodSecurityPolicy
Error: ../../../../go/pkg/mod/github.com/elastic/elastic-agent-autodiscover@v0.6.8/kubernetes/informer.go:289:33: client.PolicyV1beta1().PodSecurityPolicies undefined (type "k8s.io/client-go/kubernetes/typed/policy/v1beta1".PolicyV1beta1Interface has no field or method PodSecurityPolicies)
Error: failed running go vet, please fix the issues reported: running "go vet ./..." failed with exit code 1
make[1]: *** [scripts/Makefile:153: check] Error 1
make[1]: Leaving directory '/home/runner/work/beats/beats/libbeat'
make: *** [Makefile:94: check] Error 1
Error: Process completed with exit code 2.

```

This is one of my code's error. When i trying to solve this problem first i type `go get github.com/containerd/log`  
Then i run `mage check`.

```auto
Error parsing magefiles: error running "go list -f {{.Dir}}||{{.Name}} github.com/elastic/beats/v7/dev-tools/mage/target/common": exit status 1
no required module provides package github.com/elastic/beats/v7/dev-tools/mage/target/common; to add it:
	go get github.com/elastic/beats/v7/dev-tools/mage/target/common

```

This is the new error that i get. This time i run `go get github.com/elastic/beats/v7/dev-tools/mage/target/common`  
Then again run `mage check`. This time i get following error:

```auto
Error parsing magefiles: error running "go list -f {{.Dir}}||{{.Name}} github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker": exit status 1
no required module provides package github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker; to add it:
	go get github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker

```

If i run `go get github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker` command. This is the error that i get.

```auto
go: module github.com/elastic/beats/v7@upgrade found (v7.17.18), but does not contain package github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker

```

I tried to add this module manual in go.mod file but when i did this i get this error

```auto
Error determining list of magefiles: listing mage files: failed to list gofiles tagged with "mage": exit status 1: go: errors parsing go.mod:
go.mod:21:2: require github.com/elastic/beats/v7/dev-tools/mage/target/integtest/docker: version "v7.17.18" invalid: should be v0 or v1, not v7

```

I really don't know how to solve this problem can you please help with some of steps?

---

<div class="post-metadata">

**Author:** ![Jasn\_Hr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasn_hr/32/132987_2.png) [@Jasn\_Hr](https://discuss.elastic.co/u/Jasn_Hr)\
**Post date:** [March 26, 2024, 10:30am UTC](https://discuss.elastic.co/t/module-found-but-does-not-contain-package/356052/2 "2024-03-26T10:30:52Z")

</div>

I also researching this topic and stuck here,  
I look up the package not found in new version from：  
pkg.go.dev/github.com/elastic/beats/v7

I guess maybe need mapping correct version to get module and now I was keep find it.

---

<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:** [April 23, 2024, 12:31pm UTC](https://discuss.elastic.co/t/module-found-but-does-not-contain-package/356052/3 "2024-04-23T12:31:51Z")

</div>

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