Skip to content

Update of repository mirror settings cause: "PANIC: runtime error" #18204

Closed
@zpericic

Description

@zpericic

Gitea Version

0acc6a4 - main branch

Git Version

2.33.1

Operating System

No response

How are you running Gitea?

git clone https://github.com/go-gitea/gitea
git checkout main
TAGS="bindata" make build

Running using systemd

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Update of repository mirror settings cause:

2022/01/07 19:26:36 routers/web/base.go:130:1() [E] PANIC: runtime error: invalid memory address or nil pointer dereference
    /usr/lib/golang/src/runtime/panic.go:212 (0x437afa)
        panicmem: panic(memoryError)
    /usr/lib/golang/src/runtime/signal_unix.go:734 (0x451ad2)
        sigpanic: panicmem()
    /srv/gitea/gitea/routers/web/repo/setting.go:208 (0x215ca9f)
        SettingsPost: ctx.Repo.Mirror.EnablePrune = form.EnablePrune
    /srv/gitea/gitea/modules/web/route.go:74 (0x207f703)
        Wrap.func1: t(ctx)
    /usr/lib/golang/src/net/http/server.go:2050 (0x7d70c3)
        HandlerFunc.ServeHTTP: f(w, r)

It seams that "ctx.Repo.Mirror" is nil.

Tried to trace it to "modules/context/repo.go" and code under repo.IsMirror in repoAssignment() function is evaluated. But no luck.

If someone could at least give a pointer...

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions