Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to repository results in "PANIC: runtime error: invalid memory address or nil pointer dereference" #31330

Closed
gmaxwell447 opened this issue Jun 12, 2024 · 1 comment · Fixed by #31333
Labels
issue/workaround it is or has a workaround type/bug
Milestone

Comments

@gmaxwell447
Copy link

gmaxwell447 commented Jun 12, 2024

Description

We have been porting repositories from a legacy Gitlab instance, and have had no issues except for one particular repository. This repo could not be directly migrated by Gitea; the raw Gitlab repos (*.git) were dropped into the appropriate owner directory on Gitea and successfully adopted by Gitea using the documented process. Everything looks great and the repo can be successfully cloned over HTTP or SSH.

However, any sort of push operation (commit, branch delete) results in a panic from an "invalid memory address or nil pointer dereference." The gist includes three different panic origins and their stack traces.

The repo in particular has a few large binary blobs, 17 branches, 630 commits, 235 tags, and occupies 58 MiB. I will note that the ".pack" file under objects/pack occupies 79553430 bytes. We're willing to prune out old commits and branches, but would have to do that off Gitea since push is currently broken, if that is our only option.

I would attempt to reproduce it on the Gitea demo site but the repo contains proprietary IP.

Thank you!

Gitea Version

1.22.0+41-g3fcf865a4b

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/gmaxwell447/b45ee124ad25e04bdc39619a254d6247

Screenshots

No response

Git Version

2.39.3

Operating System

Rocky Release 9.3 with SELinux enabled, Red Hat Server Level 1 Security Profile

How are you running Gitea?

I have tried the downloaded 1.22.0 binary (gitea_1.22.0_dev-1092-g02d4a62e3) along with the nightly build (1.22.0+41-g3fcf865a4b). Gitea is running on a Hyper-V hosted VM (no container), launched as a systemd service (service file included in gist).

Database

MySQL/MariaDB

@wxiaoguang
Copy link
Contributor

A workaround is to run the "Sync branches" from the admin dashboard panel.

@wxiaoguang wxiaoguang added the issue/workaround it is or has a workaround label Jun 12, 2024
@lunny lunny added this to the 1.22.1 milestone Jun 12, 2024
lunny added a commit that referenced this issue Jun 12, 2024
Fix #31330
Fix #31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jun 12, 2024
Fix go-gitea#31330
Fix go-gitea#31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.
silverwind pushed a commit that referenced this issue Jun 12, 2024
Backport #31333 by @lunny

Fix #31330
Fix #31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 10, 2024
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
Fix adopt repository has empty object name in database (go-gitea#31333)

Fix go-gitea#31330
Fix go-gitea#31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.

(cherry picked from commit 1968c22)

With tests services/repository/adopt_test.go

(cherry picked from commit 8efef06)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/workaround it is or has a workaround type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants