Skip to content

panic: runtime error: invalid memory address or nil pointer dereference when do log restore only #60105

@apollodafoni

Description

@apollodafoni

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

log restore only

/br restore point --storage s3://tmp/br-log-backup62f29bd7-1ff6-4d03-afe5-17a29ad33eb9/Log?access-key=xxx&secret-access-key=xxx&endpoint=http%3a%2f%2fminio.pingcap.net%3a9001
&force-path-style=true --pd http://downstream-pd.brie-acceptance-pitr-tps-7831559-1-66:2379 --restored-ts 456704334025457782 --start-ts 456704078710046815 --concurrency=8 --check-requirements=false

2. What did you expect to see? (Required)

log restore success

3. What did you see instead (Required)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x5ba3247]

goroutine 1 [running]:
github.com/pingcap/tidb/br/pkg/task.RunRestore({0x78731d0, 0xc0012411d0}, {0x7894bc0, 0xc001c966b0}, {0x6f26c84, 0xd}, 0xc0018d0f08)
/workspace/source/tidb/br/pkg/task/restore.go:839 +0x847
main.runRestoreCommand(0xc001bf0c08, {0x6f26c84, 0xd})
/workspace/source/tidb/br/cmd/br/restore.go:80 +0x739
main.newStreamRestoreCommand.func1(0xc001bf0c08?, {0xc001c03ae0?, 0x4?, 0x6f08b81?})
/workspace/source/tidb/br/cmd/br/restore.go:254 +0x1f
github.com/spf13/cobra.(*Command).execute(0xc001bf0c08, {0xc00013c6b0, 0xa, 0xa})
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0018d2908)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
main.main()
/workspace/source/tidb/br/cmd/br/main.go:37 +0x23a

br.log

[2025/03/17 05:21:53.127 +00:00] [INFO] [stream.go:359] ["tsoStream.recvLoop ended"] [stream=downstream-pd-0.downstream-pd-peer.brie-acceptance-pitr-tps-7831559-1-66.svc:2379-3] [error="rpc error: code = Canceled desc = context canceled"] [errorVerbose="rpc error: code = Canceled desc = context canceled\ngithub.com/tikv/pd/client/clients/tso.(*tsoStream).recvLoop\n\t/root/go/pkg/mod/github.com/tikv/pd/[email protected]/clients/tso/stream.go:427\nruntime.goexit\n\t/root/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1700"]
[2025/03/17 05:21:53.131 +00:00] [ERROR] [checkpoint.go:421] ["send the error"] [category=checkpoint] [error="context canceled"] [stack="github.com/pingcap/tidb/br/pkg/checkpoint.(*CheckpointRunner[...]).sendError\n\t/workspace/source/tidb/br/pkg/checkpoint/checkpoint.go:421\ngithub.com/pingcap/tidb/br/pkg/checkpoint.(*CheckpointRunner[...]).startCheckpointMainLoop.func2\n\t/workspace/source/tidb/br/pkg/checkpoint/checkpoint.go:468"]

4. What is your TiDB version? (Required)

Release Version: v9.0.0-beta.1
Edition: Community
Git Commit Hash: 7b4717b
Git Branch: HEAD
UTC Build Time: 2025-03-13 03:08:08
GoVersion: go1.23.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv

/br -V
Release Version: v9.0.0-beta.1
Git Commit Hash: 7b4717b
Git Branch: HEAD
Go Version: go1.23.7
UTC Build Time: 2025-03-13 03:09:50
Race Enabled: false

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions