mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-10 22:06:34 -05:00
On Prem Azure Devops Migration fails #8980
Open
opened 2025-11-02 08:24:43 -06:00 by GiteaMirror
·
15 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
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c1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#8980
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bjornbouetsmith on GitHub (May 21, 2022).
Hi,
Any plans to support migration from on prem Azure DevOps (git) to gitea?
I have tried and it just fails - possibly because authentication in azure devops is not using basic authentication but something else?
It just logs:
I am 100% certain that the username/password combo is correct, since I use it on a daily basis - and also can access the repo from another service - using the exact same combo.
I also have this in my app.ini
My guess is that it is probably because I have a "special" character in my password and when I turn on debug logging I can see the url it tries to clone - and if I copy/paste that URL and do a manual git clone from the prompt - I also get the same:
If I do a
And manually type in the password - it just works.
I have no idea if its some kind of escaping that happens that messes up the http request inside git - or if its simply wrongly escaped from gitea's side.
Do I just have to accept this?
According to "people" on the internet, then it seems to have been escaped correctly according to https://en.wikipedia.org/wiki/Percent-encoding - but no dice - I have used other systems in the past that did not like my password.
To give a hint about what character that messes it up - its
#- which I know is bad in a url - but I refuse to change my password just because some systems do not like it.wget on the other hand just accepts the encoded url - so I am beginning to think its a bug in git.
Edit:
Just tested on a windows machine and git clone just works with the encoded url (git version 2.33) - on the gitea server (Rocky Linux) - git version 2.27.0 it fails - so either its a bug that is fixed in 2.33 - or an OS issue that is causing this.
Edit2:
Updated git to version 2.31 on the server - and its the same issue. So I am thinking its a git on linux issue.
Originally posted by @bjornbouetsmith in https://github.com/go-gitea/gitea/issues/8689#issuecomment-1131956921
@bjornbouetsmith commented on GitHub (May 21, 2022):
Also tested on debian 11 with
git version 2.34.1and its the same issue.So git on Linux in my very simple test does simply not handle escaping of characters correctly,
@bjornbouetsmith commented on GitHub (May 21, 2022):
Tested with a different username and a plain password without any special characters in it - and its the same issue. I think git does not support proper http authentication as such, i.e. challenge and response.
When I use the same password with
wgetIt writes out:
Then wget properly encodes a response with the username/password the and request suceeds.
So possibly its a git on linux vs azure devops on prem incompatibility - and what might need to be done instead is use ssh for git cloning, since that would fix the issue entirely.
Then whoever wants to migrate a azure devops repository would need to enable ssh on the server, create an authentication token and then it should just work if gitea pipes the git clone with a ssh url a ssh "url".
@bjornbouetsmith commented on GitHub (May 21, 2022):
I can verify that adding a ssh public key to azure devops allows me to git clone.
So I think what needs to be done for "Azure Devops" in gitea is that it gets its own "migration" type and then tell people to use ssh.
Basically I would guess that what needs to be done is
Success.
If I knew how to program in GO and my UI skills weren't shit - I would create a pull request for this.
@6543 commented on GitHub (May 21, 2022):
related: #1635
@KN4CK3R commented on GitHub (Oct 28, 2022):
Is this still an issue? I'v tested it with a pull and push mirror and both worked.
@bjornbouetsmith commented on GitHub (Oct 28, 2022):
Yes, I just tried to fire up my gitea installation - updated to 17.3 and same exact issue.
Authentication error as I described above.
What type of migration did you try to do?
And please provide exact steps, was it http/https or other url you used?
@KN4CK3R commented on GitHub (Oct 29, 2022):
@kdumontnu asked me about this issue, so I registered at Devops and created a repo. The Devops UI told me to use
adminas username andzpv5hppqgmk5p76b...h4bwrrpaqas password. Then I setup a push mirror from Gitea to Devops with the provided url and credentials. Gitea created a mirror information like this in the git config file:That resulted in

After that I created a (mirror) migration for that repo and that worked too.
@bjornbouetsmith commented on GitHub (Oct 29, 2022):
You are using azure devops "cloud version" - this issue is about on prem dev ops.
Also - I am not trying to set up a mirror - simply migrate a git repository from on prem azure devops to gitea.
@KN4CK3R commented on GitHub (Oct 29, 2022):
Oh, sorry about that. I will try with an on prem dev ops.
@bjornbouetsmith commented on GitHub (Oct 29, 2022):
No worries - but make sure you try a migration - and not try to set up any mirrors.
@KN4CK3R commented on GitHub (Oct 30, 2022):
Got it working. Basically the on prem Devops needs the
Authorizationheader for cloning. https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Linux#use-a-patI will not create a PR for that because this should be implemented as a generic "add custom headers to git requests" instead of just the
Authorizationheader. A possible implementation needs to support the migration/clone, pull/push mirror, LFS client pull/push, ... and everything I forgot. It may not be worth the effort just to enable migrations from on prem Devops as no other service needs this.These are the code changes I made:
@bjornbouetsmith commented on GitHub (Oct 31, 2022):
Nice find @KN4CK3R - but what I don't understand is why other implementations do not require this - surely they all use username/password authentication.
Other repositories probably just relies on the git binary doing the authentication for them.
All basic authentication works like that.
Server sends a challenge, client sends a "Authorization" header.
And I am sorry you feel that its not worth it to fix this just because its "only" azure devops on prem that needs this - I can see other settings the the "MigrateOptions" - that are specific other other types, i.e. Wiki.
Also I think it can also be a bug in the git client possibly, it should be able to handle the authentication, but possibly the azure devops server requests "NTLM" authenticaion and then git just says "nope" - and on windows perhaps there is a special handling of that that translates that into "BASIC" instead.
It would be nice to see the actual headers the azure devops server sends to see if its possible to get a hint to why git cannot just provide basic authentication header automatically, as I am sure that is what it does to all other http/https git urls.
@KN4CK3R commented on GitHub (Oct 31, 2022):
Maybe you can find your answer in this thread: https://stackoverflow.com/questions/64800010/why-does-http-basic-auth-works-using-git-c-http-extraheader-authorization-ba
@bjornbouetsmith commented on GitHub (Oct 31, 2022):
My guess is that at some point urls with username/password in the url will stop working - and in my opinion it should be already.
Inside git, perhaps the username:password gets turned into an authorization header already, but I am guessing that ALL existing implementation would work - if the default behavior in gitea was to ALWAYS add the
http.extraHeader=for authorization and never put it into the url, which also have the added benefit that no username/password combos are stored in git config files.
@KN4CK3R commented on GitHub (Oct 31, 2022):
The extra headers would be stored in the config file too. Maybe this will change in future when the secret store is added.