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

Unadopted Repositories - Adopt Files results in 500 Internal Server Error #18390

Closed
sabyasachi-basu-i opened this issue Jan 24, 2022 · 8 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@sabyasachi-basu-i
Copy link

Gitea Version

1.15.9

Git Version

2.31.1

Operating System

Ubuntu 18.04.5 LTS

How are you running Gitea?

used one of gitea downloads, Installation from binary

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

No response

Screenshots

Err_Gitea

@bedwardly-down
Copy link

bedwardly-down commented Jan 24, 2022

What's your Dev console say (hit <f12> to pull it up)? Also, does the git user own the repos on Ubuntu or does it still show the old user / root?

@sabyasachi-basu-i
Copy link
Author

sabyasachi-basu-i commented Jan 25, 2022 via email

@lunny
Copy link
Member

lunny commented Jan 25, 2022

It says the below error: POST https://git.innowise.us/admin/repos/unadopted 500 (Internal Server Error) @.*** @.*** From: Brandon D @.> Sent: Monday, January 24, 2022 23:31 To: go-gitea/gitea @.> Cc: Sabyasachi Basu @.>; Author @.> Subject: Re: [go-gitea/gitea] Unadopted Repositories - Adopt Files results in 500 Internal Server Error (Issue #18390) What's your Dev console say (hit to pull it up)? Also, does the git user own the repos on Ubuntu or does it still show the old user / root? — Reply to this email directly, view it on GitHub<#18390 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOFP56IZKS5SDOAVCLX3IO3UXWHWBANCNFSM5MV3ECCA. You are receiving this because you authored the thread.Message ID: @.@.>>

It didn't include any useful information to help to resolve the problem.
You could get the error from backend console or log file.
Or you temporarily can change RUN_MODE to dev in app.ini and the error will be shown in UI.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jan 25, 2022
@sabyasachi-basu-i
Copy link
Author

sabyasachi-basu-i commented Jan 25, 2022 via email

@lunny
Copy link
Member

lunny commented Jan 25, 2022

Is that repository name contains capital letters? I cannot reproduce it locally.

@sabyasachi-basu-i
Copy link
Author

no. it's all small case.
PFA the image for reference, I took a snap from SSH session as well.

gitea_fE2

@zeripath
Copy link
Contributor

zeripath commented Jan 25, 2022

You have not provided us with the correct logs. The logs you keep giving us are router logs.

The issue proforma kindly asks you to read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems in order that you can easily set up debug logging to give us the logs most easily. Why haven't you read this?


However, the error received in the "front-end" may actually be enough to diagnose what's going on:

createDelegateHooks: openRepository: exit status 128 - fatal: not a git repository (or any of the parent directories): .git

This is failing here:

gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath())
if err != nil {
return fmt.Errorf("openRepository: %v", err)

This means one of several things:

  • The path you are trying to adopt is not a bare git repository.
  • The path you are trying to adopt is not completely owned by and readable by Gitea.

In either case the situation is not resolvable by Gitea.

By attempting to adopt a path as a repository you have promised to Gitea that that path is a repository like Gitea's own repositories.

It is clear that the path you're trying to adopt is not.

This path must be a bare repository owned by the Gitea user and read-writeable completely by the Gitea user. It should ideally be an old repository that a gitea created.

Examine the "repository" on disk yourself and if you're certain that it does represent a bare git repository you could: a) rediscuss here b) move it to another place and repush it up to Gitea.

As this is an administrator only feature - we have left error handling somewhat unfriendly - the point being you as the administrator are supposed to be able to look in to your own logs and are supposed to know if the path you're trying to adopt is or is not a repository.


But please in future read the issue proforma - wasting our time not giving us the logs when we have written clear instructions on how to get them is not on.

@sabyasachi-basu-i
Copy link
Author

@zeripath my sincerest apologies! It's a massive application. I am indeed at fault not to go through every possible diagnosis before raising an issue.
I'll close this issue, go back and follow the debugging steps as mentioned.
And, again, I am genuinely sorry for wasting your time.

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

4 participants