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

Error during Gitea 1.21.x upgrade Add RemoteAddress to mirrors failed No such remote 'origin' #29132

Closed
tuzhis opened this issue Feb 11, 2024 · 5 comments
Labels

Comments

@tuzhis
Copy link

tuzhis commented Feb 11, 2024

Description

I encountered an error while upgrading Gitea from version 1.20.x to 1.21.x. the upgrade process fails with an error message, whereas the previous version (1.20.x) was working fine.

routers/init.go:69:mustInitCtx() [F] code.gitea.io/gitea/routers/common.InitDBEngine(ctx) failed: migrate: migration[276]: Add RemoteAddress to mirrors failed: get remote origin's address of xxx/xxx-sales failed: exit status 2 - error: No such remote 'origin'
 - error: No such remote 'origin'

Gitea Version

1.21.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

MySQL/MariaDB

@go-compile
Copy link

I'm experiencing the same issue, however I beleive I have found a solution. By navigating to your Gitea's repositories folder and manually adding a remote origin with the name "origin" this resolves the issue. I believe the issue is caused by mirrors without a remote address.

Steps to resolution

  1. Open a terminal on your server and using Docker logs find the repository which is throwing the error (e.g. "xxx/xxx-sales").
  2. Find and navigate to the location gitea/git/repositories (relative to your Gitea volume).
  3. Open the repository which is throwing an error and add a remote with the name origin git remote add origin https://github.com/xxx/xxx.
  4. Repeat from step 1 until no more errors show.

@delvh
Copy link
Member

delvh commented Feb 16, 2024

Yes, that's exactly what the error means.
The only weird thing is that there are mirrors without origin in the first place.
This should not be possible…

@go-compile
Copy link

go-compile commented Feb 16, 2024

Yes, that's exactly what the error means. The only weird thing is that there are mirrors without origin in the first place. This should not be possible…

In my case I had to fix a broken Gitea instance by manually placing repository files and adopting them, among other things; all of which were done many months ago. This is likely the cause.

@tuzhis
Copy link
Author

tuzhis commented Feb 16, 2024

2. gitea/git/repositories

I'm experiencing the same issue, however I beleive I have found a solution. By navigating to your Gitea's repositories folder and manually adding a remote origin with the name "origin" this resolves the issue. I believe the issue is caused by mirrors without a remote address.

Steps to resolution

  1. Open a terminal on your server and using Docker logs find the repository which is throwing the error (e.g. "xxx/xxx-sales").
  2. Find and navigate to the location gitea/git/repositories (relative to your Gitea volume).
  3. Open the repository which is throwing an error and add a remote with the name origin git remote add origin https://github.com/xxx/xxx.
  4. Repeat from step 1 until no more errors show.

@go-compile @delvh thank you for the response, everything is working properly after adding all the remotes.
previously, I thought it was a bug because there was no "origin" in any of the repository under the gitea/git/repositories path.

@tuzhis tuzhis closed this as completed Feb 16, 2024
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants