Skip to content

Error 500 when accessing branches in repo #29936

Closed
@davama

Description

@davama

Description

Good Day,

Hope I've posted all relevant info.

We have a repo inside an org, which does not allow us to view its branches via the UI. We had several branches that were automatically created with our pipeline via the API. We've been doing this for several months now. Only yesterday we noticed that we could not see the branches in the UI (this was never the case before). We were under version 1.21.7 and were hoping updating to 1.21.8 would help, but nothing.

Since we could see all the branches via the API, we decided to delete all the branches via API except for main. Now only main shows via the API. Interestingly under the UI, it still shows that 2 Branches exists. (see screenshots)

When i click on the tto-device-discovery branch, i get a 404 not found code page, which should be correct (see screenshot)

Looking at other tickets, i check permissions on the filesystem, but nothing interesting

git-1:/data/git/repositories/sot/netbox-sot.git$ pwd
/data/git/repositories/sot/netbox-sot.git
git-1:/data/git/repositories/sot/netbox-sot.git$ ls -al
total 196
drwxr-xr-x    8 git      git            150 Mar 20 13:22 .
drwxr-xr-x   14 git      git           4096 Mar  6 23:04 ..
-rw-r--r--    1 git      git             21 May  9  2023 HEAD
drwxr-xr-x    2 git      git              6 May  9  2023 branches
-rw-r--r--    1 git      git             66 Mar 20 13:22 config
-rw-r--r--    1 git      git             73 May  9  2023 description
drwxr-xr-x    6 git      git           4096 Mar 17 02:07 hooks
drwxr-xr-x    2 git      git             33 Mar 20 13:24 info
drwxr-xr-x    3 git      git             30 Mar 19 11:26 logs
drwxr-xr-x  260 git      git           8192 Mar 20 13:24 objects
-rw-r--r--    1 git      git         164524 Mar 20 13:22 packed-refs
drwxr-xr-x    5 git      git             43 Jul 17  2023 refs

Anything I can do to resolve this?

Below are the logs

2024/03/20 12:56:57 ...repository/branch.go:141:loadOneBranch() [E] CountDivergingCommits: exit status 128 - fatal: ambiguous argument 'main...refs/heads/tto-device-discovery': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
 - fatal: ambiguous argument 'main...refs/heads/tto-device-discovery': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
2024/03/20 12:56:57 ...eb/routing/logger.go:78:func1() [W] router: failed    GET /sot/netbox-sot/branches for [<redacted>]:0, panic in 65.6ms @ repo/branch.go:37(repo.Branches), err=runtime error: invalid memory address or nil pointer dereference
2024/03/20 12:56:57 ...rs/common/errpage.go:26:RenderPanicErrorPage() [E] PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:914 (0x43eefe)
/go/src/code.gitea.io/gitea/modules/web/routing/logger_manager.go:116 (0x1ab40e8)
/usr/local/go/src/runtime/panic.go:914 (0x43eefe)
/usr/local/go/src/runtime/panic.go:261 (0x4566b7)
/usr/local/go/src/runtime/signal_unix.go:861 (0x456685)
/go/src/code.gitea.io/gitea/services/repository/branch.go:187 (0x1e3c44e)
/go/src/code.gitea.io/gitea/services/repository/branch.go:103 (0x1e3b88e)
/go/src/code.gitea.io/gitea/routers/web/repo/branch.go:56 (0x251de6f)
/usr/local/go/src/reflect/value.go:596 (0x4f23a6)
/usr/local/go/src/reflect/value.go:380 (0x4f1478)
/go/src/code.gitea.io/gitea/modules/web/handler.go:166 (0x1abd75b)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/chain.go:31 (0x1ab4745)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1ab7693)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/middleware/get_head.go:37 (0x24e917b)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1abd7f7)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/context/context.go:223 (0x1bd1d0e)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/gitea.com/go-chi/[email protected]/session.go:257 (0x1b2a755)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 (0x1ab5335)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:316 (0x1ab6c1a)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1ab7693)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 (0x1ab5335)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:316 (0x1ab6c1a)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1ab7693)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/routing/logger_manager.go:122 (0x1ab3f78)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/chi-middleware/[email protected]/middleware.go:37 (0x2433fd3)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:46 (0x24351f2)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:37 (0x2434d75)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:100 (0x2434335)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1abda03)
/usr/local/go/src/net/http/server.go:2136 (0x9a42a8)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:90 (0x1ab52f4)
/go/src/code.gitea.io/gitea/modules/web/route.go:163 (0x1abee27)
/usr/local/go/src/net/http/server.go:2938 (0x9a6f8d)
/usr/local/go/src/net/http/server.go:2009 (0x9a2e73)
/usr/local/go/src/runtime/asm_amd64.s:1650 (0x475b00)

Screenshots

2024-03-20_09-12
2024-03-20_09-16
2024-03-20_09-20

Gitea Version

1.21.8

Can you reproduce the bug on the Gitea demo site?

No

Operating System

Rocky Linux 9 (gitea inside docker)

Browser Version

Google Chrome Version 120.0.6099.224 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions