zcli service log - invalid memory address or nil pointer dereference

Hi guys. When execute zcli service log --projectId XXX it works fine. But when adding the --serviceId XXX parameter it crashed
zcli service log --projectId XXX --serviceId XXX
➤ INFO Selected service: XXX
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xdb101cc]

goroutine 1 [running]:
github.com/zeropsio/zcli/src/cmd.serviceLogCmd.func1({0xe37a140, 0xc00011a000}, 0xc000157440)
/Users/runner/work/zcli/zcli/src/cmd/serviceLog.go:60 +0x357
github.com/zeropsio/zcli/src/cmdBuilder.buildCobraCmd.createCmdRunFunc.func1(0xc000148f08, {0xc00012e340, 0x0, 0x4})
/Users/runner/work/zcli/zcli/src/cmdBuilder/createRunFunc.go:130 +0x4da
github.com/spf13/cobra.(*Command).execute(0xc000148f08, {0xc00012e300, 0x4, 0x4})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000142008)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1034
github.com/zeropsio/zcli/src/cmdBuilder.ExecuteRootCmd(0xc0000c8370)
/Users/runner/work/zcli/zcli/src/cmdBuilder/executeRootCmd.go:55 +0x294
github.com/zeropsio/zcli/src/cmd.ExecuteCmd()
/Users/runner/work/zcli/zcli/src/cmd/root.go:18 +0x18
main.main()
/Users/runner/work/zcli/zcli/cmd/zcli/main.go:8 +0xf
zcli service log --projectId XXX --serviceId XXX
➤ INFO Selected service: XXX
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xdb101cc]

goroutine 1 [running]:
github.com/zeropsio/zcli/src/cmd.serviceLogCmd.func1({0xe37a140, 0xc00011a000}, 0xc000157440)
/Users/runner/work/zcli/zcli/src/cmd/serviceLog.go:60 +0x357
github.com/zeropsio/zcli/src/cmdBuilder.buildCobraCmd.createCmdRunFunc.func1(0xc000148f08, {0xc00012e340, 0x0, 0x4})
/Users/runner/work/zcli/zcli/src/cmdBuilder/createRunFunc.go:130 +0x4da
github.com/spf13/cobra.(*Command).execute(0xc000148f08, {0xc00012e300, 0x4, 0x4})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000142008)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1034
github.com/zeropsio/zcli/src/cmdBuilder.ExecuteRootCmd(0xc0000c8370)
/Users/runner/work/zcli/zcli/src/cmdBuilder/executeRootCmd.go:55 +0x294
github.com/zeropsio/zcli/src/cmd.ExecuteCmd()
/Users/runner/work/zcli/zcli/src/cmd/root.go:18 +0x18
main.main()
/Users/runner/work/zcli/zcli/cmd/zcli/main.go:8 +0xf
Solution:
Hi, I have just released a fixed version, could you, please, try to update your zCLI and try again? https://github.com/zeropsio/zcli/?tab=readme-ov-file#linuxmacos...
Jump to solution
14 Replies
nermal
nermal2w ago
@Michal can you help pls ?
Jan Saidl
Jan Saidl2w ago
zcli version ?
nermal
nermal2w ago
@kolisko ☝️
kolisko
koliskoOP2w ago
zcli version
zcli version v1.0.26 (go1.23.1) darwin/amd64
zcli version
zcli version v1.0.26 (go1.23.1) darwin/amd64
Solution
Michal Saloň
Michal Saloň2w ago
Hi, I have just released a fixed version, could you, please, try to update your zCLI and try again? https://github.com/zeropsio/zcli/?tab=readme-ov-file#linuxmacos
kolisko
koliskoOP2w ago
@Michal it works! thanks for quick fix 👍
kolisko
koliskoOP2w ago
There is another issue with this version of zcli now. It worked before.
zcli push
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xf3863a0]

