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

Import Unadopted repositories - nothing happens #21632

Closed
KazzmanK opened this issue Oct 30, 2022 · 8 comments · Fixed by #21646
Closed

Import Unadopted repositories - nothing happens #21632

KazzmanK opened this issue Oct 30, 2022 · 8 comments · Fixed by #21646
Labels

Comments

@KazzmanK
Copy link
Contributor

Description

I`ve copied existing bare repository from Gitblit server. Put it into folder as said in #18390 . Now I have repository searched through UI.
After clicking on Yes, Adopt - nothing happens, UI brings me back to repository list.
In DevTools I see unadpted/303, and after redirect - repos/200.
In logs there are only templates lines

2022/10/30 12:08:17 ...s/context/context.go:219:HTML() [D] [635e3f01] Template: admin/repo/unadopted
2022/10/30 12:09:29 ...s/context/context.go:219:HTML() [D] [635e3f49-2] Template: admin/repo/list

Tried to set dev RUN_MODE - nothing changed.
Tried to check repository if it is valid bare -

git clone as.git
Cloning into 'as'...
done.

Happens under windows.

My username is Administrator, but disk path is administrator/as.git.
Also tried to rename user to all-lowercase, all the same.

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Nothig notable to share

Git Version

2.38

Operating System

Windows server 10.0

How are you running Gitea?

Fresh download, as service and from command line

Database

SQLite

@lunny
Copy link
Member

lunny commented Oct 30, 2022

Is the repo searched in the unadopted repositories UI?

@KazzmanK
Copy link
Contributor Author

Yes, it is,
As I`m complaining - nothing happens after I click
image
image
After clicking Yes it brings back me to
image

And this repository remains unimported

@lunny
Copy link
Member

lunny commented Oct 30, 2022

Could you check if the repository does exist?

@KazzmanK
Copy link
Contributor Author

KazzmanK commented Oct 30, 2022

I'm not sure what you actually mean.
You are asking if I'm trying to import non-existing repo while it was found by UI?

From the beginning I was able to git clone it, once again :

backlog
C:\Gitea\gitea-repositories\username>dir
 Том в устройстве C имеет метку System
 Серийный номер тома: D8FA-8779

 Содержимое папки C:\Gitea\gitea-repositories\username

30.10.2022  22:50    <DIR>          .
30.10.2022  22:50    <DIR>          ..
30.10.2022  22:48    <DIR>          as.git
21.10.2022  10:13    <DIR>          ffp-su.git
               0 файлов              0 байт
               4 папок  42 257 829 888 байт свободно

C:\Gitea\gitea-repositories\username>git clone as.git
Cloning into 'as'...
done.

C:\Gitea\gitea-repositories\username>cd as

C:\Gitea\gitea-repositories\username\as>git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

C:\Gitea\gitea-repositories\username\as>

image
image

But after clicking Yes repository remains unimported

image

What I have found so far :
If I click Delete - it is not working too! Repo remains in its folder.

screenshot

image

@KazzmanK
Copy link
Contributor Author

KazzmanK commented Oct 30, 2022

Update
it works with gitea 1.15.0
it is NOT working with 1.16.0
it is NOT working with 1.16.6
it is NOT working with 1.17.3
It works with 1.15.10
Checking 1.15.11....

And, yes, it works in 1.15.11.

So, something happened between 1.15.11 and 1.16.0
I've looked through commits, but I`m far from Golang :(

@lunny
Copy link
Member

lunny commented Oct 31, 2022

I couldn't reproduce this in my macOS.

Tried to set dev RUN_MODE - nothing changed.
You need to restart Gitea and you should find more logs.

@KazzmanK
Copy link
Contributor Author

Know nothing about macos, my install is on windows.
Here are logs in Trace and Debug modes with DEV mode.
app.ini.txt
trace.log
debug.log

ini file is renamed to txt to make it attachable to github.

So far workaround for initial migration to Gitea

  1. Install 1.15.x version
  2. Mass import your repositories via Unadopted
  3. Upgrade to recent Gitea

No workaround for existing installations

@KazzmanK
Copy link
Contributor Author

KazzmanK commented Oct 31, 2022

I have finally got it adoped by using API, not UI.

And finally found a bug.

In HTML form behind YES button slash must be RIGHT (as on screenshot), but in recent versions under Win it is LEFT instead.
That is why it was working on your Mac and not on Win, I think.
More to say, I`ve found that in unadopted repositories list slash direction is also changed to "incorrect" after 1.15.11
fixing it to RIGHT in DevTools solves a problem.
image

zeripath added a commit to zeripath/gitea that referenced this issue Oct 31, 2022
A bug was introduced in go-gitea#17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix go-gitea#21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Oct 31, 2022
A bug was introduced in #17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix #21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Oct 31, 2022
Backport go-gitea#21646

A bug was introduced in go-gitea#17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix go-gitea#21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Oct 31, 2022
Backport go-gitea#21646

A bug was introduced in go-gitea#17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix go-gitea#21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Nov 1, 2022
Backport #21646

A bug was introduced in #17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix #21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Nov 1, 2022
Backport #21646

A bug was introduced in #17865 where filepath.Join is used to join
putative unadopted repository owner and names together. This is
incorrect as these names are then used as repository names - which shoud
have the '/' separator. This means that adoption will not work on
Windows servers.

Fix #21632

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants