Build cbq-engine errors

I followed the installation instructions - however:

lamb@silent:~/src/github.com/couchbase/query$ ./build.sh
go get -d -v ./...
cd parser/n1ql
go tool yacc n1ql.y
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
go fmt ./...
[... and 3 other times this error ... ]

Full log:
runLog.zip (1.1 KB)

client.go error is fixed by:

	for _,_ = range vsm.ServerList {
		gs := <-ch
		rv[gs.Server] = gs
	}
	return rv
}

Can you try

go get -u -d -v ./...

lamb@silent:~/cbq-server/src/github.com/couchbase/query$ ./build.sh
go get -d -v ./...
cd parser/n1ql
go tool yacc n1ql.y
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
go fmt ./...
cd server/cbq-engine
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd shell/cbq.old
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd shell/cbq
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd tutorial
go build
go install ./...
# github.com/couchbase/go_json
../go_json/encode.go:1245: undefined: atomic.Value
lamb@silent:~/cbq-server/src/github.com/couchbase/query$ go get -u -d -v ./...
github.com/couchbase/query (download)
github.com/couchbase/go-couchbase (download)
github.com/couchbase/go_json (download)
github.com/dustin/go-jsonpointer (download)
github.com/dustin/gojson (download)
github.com/andelf/go-curl (download)
github.com/couchbase/clog (download)
github.com/rcrowley/go-metrics (download)
github.com/couchbase/cbauth (download)
github.com/couchbase/gomemcached (download)
github.com/couchbase/goutils (download)
github.com/gorilla/context (download)
github.com/gorilla/mux (download)
github.com/samuel/go-zookeeper (download)
github.com/couchbase/gometa (download)
github.com/golang/protobuf (download)
github.com/couchbase/indexing (download)
github.com/couchbase/retriever (download)
github.com/couchbase/godbc (download)
github.com/peterh/liner (download)
golang.org/x/crypto (download)
github.com/sbinet/liner (download)
github.com/russross/blackfriday (download)
github.com/shurcooL/sanitized_anchor_name (download)

and

lamb@silent:~/cbq-server/src/github.com/couchbase/query$ ./build.sh
go get -d -v ./...
cd parser/n1ql
go tool yacc n1ql.y
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
go fmt ./...
cd server/cbq-engine
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd shell/cbq.old
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd shell/cbq
go build
# github.com/couchbase/go_json
../../../go_json/encode.go:1245: undefined: atomic.Value
cd tutorial
go build
go install ./...
# github.com/couchbase/go_json
../go_json/encode.go:1245: undefined: atomic.Value

Ah. You need golang 1.7.

Thank you

Also a custom script for anyone looking to install it (from here https://gist.github.com/jacoelho/fb989f8c25c3ca7d5db5)

#!/bin/bash

# Credits to the owner of the script https://gist.github.com/jacoelho/fb989f8c25c3ca7d5db5
# If you have some version of golang, make sure to unistall it first

# Preparation: 
# :# apt-get remove golang
# or purge, depending on taste
#
# :# apt-get autoremove 
# Probably there will be leftover packages. I tend to keep a neat system

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "installGOLang.sh needs to run as root!" 1>&2
   exit 1
fi

export GOLANG_VERSION=1.7.5
export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
export GOLANG_DOWNLOAD_SHA256=2e4dd6c44f0693bef4e7b46cc701513d74c3cc44f2419bf519d7868b12931ac3

apt-get update -qq

apt-get install -y --no-install-recommends \
        g++ \
        gcc \
        libc6-dev \
        make \
        git-core

curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
        && echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \
        && tar -C /usr/local -xzf golang.tar.gz \
        && rm golang.tar.gz

for bin in $(ls /usr/local/go/bin/); do
        test -f /usr/bin/$bin && rm /usr/bin/$bin
        update-alternatives --install /usr/bin/$bin $bin /usr/local/go/bin/$bin 1
        update-alternatives --set $bin /usr/local/go/bin/$bin
done
1 Like

@arungupta, user @sntentos created an install and build script for Couchbase Server.

Clarification: For golang in machines not offering update past some version (1.4 in Debian/Jessie 8.7)

@geraldss @sntentos This would be a great PR for Couchbase project.

@arungupta, I think @sntentos did it to help other developers, not for PR. :slight_smile:

Pull request. Doh!!