panic: runtime error: invalid memory address or nil pointer dereference #1944

Closed
opened 2025-11-02 04:18:41 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @sitilge on GitHub (Jun 16, 2018).

  • Gitea version (or commit ref): r6429.85414d8b7
  • Git version: 2.17.1
  • Operating system: arch 4.16.13
  • 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

Jun 16 19:26:58 systemd[1]: Started Gitea (Git with a cup of tea).
Jun 16 19:26:58 systemd[1]: Stopped Gitea (Git with a cup of tea).
Jun 16 19:26:58 systemd[1]: gitea.service: Scheduled restart job, restart counter is at 148.
Jun 16 19:26:58 systemd[1]: gitea.service: Service hold-off time over, scheduling restart.
Jun 16 19:26:55 systemd[1]: gitea.service: Failed with result 'exit-code'.
Jun 16 19:26:55 systemd[1]: gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/main.go:52 +0x40e
Jun 16 19:26:55 gitea[3594]: main.main()
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5b8
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4205b41a0, 0xc42003a0c0, 0x4, 0x4, 0x0, 0x0)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa0e
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x164cc4a, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1670974, 0x16, 0x0, ...)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x1412f00, 0x16ef910, 0xc4205be3c0, 0xc4202b1700, 0x0)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/cmd/web.go:83 +0xa8
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/cmd.runWeb(0xc4205be3c0, 0x0, 0x0)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/routers/init.go:47 +0x4a
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/routers.GlobalInit()
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/modules/setting/setting.go:1147 +0x444a
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/modules/setting.NewContext()
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc4205e1a40, 0xc4205d7880, 0x15, 0x1, 0xc4205d7880)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc4205e1a40, 0xc4205d7880, 0x15)
Jun 16 19:26:55 gitea[3594]:         /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa3
Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc4205e1a40, 0xc4205cb801, 0x27, 0xc42051ae58, 0x4abbc9)
Jun 16 19:26:55 gitea[3594]: goroutine 1 [running]:
Jun 16 19:26:55 gitea[3594]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7bfc73]
Jun 16 19:26:55 gitea[3594]: panic: runtime error: invalid memory address or nil pointer dereference
Originally created by @sitilge on GitHub (Jun 16, 2018). - Gitea version (or commit ref): r6429.85414d8b7 - Git version: 2.17.1 - Operating system: arch 4.16.13 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description ```` Jun 16 19:26:58 systemd[1]: Started Gitea (Git with a cup of tea). Jun 16 19:26:58 systemd[1]: Stopped Gitea (Git with a cup of tea). Jun 16 19:26:58 systemd[1]: gitea.service: Scheduled restart job, restart counter is at 148. Jun 16 19:26:58 systemd[1]: gitea.service: Service hold-off time over, scheduling restart. Jun 16 19:26:55 systemd[1]: gitea.service: Failed with result 'exit-code'. Jun 16 19:26:55 systemd[1]: gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/main.go:52 +0x40e Jun 16 19:26:55 gitea[3594]: main.main() Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5b8 Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4205b41a0, 0xc42003a0c0, 0x4, 0x4, 0x0, 0x0) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa0e Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x164cc4a, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1670974, 0x16, 0x0, ...) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x1412f00, 0x16ef910, 0xc4205be3c0, 0xc4202b1700, 0x0) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/cmd/web.go:83 +0xa8 Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/cmd.runWeb(0xc4205be3c0, 0x0, 0x0) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/routers/init.go:47 +0x4a Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/routers.GlobalInit() Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/modules/setting/setting.go:1147 +0x444a Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/modules/setting.NewContext() Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc4205e1a40, 0xc4205d7880, 0x15, 0x1, 0xc4205d7880) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc4205e1a40, 0xc4205d7880, 0x15) Jun 16 19:26:55 gitea[3594]: /tmp/trizen/gitea-git/src/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa3 Jun 16 19:26:55 gitea[3594]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc4205e1a40, 0xc4205cb801, 0x27, 0xc42051ae58, 0x4abbc9) Jun 16 19:26:55 gitea[3594]: goroutine 1 [running]: Jun 16 19:26:55 gitea[3594]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7bfc73] Jun 16 19:26:55 gitea[3594]: panic: runtime error: invalid memory address or nil pointer dereference ````
Author
Owner

@francoism90 commented on GitHub (Jun 18, 2018):

#4255 - Could you try to change this in app.ini:

;[U2F]
; Two Factor authentication with security keys
; https://developers.yubico.com/U2F/App_ID.html
;APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s
; Comma seperated list of truisted facets
;TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s
@francoism90 commented on GitHub (Jun 18, 2018): #4255 - Could you try to change this in `app.ini`: ``` ;[U2F] ; Two Factor authentication with security keys ; https://developers.yubico.com/U2F/App_ID.html ;APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s ; Comma seperated list of truisted facets ;TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s ```
Author
Owner

@sitilge commented on GitHub (Jun 21, 2018):

@francoism90 that solved it, thank you.

@sitilge commented on GitHub (Jun 21, 2018): @francoism90 that solved it, thank you.
Author
Owner

@belidzs commented on GitHub (Jan 12, 2019):

This should be removed from app.ini.sample until this issue is fixed or gitea should throw a more sensible error message. I have run into the same issue and it was very hard to trace down the issue.

@belidzs commented on GitHub (Jan 12, 2019): This should be removed from `app.ini.sample` until this issue is fixed or gitea should throw a more sensible error message. I have run into the same issue and it was very hard to trace down the issue.
Author
Owner

@matoro commented on GitHub (Jan 16, 2019):

Agreed, just ran into this on a 100% vanilla install. Crazy that a default config (!) results in a segfault.

@matoro commented on GitHub (Jan 16, 2019): Agreed, just ran into this on a 100% vanilla install. Crazy that a default config (!) results in a segfault.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1944