user@host:~/go/src/github.com/stellar/go/services$ go install github.com/stellar/go/services/horizon
horizon/main.go:7:2: code in directory /home/user/go/src/github.com/PuerkitoBio/throttled expects import "github.com/throttled/throttled"
horizon/internal/init_web.go:9:2: code in directory /home/user/go/src/github.com/PuerkitoBio/throttled/store expects import "github.com/throttled/throttled/store"
I have git cloned from here -> https://github.com/stellar/go.git
My OS and golang environment is:
user@hostname:~/go/services/horizon$ uname -a
Linux hostname 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
user@hostname:~/go/services/horizon$ go env
GOARCH="amd64"
GOBIN="/home/user/goprojects/bin"
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOhostnameARCH="amd64"
GOhostnameOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build511052720=/tmp/go-build -gno-record-gcc-switches"
user@hostname:~/go/services/horizon$
Can someone please guide me how to fix this ?
TIA.
I have fixed the imports and I now have the following error :
user@machine:~/go/services/horizon$ go install github.com/stellar/go/services/horizon # github.com/stellar/go/services/horizon/internal
../../src/github.com/stellar/go/services/horizon/internal/init_web.go:147:18: cannot use store.NewRedisStore(app.redis, "throttle:", 0) (type *redigostore.RedigoStore) as type *memstore.MemStore in assignment
@ZeroGraviti Did you run glide install after cloning the repo? See building section of Horizon's admin guide for details.
@nebolsin I think I have repeated the same issue (go get --> go install)
me@node1:~/stellar/go$ go get github.com/stellar/go/services/horizon
package github.com/PuerkitoBio/throttled: code in directory /home/me/stellar/go/src/github.com/PuerkitoBio/throttled expects import "github.com/throttled/throttled"
package github.com/PuerkitoBio/throttled/store: code in directory /home/me/stellar/go/src/github.com/PuerkitoBio/throttled/store expects import "github.com/throttled/throttled/store"
package context: unrecognized import path "context" (import path does not begin with hostname)
me@node1:~/stellar/go$ go install github.com/stellar/go/services/horizon
src/github.com/stellar/go/clients/stellarcore/client.go:4:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/me/stellar/go/src/context (from $GOPATH)
src/github.com/stellar/go/services/horizon/main.go:7:2: code in directory /home/me/stellar/go/src/github.com/PuerkitoBio/throttled expects import "github.com/throttled/throttled"
src/github.com/stellar/go/services/horizon/internal/init_web.go:9:2: code in directory /home/me/stellar/go/src/github.com/PuerkitoBio/throttled/store expects import "github.com/throttled/throttled/store"
Commands issued until encountering the issue:
cd ~/stellar
git clone https://github.com/stellar/go.git && cd go
export GOPATH=/home/lscm/stellar/go
mkdir ~/stellar/go/bin #for installing Glide
curl https://glide.sh/get | sh
glide install
go get github.com/stellar/go/services/horizon
go install github.com/stellar/go/services/horizon
Versions:
Ubuntu 16.04.3 LTS, 64bit server (GNU/Linux 4.4.0-112-generic x86_64))
go go1.6.2 linux/amd64
glide v0.13.1
git 2.7.4
Thanks in advance!
@ckmakcesar you need Go 1.9+, on 16.04 you can use this backport: https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports
Also you don't need go get ... step, because this repo is not "go gettable".
You need to be running a pretty new version of glide. The version of glide packaged with Ubuntu 17.10 is too old and has problems installing projects with subrepos, eg. raven-go and ethereum-go.
I installed tip using
go get -u github.com/Masterminds/glide
which seems to work ok.
https://github.com/stellar/go/blob/master/.travis.yml Can be a good resource to understand how we at stellar build and test from this repo.
Also: https://travis-ci.org/stellar/go gives an idea about what environments we get green builds from, which you can use to compare with your local environment to debug issues.
Anyways, I'm going to go ahead and close this issue since it's really related to you local environment and not with horizon itself. Please feel free to continue the discussion here to get your problem resolved.
The same problem... latest glide, latest go, but horizon still failed to install. any working fix??
@syswipe there were several issues described in this issue. Please post your build log so and your environment so we can help you diagnose your specific issue.
build steps:
git clone https://github.com/stellar/go.git && cd go
glide install
go install github.com/stellar/go/services/horizon
can't load package: package github.com/stellar/go/services/horizon: cannot find package "github.com/stellar/go/services/horizon" in any of:
/usr/lib/go-1.10/src/github.com/stellar/go/services/horizon (from $GOROOT)
/home/squirl/.go/src/github.com/stellar/go/services/horizon (from $GOPATH)
environment:
glide version 0.13.2-dev
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/squirl/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/squirl/.go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build455738234=/tmp/go-build -gno-record-gcc-switches"DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
@syswipe Try moving your clone to /home/squirl/.go/src/github.com/stellar/go and then run go install github.com/stellar/go/services/horizon.
As further explanation: I believe you've checked out our codebase to a directory that isn't in your workstation's GOPATH. You can read the reference documentation about go and GOPATH here: https://golang.org/cmd/go/#hdr-GOPATH_environment_variable
Thanks for your help. It works now
@ZeroGraviti , did you fix your last issue: cannot use store.NewRedisStore( ?
I've the same one.