Running example CircleCI job locally fails
Description
After installing the circleci CLI and setting it up with an API token, trying to run the local job as described in the documentation (see below) fails.
Location
The problem occurred to me when following the steps for running a CircleCI job locally, as in the documentation at https://circleci.com/docs/2.0/local-cli/#running-a-job
When running circleci local execute --job build I get the following output:
Downloading latest CircleCI build agent...
Docker image digest: sha256:bd9e81940b9fb3c8f6fbf2d6e2af84ae3f669afe1fec4303653255f23f364aee
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5e7077]
goroutine 28 [running]:
encoding/json.(*Encoder).Encode(0x0, 0xfb1380, 0xc00011a230, 0xc00011a230, 0x0)
/usr/local/go/src/encoding/json/stream.go:198 +0x37
github.com/circleci/build-agent/pkg/eventprocessor.(*stubServer).ProcessTaskEvent(0xc000486000, 0x11d0c40, 0xc00055e4b0, 0xc00011a230, 0x0, 0x0, 0x0)
/home/circleci/project/pkg/eventprocessor/server.go:45 +0xcf
github.com/circleci/build-agent/common/protocol._EventProcessor_ProcessTaskEvent_Handler(0xf53c00, 0xc000486000, 0x11d0c40, 0xc00055e4b0, 0xc00050a540, 0x0, 0x11d0c40, 0xc00055e4b0, 0xc0000ee0a0, 0x50)
/home/circleci/project/common/protocol/protocol.pb.go:1705 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00045c160, 0x11db260, 0xc000001c80, 0xc0000c8200, 0xc000456450, 0x18ad3a0, 0x0, 0x0, 0x0)
/go/pkg/mod/google.golang.org/[email protected]/server.go:995 +0x460
google.golang.org/grpc.(*Server).handleStream(0xc00045c160, 0x11db260, 0xc000001c80, 0xc0000c8200, 0x0)
/go/pkg/mod/google.golang.org/[email protected]/server.go:1275 +0xd97
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0003fe2c0, 0xc00045c160, 0x11db260, 0xc000001c80, 0xc0000c8200)
/go/pkg/mod/google.golang.org/[email protected]/server.go:710 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1
/go/pkg/mod/google.golang.org/[email protected]/server.go:708 +0xa1
Since I am completely new to CircleCI I am a bit lost and don't know where to dig to find the root of the problem. If you need any more information regarding the above, let me know.
Steps to Reproduce
git clone https://github.com/CircleCI-Public/circleci-demo-go.git
cd circleci-demo-go
circleci local execute --job build
Hi @fabschn, thanks for getting in touch about this example - I have reproduced the error myself and will speak to engineering and get back to you with a solution :-)
@fabschn I would also recommend posting your issue on the circleci-cli's repo.
Thanks for getting back on this @rosieyohannan and @teesloane
Seems like there already existed an issue in the repo you mentioned, @teesloane: https://github.com/CircleCI-Public/circleci-cli/issues/361
While the issue is not related to the documentation, I noticed one more thing:
I installed the CLI through homebrew. When trying to update the build-agent as mentioned in the issue mentioned above, I get the following output:
circleci update build-agent
`update` is not available because this tool was installed using `homebrew`.
Please consult the package manager's documentation on how to update the CLI.
It might be worth mentioning in the documentation that the CLI has to be updated through brew. There is a related issue here: https://github.com/CircleCI-Public/circleci-cli/issues/305
Thanks for the feedback @fabschn ☺️ I'll update docs to reflect this.