Panic on pull via SSH #726

Closed
opened 2025-11-02 03:34:14 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @viktike on GitHub (May 19, 2017).

  • Gitea version (or commit ref): 977dcf9
  • Git version: 2.11.0
  • Operating system: Ubuntu amd64 Gitea server, MacOS GIT client
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

After upgrade to latest version, git pull of existing repo via SSH as admin user with LDAP auth fails with the follwing panic:

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

goroutine 1 [running]:
code.gitea.io/gitea/models.(*Repository).getUnitsByUserID(0xc420174420, 0x1dd8160, 0xc420266960, 0x4, 0x1, 0x0, 0x0)
	/srv/app/src/code.gitea.io/gitea/models/repo.go:361 +0x8c
code.gitea.io/gitea/models.(*Repository).CheckUnitUser(0xc420174420, 0x4, 0x1, 0x1, 0x0)
	/srv/app/src/code.gitea.io/gitea/models/repo.go:334 +0x5a
code.gitea.io/gitea/cmd.runServ(0xc42013a3c0, 0x0, 0xc42013a300)
	/srv/app/src/code.gitea.io/gitea/cmd/serv.go:253 +0x1f67
code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x12b1ba0, 0x146f9c0, 0xc42013a3c0, 0xc420131800, 0x0)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9
code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x14107f1, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x145b443, 0x2f, 0x0, ...)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xb4b
code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4201b1a00, 0xc4200101c0, 0x4, 0x4, 0x0, 0x0)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x65f
main.main()
	/srv/app/src/code.gitea.io/gitea/main.go:44 +0x3cd
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've tried to run external user syncronization several times but it didn't help, had to revert to an erlier version.

Originally created by @viktike on GitHub (May 19, 2017). - Gitea version (or commit ref): 977dcf9 - Git version: 2.11.0 - Operating system: Ubuntu amd64 Gitea server, MacOS GIT client - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description After upgrade to latest version, git pull of existing repo via SSH as admin user with LDAP auth fails with the follwing panic: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0xcebb0c] goroutine 1 [running]: code.gitea.io/gitea/models.(*Repository).getUnitsByUserID(0xc420174420, 0x1dd8160, 0xc420266960, 0x4, 0x1, 0x0, 0x0) /srv/app/src/code.gitea.io/gitea/models/repo.go:361 +0x8c code.gitea.io/gitea/models.(*Repository).CheckUnitUser(0xc420174420, 0x4, 0x1, 0x1, 0x0) /srv/app/src/code.gitea.io/gitea/models/repo.go:334 +0x5a code.gitea.io/gitea/cmd.runServ(0xc42013a3c0, 0x0, 0xc42013a300) /srv/app/src/code.gitea.io/gitea/cmd/serv.go:253 +0x1f67 code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x12b1ba0, 0x146f9c0, 0xc42013a3c0, 0xc420131800, 0x0) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9 code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x14107f1, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x145b443, 0x2f, 0x0, ...) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xb4b code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4201b1a00, 0xc4200101c0, 0x4, 0x4, 0x0, 0x0) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x65f main.main() /srv/app/src/code.gitea.io/gitea/main.go:44 +0x3cd fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` I've tried to run external user syncronization several times but it didn't help, had to revert to an erlier version.
GiteaMirror added the issue/criticalissue/regression labels 2025-11-02 03:34:14 -06:00
Author
Owner

@lunny commented on GitHub (May 20, 2017):

I cannot reproduce it on my macOS, my admin user is a local user.

@lunny commented on GitHub (May 20, 2017): I cannot reproduce it on my macOS, my admin user is a local user.
Author
Owner

@viktike commented on GitHub (May 20, 2017):

I can say it was clearly working in the same exact environment with a85c5ab, that was the one I reverted to.

@viktike commented on GitHub (May 20, 2017): I can say it was clearly working in the same exact environment with a85c5ab, that was the one I reverted to.
Author
Owner

@lunny commented on GitHub (May 21, 2017):

@viktike please confirm #1770 fix this one.

@lunny commented on GitHub (May 21, 2017): @viktike please confirm #1770 fix this one.
Author
Owner

@viktike commented on GitHub (May 21, 2017):

Confirmed fix. Everything is back to normal with b0308d8

@viktike commented on GitHub (May 21, 2017): Confirmed fix. Everything is back to normal with b0308d8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#726