gotsunami/gitlab-copy

migrate: panic on nil pointer

Closed this issue · 2 comments

Hi @matm,

With the latest update, 0.8.1, I have run the gitlab-copy to copy from one Gitlab instance to another one.

First issue is copied successfully. But when it started copying second issue, I got this error:

...
Copying issues ...
2023/03/10 06:03:28 [DEBUG] GET https://myremoteserver.com/api/v4/projects/3/issues?page=1&per_page=100&sort=asc
2023/03/10 06:03:30 [DEBUG] GET https://myremoteserver.com/api/v4/projects/3/issues?page=2&per_page=100&sort=asc
2023/03/10 06:03:31 [DEBUG] GET https://myremoteserver.com/api/v4/projects/3/issues?page=3&per_page=100&sort=asc
2023/03/10 06:03:31 [DEBUG] GET https://myremoteserver.com/api/v4/projects/3/issues/1
2023/03/10 06:03:31 [DEBUG] GET https://mylocalserver.com/api/v4/projects/68/issues
target: issue 1 already exists, skipping...2023/03/10 06:03:31 [DEBUG] GET https://myremoteserver.com/api/v4/projects/3/issues/2
2023/03/10 06:03:32 [DEBUG] GET https://mylocalserver.com/api/v4/projects/68/issues
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x50 pc=0xcc334d]

goroutine 1 [running]:
github.com/gotsunami/gitlab-copy/migration.(*Migration).migrateIssue(0xc00008b110, 0xc0000c8008?)
        /home/mathias/progs/gitlab-copy/migration/issue.go:135 +0x32d
github.com/gotsunami/gitlab-copy/migration.(*Migration).Migrate(0xc00008b110)
        /home/mathias/progs/gitlab-copy/migration/issue.go:406 +0x778
main.main()
        /home/mathias/progs/gitlab-copy/cmd/gitlab-copy/main.go:172 +0x1065
matm commented

Will investigate, thanks for reporting.

Wow that was fast. Thank you, its fixed now.