Gitea 1.5.0 fails to run (segfaults) #2185

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

Originally created by @tgurr on GitHub (Aug 13, 2018).

  • Gitea version (or commit ref): 1.5.0
  • Git version: 2.18.0
  • Operating system: Linux
  • 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:
Aug 13 15:39:19 localhost systemd[1]: Started Gitea (Git with a cup of tea).
Aug 13 15:39:19 localhost gitea[23535]: panic: runtime error: invalid memory address or nil pointer dereference
Aug 13 15:39:19 localhost gitea[23535]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7be913]
Aug 13 15:39:19 localhost gitea[23535]: goroutine 1 [running]:
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc4202d2ea0, 0xc4202cc691, 0x28, 0xc4204cce48, 0x4ac519)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa3
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc4202d2ea0, 0xc4202cb320, 0x15)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc4202d2ea0, 0xc4202cb320, 0x15, 0x1, 0xc4202cb320)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/modules/setting.NewContext()
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/modules/setting/setting.go:1151 +0x4526
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/routers.GlobalInit()
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/routers/init.go:47 +0x4a
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/cmd.runWeb(0xc42036ea00, 0x0, 0x0)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/cmd/web.go:83 +0xa8
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x10846a0, 0x1270720, 0xc42036ea00, 0xc420094e00, 0x0)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x1217d01, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x123677a, 0x16, 0x0, ...)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa0e
Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc42001a340, 0xc4200b4040, 0x4, 0x4, 0x0, 0x0)
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5b8
Aug 13 15:39:19 localhost gitea[23535]: main.main()
Aug 13 15:39:19 localhost gitea[23535]:         /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/main.go:52 +0x40e
Aug 13 15:39:19 localhost systemd[1]: gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 13 15:39:19 localhost systemd[1]: gitea.service: Failed with result 'exit-code'.

Description

Trying to run 1.5.0 after compiling using go 1.10.3 results in the following error message. Compiling and running the previous Gitea 1.4.3 with the same options works fine. I ran into this when trying to upgrade an instance with 1.4.3 to 1.5.0, but it's also reproducible on another host with no previous Gitea installation/configuration/data present.

Originally created by @tgurr on GitHub (Aug 13, 2018). - Gitea version (or commit ref): 1.5.0 - Git version: 2.18.0 - Operating system: Linux - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` Aug 13 15:39:19 localhost systemd[1]: Started Gitea (Git with a cup of tea). Aug 13 15:39:19 localhost gitea[23535]: panic: runtime error: invalid memory address or nil pointer dereference Aug 13 15:39:19 localhost gitea[23535]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7be913] Aug 13 15:39:19 localhost gitea[23535]: goroutine 1 [running]: Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc4202d2ea0, 0xc4202cc691, 0x28, 0xc4204cce48, 0x4ac519) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa3 Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc4202d2ea0, 0xc4202cb320, 0x15) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc4202d2ea0, 0xc4202cb320, 0x15, 0x1, 0xc4202cb320) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/modules/setting.NewContext() Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/modules/setting/setting.go:1151 +0x4526 Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/routers.GlobalInit() Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/routers/init.go:47 +0x4a Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/cmd.runWeb(0xc42036ea00, 0x0, 0x0) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/cmd/web.go:83 +0xa8 Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x10846a0, 0x1270720, 0xc42036ea00, 0xc420094e00, 0x0) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x1217d01, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x123677a, 0x16, 0x0, ...) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa0e Aug 13 15:39:19 localhost gitea[23535]: code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc42001a340, 0xc4200b4040, 0x4, 0x4, 0x0, 0x0) Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5b8 Aug 13 15:39:19 localhost gitea[23535]: main.main() Aug 13 15:39:19 localhost gitea[23535]: /var/tmp/paludis/build/net-gitea-1.5.0/work/build/src/code.gitea.io/gitea/main.go:52 +0x40e Aug 13 15:39:19 localhost systemd[1]: gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Aug 13 15:39:19 localhost systemd[1]: gitea.service: Failed with result 'exit-code'. ``` ## Description Trying to run 1.5.0 after compiling using go 1.10.3 results in the following error message. Compiling and running the previous Gitea 1.4.3 with the same options works fine. I ran into this when trying to upgrade an instance with 1.4.3 to 1.5.0, but it's also reproducible on another host with no previous Gitea installation/configuration/data present.
GiteaMirror added the status/blockedtype/bug labels 2025-11-02 04:26:27 -06:00
Author
Owner

@lafriks commented on GitHub (Aug 13, 2018):

Can you provide app.ini you are using as it seems to be problem in it.

@lafriks commented on GitHub (Aug 13, 2018): Can you provide app.ini you are using as it seems to be problem in it.
Author
Owner

@rbong commented on GitHub (Aug 14, 2018):

I am getting the same error with 1.5.0. If I don't comment out either of the last two lines from app.ini, which I pulled from app.ini.example.

[U2F]
APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
@rbong commented on GitHub (Aug 14, 2018): I am getting the same error with 1.5.0. If I don't comment out either of the last two lines from `app.ini`, which I pulled from `app.ini.example`. ``` [U2F] APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/ TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/ ```
Author
Owner

@tgurr commented on GitHub (Aug 14, 2018):

Commenting out the [U2F] section does the trick or me as well, thanks @rbong.

@tgurr commented on GitHub (Aug 14, 2018): Commenting out the [U2F] section does the trick or me as well, thanks @rbong.
Author
Owner

@eripa commented on GitHub (Aug 19, 2018):

Same for me. Segfaulting unless I remove the U2F section. U2F still works with it removed though.. so maybe it's no longer needed?

@eripa commented on GitHub (Aug 19, 2018): Same for me. Segfaulting unless I remove the U2F section. U2F still works with it removed though.. so maybe it's no longer needed?
Author
Owner

@lafriks commented on GitHub (Aug 19, 2018):

If removed it gitea uses defaults as given in sample app.ini file

@lafriks commented on GitHub (Aug 19, 2018): If removed it gitea uses defaults as given in sample app.ini file
Author
Owner

@eripa commented on GitHub (Aug 19, 2018):

Ok. This is the one I had:

[U2F]
APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s
TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s

I grabbed the U2F section from here: https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample#L630

(the only difference was that it had trailing / on each setting)

and added that instead of nothing and it got back into segfaulting. There seems to be a difference between having this configured at all and just leaving it out.

@eripa commented on GitHub (Aug 19, 2018): Ok. This is the one I had: ``` [U2F] APP_ID = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s TRUSTED_FACETS = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s ``` I grabbed the `U2F` section from here: https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample#L630 (the only difference was that it had trailing `/` on each setting) and added that instead of nothing and it got back into segfaulting. There seems to be a difference between having this configured at all and just leaving it out.
Author
Owner

@lafriks commented on GitHub (Aug 19, 2018):

I think that / at the end is critical

@lafriks commented on GitHub (Aug 19, 2018): I think that `/` at the end is critical
Author
Owner

@eripa commented on GitHub (Aug 19, 2018):

I tried with the /, same issue.

On Aug 19, 2018, at 12:02, Lauris BH notifications@github.com wrote:

I think that / at the end is critical


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@eripa commented on GitHub (Aug 19, 2018): I tried with the /, same issue. > On Aug 19, 2018, at 12:02, Lauris BH <notifications@github.com> wrote: > > I think that / at the end is critical > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@rain0r commented on GitHub (Oct 11, 2018):

Edit: Downgrading to 1.4.3 fixed the issue.

I'm experiencing the same error since upgrading to gitea-1.5.2.

Gitea version (or commit ref): 1.5.2
Git version: 2.19.1
Operating system: Gentoo Linux
Database: PostgreSQL 10.5

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

goroutine 1 [running]:
code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc0002afc20, 0xc000041861, 0x28, 0xc0004eee70, 0x4af6f9)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa4
code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc0002afc20, 0xc0002ad320, 0x14)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d
code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc0002afc20, 0xc0002ad320, 0x14, 0x1, 0xc0002ad320)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f
code.gitea.io/gitea/modules/setting.NewContext()
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/modules/setting/setting.go:1151 +0x45f4
code.gitea.io/gitea/routers.GlobalInit()
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/routers/init.go:47 +0x4a
code.gitea.io/gitea/cmd.runWeb(0xc00032e8c0, 0x0, 0x0)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/cmd/web.go:83 +0xaa
code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x12e1b80, 0x14dc4f0, 0xc00032e8c0, 0xc0000a9800, 0x0)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad
code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x146aae8, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1490463, 0x16, 0x0, ...)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0x96d
code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc0002844e0, 0xc0000aa040, 0x4, 0x4, 0x0, 0x0)
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5a2
main.main()
        /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/main.go:52 +0x3a7

@rain0r commented on GitHub (Oct 11, 2018): **Edit:** Downgrading to 1.4.3 fixed the issue. I'm experiencing the same error since upgrading to gitea-1.5.2. Gitea version (or commit ref): 1.5.2 Git version: 2.19.1 Operating system: Gentoo Linux Database: PostgreSQL 10.5 ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7f3654] goroutine 1 [running]: code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).transformValue(0xc0002afc20, 0xc000041861, 0x28, 0xc0004eee70, 0x4af6f9) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:123 +0xa4 code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).String(0xc0002afc20, 0xc0002ad320, 0x14) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:130 +0x3d code.gitea.io/gitea/vendor/gopkg.in/ini%2ev1.(*Key).MustString(0xc0002afc20, 0xc0002ad320, 0x14, 0x1, 0xc0002ad320) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/gopkg.in/ini.v1/key.go:202 +0x2f code.gitea.io/gitea/modules/setting.NewContext() /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/modules/setting/setting.go:1151 +0x45f4 code.gitea.io/gitea/routers.GlobalInit() /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/routers/init.go:47 +0x4a code.gitea.io/gitea/cmd.runWeb(0xc00032e8c0, 0x0, 0x0) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/cmd/web.go:83 +0xaa code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x12e1b80, 0x14dc4f0, 0xc00032e8c0, 0xc0000a9800, 0x0) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x146aae8, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1490463, 0x16, 0x0, ...) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0x96d code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc0002844e0, 0xc0000aa040, 0x4, 0x4, 0x0, 0x0) /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5a2 main.main() /var/tmp/portage/www-apps/gitea-1.5.2/work/gitea-1.5.2/src/code.gitea.io/gitea/main.go:52 +0x3a7 ```
Author
Owner

