Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Panic when loading lhs-content

未关闭
#970 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
go
领域
api, backend

调研方向

从 server/plugin/graphql/lhs_request.go 中的 GetLHSData 和 fetchLHSData 开始,然后跟踪 newIssueFromAssignmentResponse 到第 194 行附近的 newGithubIssue。使用 /api/v1/lhs-content 路径和提供的 stack trace 调查间歇性 nil 指针解引用。完成的标准是加载 lhs-content 时不再 recover 此 panic。

由索引模型根据 Issue 内容生成。

描述

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-..."
主要语言
Go
星标
181
派生
180
平均合并
21 小时 4 分钟
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mattermost/mattermost-plugin-github 的其他 Issue

查看 mattermost/mattermost-plugin-github 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。