goroutine 1 [running]:
github.com/zeropsio/zcli/src/cmd/scope.(*service).LoadSelectedScope(0xc00011c710, {0xf654200, 0xc000098000}, 0xc00015f4a0, 0xc0000c9440)
/Users/runner/work/zcli/zcli/src/cmd/scope/scopeService.go:69 +0x1e0
github.com/zeropsio/zcli/src/cmdBuilder.buildCobraCmd.createCmdRunFunc.func1(0xc0000d0f08, {0xfb99aa0, 0x0, 0x0})
/Users/runner/work/zcli/zcli/src/cmdBuilder/createRunFunc.go:125 +0x4af
github.com/spf13/cobra.(*Command).execute(0xc0000d0f08, {0xfb99aa0, 0x0, 0x0})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000b4008)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1034
github.com/zeropsio/zcli/src/cmdBuilder.ExecuteRootCmd(0xc00015e370)
/Users/runner/work/zcli/zcli/src/cmdBuilder/executeRootCmd.go:50 +0x26f
github.com/zeropsio/zcli/src/cmd.ExecuteCmd()
/Users/runner/work/zcli/zcli/src/cmd/root.go:18 +0x18
main.main()
/Users/runner/work/zcli/zcli/cmd/zcli/main.go:8 +0xf
~/IdeaProjects/bilestopy/app-web git:[main]
zcli version
zcli version v1.0.33 (go1.23.4) darwin/amd64
zcli push
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xf3863a0]

goroutine 1 [running]:
github.com/zeropsio/zcli/src/cmd/scope.(*service).LoadSelectedScope(0xc00011c710, {0xf654200, 0xc000098000}, 0xc00015f4a0, 0xc0000c9440)
/Users/runner/work/zcli/zcli/src/cmd/scope/scopeService.go:69 +0x1e0
github.com/zeropsio/zcli/src/cmdBuilder.buildCobraCmd.createCmdRunFunc.func1(0xc0000d0f08, {0xfb99aa0, 0x0, 0x0})
/Users/runner/work/zcli/zcli/src/cmdBuilder/createRunFunc.go:125 +0x4af
github.com/spf13/cobra.(*Command).execute(0xc0000d0f08, {0xfb99aa0, 0x0, 0x0})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000b4008)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1034
github.com/zeropsio/zcli/src/cmdBuilder.ExecuteRootCmd(0xc00015e370)
/Users/runner/work/zcli/zcli/src/cmdBuilder/executeRootCmd.go:50 +0x26f
github.com/zeropsio/zcli/src/cmd.ExecuteCmd()
/Users/runner/work/zcli/zcli/src/cmd/root.go:18 +0x18
main.main()
/Users/runner/work/zcli/zcli/cmd/zcli/main.go:8 +0xf
~/IdeaProjects/bilestopy/app-web git:[main]
zcli version
zcli version v1.0.33 (go1.23.4) darwin/amd64
Michal Saloň
Michal Saloň2w ago
Should be fixed in latest version.
kolisko
koliskoOP2w ago
@Michal Saloň in npm registry see latest still 1.0.33
nermal
nermal2w ago
you should use
curl -L https://zerops.io/zcli/install.sh | sh
curl -L https://zerops.io/zcli/install.sh | sh
as we've not released to npm yet
Jan Saidl
Jan Saidl2w ago
For windows users: irm https://zerops.io/zcli/install.ps1 | iex
Michal Saloň
Michal Saloň2w ago
My personal recommendation is to not use npm for such packages, but 🤷‍♂️ And yes the latest version is 1.0.33, let me check what got to the npm registry.
kolisko
koliskoOP2w ago
thanks!
Michal Saloň
Michal Saloň2w ago
Seems like 1.0.33 in NPM is 1.0.32, which got there as part of debugging why our npm release GitHub Action isn't working (since it seems to be working locally). If you remove the npm package and install it using our install script, it should work.
Want results from more Discord servers?
Add your server