mattermost / mattermost/mattermost-plugin-github

Panic when loading lhs-content

Open
#970 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
179
Forks
180
Avg merge
1d 16h
Merged PRs (30d)
13

Description

Not sure what caused it, it's not happening frequently, I just noticed it while checking the Mattermost log for something else:

```
warn [2026-02-26 15:20:33.614 +01:00] Recovered from a panic caller="app/plugin_api.go:1134" plugin_id=github url=/api/v1/lhs-content error="runtime error: invalid memory address or nil pointer dereference" stack="goroutine 6385881 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).withRecovery-fm.(*Plugin).withRecovery.func1.1()
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:197 +0x65
panic({0xed36e0?, 0x19b7220?})
runtime/panic.go:792 +0x132
net/url.(*URL).String(0xe3c460?)
net/url/url.go:833 +0x2c
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.newGithubIssue(0x0, {0x0, 0x0}, {0x0, 0x0}, {0x12143e0?}, {0xc001284450?}, {{0x0, 0x0, 0x0}}, ...)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:194 +0x8c
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.newIssueFromAssignmentResponse(0xf021e0?)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:175 +0x345
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.(*Client).fetchLHSData(0xc000e523c0, {0x121c6e8, 0xc000f077a0}, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:107 +0xde8
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.(*Client).GetLHSData(0xc000e523c0, {0x121c6e8, 0xc000f077a0})
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:46 +0x350
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getLHSData(0xffffffffffffffff?, 0xc000e52380)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1041 +0x2d
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getSidebarData(0xc0000e0000, 0xc000e52380)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1050 +0x2c
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getSidebarContent(0xc0000e0000, 0xc000e52380, {0x121b690, 0xc0004f0e70}, 0xc000de8101?)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1064 +0x2b
github.com/mattermost/mattermost-plugin-..."
warn [2026-02-26 15:20:33.616 +01:00] Recovered from a panic caller="app/plugin_api.go:1134" plugin_id=github url=/api/v1/lhs-content error="runtime error: invalid memory address or nil pointer dereference" stack="goroutine 6385862 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).withRecovery-fm.(*Plugin).withRecovery.func1.1()
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:197 +0x65
panic({0xed36e0?, 0x19b7220?})
runtime/panic.go:792 +0x132
net/url.(*URL).String(0xe30001?)
net/url/url.go:833 +0x2c
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.newGithubIssue(0x0, {0x0, 0x0}, {0x0, 0x0}, {0x12143e0?}, {0xc002c84180?}, {{0x0, 0x0, 0x0}}, ...)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:194 +0x8c
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.newIssueFromAssignmentResponse(0xf021e0?)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:175 +0x345
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.(*Client).fetchLHSData(0xc000e56800, {0x121c6e8, 0xc000e62bd0}, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...)
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:107 +0xde8
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql.(*Client).GetLHSData(0xc000e56800, {0x121c6e8, 0xc000e62bd0})
github.com/mattermost/mattermost-plugin-github/server/plugin/graphql/lhs_request.go:46 +0x350
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getLHSData(0xffffffffffffffff?, 0xc000e567c0)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1041 +0x2d
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getSidebarData(0xc0000e0000, 0xc000e567c0)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1050 +0x2c
github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).getSidebarContent(0xc0000e0000, 0xc000e567c0, {0x121b690, 0xc000d094c0}, 0xc000a60f01?)
github.com/mattermost/mattermost-plugin-github/server/plugin/api.go:1064 +0x2b
github.com/mattermost/mattermost-plugin-..."
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in server/plugin/graphql/lhs_request.go at GetLHSData and fetchLHSData, then follow newIssueFromAssignmentResponse to newGithubIssue around line 194. Use the /api/v1/lhs-content path and the supplied stack trace to investigate the intermittent nil pointer dereference. Done means loading lhs-content no longer recovers this panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.