Skip to content

bug: coder show <workspace name> returns a panic: runtime error: invalid memory address or nil pointer dereference` #4315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sharkymark opened this issue Oct 3, 2022 · 3 comments · Fixed by #4328
Assignees

Comments

@sharkymark
Copy link
Contributor

Version: v0.9.1+27c8345

I want to see details about a workspace.

The CLI is also 0.9.1

When I type coder show <workspace name> e.g., coder show admin/go or frankly even an incorrect workspace name, I get this:

 coder show admin/go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1eeed43]

goroutine 1 [running]:
github.com/coder/coder/cli/cliui.renderAgentStatus({{0xf1, 0xef, 0x6e, 0x5b, 0x92, 0x26, 0x46, 0x75, 0xb0, 0x35, ...}, ...})
	/home/runner/work/coder/coder/cli/cliui/resources.go:127 +0x223
github.com/coder/coder/cli/cliui.WorkspaceResources({0x6bee760, 0xc00012e008}, {0xc000910580?, 0x2, 0x4}, {{0xc00055f81a, 0x2}, 0x0, 0x0, {0x0, ...}, ...})
	/home/runner/work/coder/coder/cli/cliui/resources.go:99 +0x878
github.com/coder/coder/cli.show.func1(0xc000592a00, {0xc00062bc50, 0x1, 0x1?})
	/home/runner/work/coder/coder/cli/show.go:33 +0x2f4
github.com/spf13/cobra.(*Command).execute(0xc000592a00, {0xc00062bc30, 0x1, 0x1})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc000630f00)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x3bd
main.main()
	/home/runner/work/coder/coder/enterprise/cmd/coder/main.go:19 +0xaf

image

@achalagarwal
Copy link

achalagarwal commented Oct 30, 2022

@kylecarbs

Facing a segfault (maybe a related error?), I am on v0.11.0

View logs 2022-10-30 16:45:17.817 [INFO] (coderd.tailnet) <./tailnet/conn.go:456> (*Conn).sendNode.func1 sending node {"node": {"id": 7225411017662463757, "as_of": "2022-10-31T00:45:17.817071903+08:00", "key": "nodekey:c8851329075acb7ca561df58792916b85202be1c0462b1cf9811cde8da2bfe5d", "disco": "discokey:926c8cf04290d166a69e41d7c854b8c10bd35bc238c2dcaf87d9e6e640401761", "preferred_derp": 999, "derp_latency": {"999-v4": 0.004041021}, "addresses": ["fd7a:115c:a1e0:451e:9928:80aa:773:aac8/128"], "allowed_ips": ["fd7a:115c:a1e0:451e:9928:80aa:773:aac8/128"], "endpoints": ["redacted:43765", "172.17.0.1:43765"]}} 2022-10-30 16:45:24.288 [DEBUG] (coderd) <./coderd/httpmw/logger.go:54> Logger.func1.1 GET {"host": "redacted", "path": "/api/v2/workspaceagents/7b20332c-21a6-41a5-bc54-977889500feb/pty", "proto": "HTTP/1.1", "remote_addr": "223.187.113.150", "took": "2h4m3.070873064s", "status_code": 101, "latency_ms": 7443070, "request_id": "539d1b89-41f1-4758-955f-a3f7e9afa3b7"} 2022-10-30 16:45:35.551 [DEBUG] (coderd.tailnet.wgengine) <./tailnet/conn.go:615> Logger.func1 [v1] magicsock: starting endpoint update (periodic) 2022-10-30 16:45:35.560 [DEBUG] (coderd.tailnet.wgengine) <./tailnet/conn.go:615> Logger.func1 netcheck: [v1] report: udp=true v6=false mapvarydest= hair=true portmap= v4a=redacted:43765 derp=999 derpdist=999v4:5ms 2022-10-30 16:45:36.141 [DEBUG] <./coderd/autobuild/executor/lifecycle_executor.go:75> (*Executor).Run.func1 run stats {"elapsed": "0s", "transitions": {}} 2022-10-30 16:45:36.256 [DEBUG] (coderd) <./enterprise/coderd/coderd.go:357> (*API).runEntitlementsLoop syncing licensed entitlements 2022-10-30 16:45:36.257 [DEBUG] (coderd) <./enterprise/coderd/coderd.go:365> (*API).runEntitlementsLoop synced licensed entitlements 2022-10-30 16:45:36.575 [DEBUG] (coderd) <./coderd/httpmw/logger.go:54> Logger.func1.1 GET {"host": "redacted", "path": "/api/v2/workspaces/be2a98a9-ccfd-4b01-a34f-e71584e49141/watch", "proto": "HTTP/1.1", "remote_addr": "223.187.113.150", "took": "2h7m26.976954557s", "status_code": 200, "latency_ms": 7646976, "request_id": "c6be72a5-a71e-4a19-ad18-c9325355ca54"} panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x6831b6]

goroutine 59825 [running]:
bufio.(*Writer).Flush(0xc0007a6480)
/opt/hostedtoolcache/go/1.19.2/x64/src/bufio/bufio.go:629 +0x56
net/http.(*response).Flush(0xc0005c40e0)
/opt/hostedtoolcache/go/1.19.2/x64/src/net/http/server.go:1706 +0x3a
github.com/coder/coder/coderd/tracing.(*StatusWriter).Flush(0x7f0ad35516c0?)
/home/runner/work/coder/coder/coderd/tracing/status_writer.go:81 +0x35
github.com/coder/coder/coderd/httpapi.ServerSentEventSender.func1()
/home/runner/work/coder/coder/coderd/httpapi/httpapi.go:206 +0x202
created by github.com/coder/coder/coderd/httpapi.ServerSentEventSender
/home/runner/work/coder/coder/coderd/httpapi/httpapi.go:191 +0x37d
"logs.txt" 4200L, 1031719C

@kylecarbs
Copy link
Member

Oofta, not good! Fixing now.

@achalagarwal
Copy link

@kylecarbs
Thanks for having it expedited, #4821 should fix it, although I haven't tested it yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants