Closed webvictim closed 3 years ago
This seems to be related to all go
related commands running inside Docker - make -C build.assets release
, make -C build.assets lint
etc are all affected. It also seems to be related to Go 1.16 as it doesn't happen on the 1.15.5 buildbox.
@webvictim Still seeing this issue on master
.
$ make -C build.assets release
make: Entering directory '/home/rjones/go/src/github.com/gravitational/teleport/build.assets'
grep: /Makefile: No such file or directory
if [[ "quay.io/gravitational/teleport-buildbox:go1.16.2" == "quay.io/gravitational/teleport-buildbox:go1.16.2" ]]; then \
if [[ ${DRONE} == "true" ]] && ! docker inspect --type=image quay.io/gravitational/teleport-buildbox:go1.16.2 2>&1 >/dev/null; then docker pull quay.io/gravitational/teleport-buildbox:go1.16.2 || true; fi; \
docker build \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
--build-arg RUNTIME=go1.16.2 \
--build-arg PROTOC_VER=3.6.1 \
--build-arg GOGO_PROTO_TAG=v1.3.2 \
--build-arg PROTOC_PLATFORM=linux-x86_64 \
--cache-from quay.io/gravitational/teleport-buildbox:go1.16.2 \
--tag quay.io/gravitational/teleport-buildbox:go1.16.2 . ; \
fi
/bin/sh: 1: [[: not found
docker run --rm=true -v "$(pwd)/../":/go/src/github.com/gravitational/teleport -v /tmp:/tmp -w /go/src/github.com/gravitational/teleport -h buildbox -e GOMODCACHE=/tmp/gomodcache -v "$(pwd)/bcc:/usr/include/bcc" -i -u $(id -u):$(id -g) quay.io/gravitational/teleport-buildbox:go1.16.2 \
/usr/bin/make release -e ADDFLAGS="" OS=linux ARCH=amd64 RUNTIME=go1.16.2
Unable to find image 'quay.io/gravitational/teleport-buildbox:go1.16.2' locally
go1.16.2: Pulling from gravitational/teleport-buildbox
4bbfd2c87b75: Pull complete
d2e110be24e1: Pull complete
889a7173dcfe: Pull complete
4477964855da: Pull complete
d1cd544bb33a: Pull complete
a976449758c8: Pull complete
56d5d9787fa2: Pull complete
6000c3182e63: Pull complete
dbc3e5741256: Pull complete
c5ca5ec0ffd9: Pull complete
da8e6f435132: Pull complete
a778b354a73b: Pull complete
c9daad76e250: Pull complete
2081a2c72b7f: Pull complete
89f995e604e4: Pull complete
6ed1a2c55935: Pull complete
Digest: sha256:9f541bd755637fd36b36e4033aeb7cf62ad35a6ff7d7b35140fd5de581a0abe7
Status: Downloaded newer image for quay.io/gravitational/teleport-buildbox:go1.16.2
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
---> Building with GOOS=linux GOARCH=amd64 and with PAM support and without FIPS support and with BPF support.
/usr/bin/make --no-print-directory release-unix
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
---> Cleaning up OSS build artifacts.
rm -rf build
go clean -cache
rm -rf `go env GOPATH`/pkg/`go env GOHOSTOS`_`go env GOARCH`/github.com/gravitational/teleport*
rm -rf teleport
rm -rf *.gz
rm -rf *.zip
rm -f gitref.go
---> Building OSS web assets.
/usr/bin/make all WEBASSETS_TAG="webassets_embed"
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
VERSION=7.0.0-dev /usr/bin/make -f version.mk setver
---> Building OSS binaries.
/usr/bin/make build/teleport build/tctl build/tsh
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -tags "pam bpf webassets_embed" -o build/teleport -ldflags '-w -s' ./tool/teleport
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
Makefile:124: recipe for target 'build/teleport' failed
make[3]: *** [build/teleport] Error 1
make[2]: *** [all] Error 2
Makefile:110: recipe for target 'all' failed
make[1]: *** [full] Error 2
Makefile:138: recipe for target 'full' failed
Makefile:172: recipe for target 'release' failed
make: *** [release] Error 2
make: *** [Makefile:247: release] Error 2
make: Leaving directory '/home/rjones/go/src/github.com/gravitational/teleport/build.assets'
This is a different error. Having recently switched to MacOS I think it might be related to Docker on that platform as I’ve seen this message too. I’ll take a look.
@russjones I can't repro this using current master
(eb7bb01d34a84a253e7a46f51ac53d17c76c8654
) on either MacOS or Linux.
The error looks like it could be related to $HOME
being overridden to /
in Docker. Can you please run go env GOCACHE
inside a build container and show the output?
Also, what version of Docker are you running? The output of docker info
would be helpful.
Closing this due to lack of repro. The original issue was fixed in #6899. Please raise a new issue if this behaviour continues.
I'm seeing a lot of Go module downloads being attempted when running lint/test targets in CI. I'm pretty sure this shouldn't be happening on the main Teleport codebase as all dependencies should be vendored. Investigate why this is happening and fix it.
This may be related to the
api
directory (as I think we intend that dependencies should be downloaded for that package specifically) and if so, we should modify CI to write the cache to a writable temp dir to remove the errors.