simagix / hatchet

MongoDB JSON Log Analyzer
Apache License 2.0
165 stars 22 forks source link

cannot find package "github.com/brianvoe/gofakeit/v6" #35

Closed jay0610 closed 11 months ago

jay0610 commented 11 months ago

[root@xxxxxxx hatchet]# ./build.sh ../go/src/github.com/simagix/hatchet/bios.go:19:2: cannot find package "github.com/brianvoe/gofakeit/v6" in any of: /usr/lib/golang/src/github.com/brianvoe/gofakeit/v6 (from $GOROOT) /root/go/src/github.com/brianvoe/gofakeit/v6 (from $GOPATH) ../go/src/github.com/simagix/hatchet/audit_template.go:16:2: cannot find package "golang.org/x/text/language" in any of: /usr/lib/golang/src/golang.org/x/text/language (from $GOROOT) /root/go/src/golang.org/x/text/language (from $GOPATH) ../go/src/github.com/simagix/hatchet/audit_template.go:17:2: cannot find package "golang.org/x/text/message" in any of: /usr/lib/golang/src/golang.org/x/text/message (from $GOROOT) /root/go/src/golang.org/x/text/message (from $GOPATH) [root@xxxxxxx hatchet]#

simagix commented 11 months ago

What go version and OS do you use?

jay0610 commented 11 months ago

OS : Red Hat Enterprise Linux Server release 7.6 (64 bit arch) Git version is : [root@xxxx ]# go version go version go1.9.4 linux/amd64

Just to give you more information - I am working in very restricted environment, so go is installed using tarball extraction (not used yum install method). I even tried installing gofakeit manually using git clone. After downloading, I didn't seen v6.

[root@xxx gofakeit]# ls -ltr v6 ls: cannot access v6: No such file or directory [root@xxx gofakeit]# [root@xxx gofakeit]# pwd /root/test/gofakeit

simagix commented 11 months ago

Try run the following command:

go get github.com/brianvoe/gofakeit/v6

Instructions can be found at https://github.com/brianvoe/gofakeit.

jay0610 commented 11 months ago

I already tried above step while troubleshooting. Error as follows :

[root@xxx ~]# go get github.com/brianvoe/gofakeit/v6 package github.com/brianvoe/gofakeit/v6: cannot find package "github.com/brianvoe/gofakeit/v6" in any of: /usr/lib/golang/src/github.com/brianvoe/gofakeit/v6 (from $GOROOT) /root/go/src/github.com/brianvoe/gofakeit/v6 (from $GOPATH) [root@xxx ~]#

Do I have to set any env variable for $GOROOT and $GOPATH ? I read that one don't have to set any path. Go will automatically pick up the $GOROOT and $GOPATH.

simagix commented 11 months ago

Does the server have Internet connectivity? It looks like a GIT config problem. I would try on a different machine. In addition, use a user other than “root”. Alternatively, if you are not required to build it yourself, use or extract from https://hub.docker.com/r/simagix/hatchet.

jay0610 commented 11 months ago

Sorry for late response. I was out of office for couple of weeks. Our servers have internet connectivity with limited access like - access to those links which are only required. So before implementing this, I first did it on EC2 instance with all accesses (anywhere 0.0.0.0/0) on all ports. This worked smoothly.

While working on server with restricted environment, I whitelisted those links which were required. This list of links was gathered from ./build.sh command.

I have used root user and as I have mentioned it works well on EC2 instance with full access outside world too. I tried on virtual machines too and it is working fine.

For alternative option to use extract of docker image - I am working on "How can I do it". I am coming from database background so little knowledge of docker.

Do you think raising issue in gofakeit can help me solve this issue ? Because I did tried manually for gofakeit and it gave me same issue as I got during hatchet's build.sh command.

thanks.

jay0610 commented 11 months ago

Seems issue was locally with Git. Uninstalled the one already installed and replace with latest version go1.21.4. Thanks for support. :)