@lunny commented on GitHub (Oct 11, 2018):

It seems it's a upstream library gopkg.in/ini.v1's bug.

@lunny commented on GitHub (Oct 11, 2018): It seems it's a upstream library `gopkg.in/ini.v1`'s bug.
Author
Owner

@stefangweichinger commented on GitHub (Oct 17, 2018):

I also see gitea-1.5.2 fail with the U2F-section in app.ini ... and initially I added that section because adding my U2F-key (yubikey) does not work. The button "Add Security Key" does nothing here.

The URL /user/settings/security/u2f/request_register fails ... according to the 404 mentioned in my dev-tools (chrome).

@stefangweichinger commented on GitHub (Oct 17, 2018): I also see gitea-1.5.2 fail with the U2F-section in app.ini ... and initially I added that section because adding my U2F-key (yubikey) does not work. The button "Add Security Key" does nothing here. The URL /user/settings/security/u2f/request_register fails ... according to the 404 mentioned in my dev-tools (chrome).
Author
Owner

@ArchangeGabriel commented on GitHub (Nov 24, 2018):

Still present with 1.6.0.

@ArchangeGabriel commented on GitHub (Nov 24, 2018): Still present with 1.6.0.
Author
Owner

@mckaygerhard commented on GitHub (Dec 11, 2018):

still present at 1.5.3 and 1.6.0, still present at master!, similar as #5526 but not same, in that issue i talk about more pointed debug messages at errors

@mckaygerhard commented on GitHub (Dec 11, 2018): still present at 1.5.3 and 1.6.0, still present at master!, similar as #5526 but not same, in that issue i talk about more pointed debug messages at errors
Author
Owner

@mckaygerhard commented on GitHub (Dec 23, 2018):

today still at 1.6.2 U2F Block In app.ini Causes A Segfault

@mckaygerhard commented on GitHub (Dec 23, 2018): today still at 1.6.2 U2F Block In app.ini Causes A Segfault
Author
Owner

@alyandon commented on GitHub (Jan 10, 2019):

Looks like the problem is that PROTOCOL, DOMAIN and HTTP_PORT keys are not declared in the U2F section of the example file so the ini parser (see line 120 of transformValue() in key.go) falls back to looking for those keys in the DEFAULT section, ignores the returned error and blindly continues with the assumption that they must have been found instead of actually verifying that they were found.

I'm not sure what the expected behavior of the ini parser is but it should be easy enough to define those keys in the sample ini file in the default or U2F sections to avoid the panic on startup.

@alyandon commented on GitHub (Jan 10, 2019): Looks like the problem is that PROTOCOL, DOMAIN and HTTP_PORT keys are not declared in the U2F section of the example file so the ini parser (see line 120 of transformValue() in key.go) falls back to looking for those keys in the DEFAULT section, ignores the returned error and blindly continues with the assumption that they must have been found instead of actually verifying that they were found. I'm not sure what the expected behavior of the ini parser is but it should be easy enough to define those keys in the sample ini file in the default or U2F sections to avoid the panic on startup.
Author
Owner

@mckaygerhard commented on GitHub (Jan 10, 2019):

well by defining those keys or remove the sectin solves the situation, but:
yeah, now 1.7.X development and bug still present .. seems 1.6.X are default stable and the bugs its the real stable and here definitivelly

@mckaygerhard commented on GitHub (Jan 10, 2019): well by defining those keys or remove the sectin solves the situation, but: yeah, now 1.7.X development and bug still present .. seems 1.6.X are default stable and the bugs its the real stable and here definitivelly
Author
Owner

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

A solution might be to remove the U2F section from the example config since this section is only required by a small minority of people using Gitea on multiple domains. The documentation will stay in the config cheat sheet.

@jonasfranz commented on GitHub (Jan 16, 2019): A solution might be to remove the U2F section from the example config since this section is only required by a small minority of people using Gitea on multiple domains. The documentation will stay in the config cheat sheet.
Author
Owner

@alyandon commented on GitHub (Jan 17, 2019):

Someone should put together a minimal test case and report the issue upstream. I took a peek at their repository and they seem to be willing to fix issues but no one appears to have reported this particular panic.

The example config needs to change regardless because the most sane thing for upstream to do would be to return an error instead of panicking which would still stop gitea from starting up. At least, I wouldn't want gitea to start up if the config it is using has errors.

@alyandon commented on GitHub (Jan 17, 2019): Someone should put together a minimal test case and report the issue upstream. I took a peek at their repository and they seem to be willing to fix issues but no one appears to have reported this particular panic. The example config needs to change regardless because the most sane thing for upstream to do would be to return an error instead of panicking which would still stop gitea from starting up. At least, I wouldn't want gitea to start up if the config it is using has errors.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2185