Skip to content

New branches no longer sync to DB after upgrading from 1.20.4 to 1.21.5. #29052

Closed
@seeplusplus

Description

@seeplusplus

Description

Edit:

I'm leaving the original description below, in case it matters later, but I've done more testing and concluded this isn't an issue with the upgrade per se. I am running gitea on a Linux box with one disk mounted on / and a raid5 mdadm array mounted on /data. Normally, my gitea's docker-compose and the data and config dirs are on /data (I am using the exact docker-compose listed here). The "branch sync" issue does start showing up after the 1.21.5 upgrade, but I have confirmed that this behavior happens on even fresh instances of 1.21.5 when those dirs are on /data. Curiously, if I move to a dir on / everything works fine. 1.20 works on /data, that is, without sync issues on pushing new branches, but if upgraded to 1.21 I get sync issues again. Any clues as to why the disk that's running gitea would affect synchronization?

Original post

After upgrading from 1.20.5 to 1.21.5 pushing a new branch to any repo (created before or after the upgrade) doesn't get synced to DB without manually triggering a sync on the admin dashboard. I am able to confirm that the branch does push successfully and does show up on disk, but it's just not showing up in the branch table in my DB.

On two repositories that existed before upgrade:

  • Locally create new branch based on existing branch and push to origin
  • Branch doesn't show up in branch list

On new repository created after upgrade:

  1. Create repo locally and push with fresh main branch.
  2. main shows up in the web UI after push.
  3. Create new branch based on main and push.
  4. Branch does not show up in web UI.
  5. Can repeat 3 as many times as I want, branch never shows up, and if
  6. I add new commits to any number of branches created in steps 3-5, and push they still don't show up.

I thought perhaps this issue:
#28056

and the linked fixes:
#28361
#28403

Would fix it, but these both to have been included in 1.21.5.

I am unable to reproduce this on the Gitea demo site or on a fresh install of Gitea 1.21+

Gitea Version

1.21.5 and 1.21.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

I first created a branch in repo "saboteur" and pushed it (with no commits) at 2024/02/04 17:23:27. After some time I made a commit adding an empty file and pushed it around 17.25.25. Neither time did the new branch show up in the web UI.

https://gist.github.com/seeplusplus/29aafc7e4eb62c01ca84ed26bd4d4d61

Screenshots

No response

Git Version

2.40.1

Operating System

debian 12.4 kernel 6.1.38

How are you running Gitea?

Docker image: gitea/gitea:1.21-rootless, also tested with gitea/gitea:1.21.0-rootless. I am unable to downgrade back to 1.20 to confirm that this issue started in 1.21 because it's impossible to downgrade databases and I made no backup before upgrading. I have tested that gitea:1.21-rooteless works fine on a fresh install however.

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions