No error message when trying to migrate repository with incorrect name #3012

Closed
opened 2025-11-02 04:57:19 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @mateusza on GitHub (Mar 6, 2019).

When providing following incorrect values as target repository name used in migration, gitea returns 500 HTTP response code, and no proper error message is displayed.

Description

...

Screenshots

image

image

image

Originally created by @mateusza on GitHub (Mar 6, 2019). When providing following incorrect values as target repository name used in migration, gitea returns 500 HTTP response code, and no proper error message is displayed. - `wrong.git` - `..` - Gitea version (or commit ref): ad86b84 - Git version: not relevant - Operating system: not relevant - Database (use `[x]`): not relevant - Can you reproduce the bug at https://try.gitea.io: - [x] Yes ( https://try.gitea.io/repo/migrate ) - [ ] No - [ ] Not relevant - Log gist: ## Description ... ## Screenshots ![image](https://user-images.githubusercontent.com/7002/53903140-39e7f480-4043-11e9-9b5d-046563f06ad5.png) ![image](https://user-images.githubusercontent.com/7002/53903333-bda1e100-4043-11e9-9061-02d76e9c415b.png) ![image](https://user-images.githubusercontent.com/7002/53903376-d7dbbf00-4043-11e9-9f8c-93e9dad91538.png)
GiteaMirror added the issue/staleissue/duplicate labels 2025-11-02 04:57:20 -06:00
Author
Owner

@mateusza commented on GitHub (Mar 6, 2019):

And here is the log entry from my 1.7.3 instance:

2019/03/06 19:02:06 [...routers/repo/repo.go:146 handleCreateError()] [E] MigratePost: name pattern is not allowed [pattern: *.git]

@mateusza commented on GitHub (Mar 6, 2019): And here is the log entry from my 1.7.3 instance: `2019/03/06 19:02:06 [...routers/repo/repo.go:146 handleCreateError()] [E] MigratePost: name pattern is not allowed [pattern: *.git]`
Author
Owner

@techknowlogick commented on GitHub (Mar 6, 2019):

This issue has been raised before, however as I can't find the issue I am going to leave this open.

@techknowlogick commented on GitHub (Mar 6, 2019): This issue has been raised before, however as I can't find the issue I am going to leave this open.
Author
Owner

@jolheiser commented on GitHub (Mar 6, 2019):

The issue with the same problem is #3799

The problem is these lines:
ad86b843e1/routers/repo/repo.go (L142)
ad86b843e1/routers/repo/repo.go (L265)

More specifically the second one. When the error is "sanitized" it is no longer an ErrNamePatternNotAllowed, it is a urlSafeError and so Gitea returns a ServerError
ad86b843e1/modules/util/sanitize.go (L22-L26)

I will try to get a PR in for this, and I'll probably add #6253 to it as well since they are for the same process and shouldn't be very big.

@jolheiser commented on GitHub (Mar 6, 2019): The issue with the same problem is #3799 The problem is these lines: https://github.com/go-gitea/gitea/blob/ad86b843e1d1984ec1b69f51276654469644bdd5/routers/repo/repo.go#L142 https://github.com/go-gitea/gitea/blob/ad86b843e1d1984ec1b69f51276654469644bdd5/routers/repo/repo.go#L265 More specifically the second one. When the error is "sanitized" it is no longer an `ErrNamePatternNotAllowed`, it is a `urlSafeError` and so Gitea returns a `ServerError` https://github.com/go-gitea/gitea/blob/ad86b843e1d1984ec1b69f51276654469644bdd5/modules/util/sanitize.go#L22-L26 I will try to get a PR in for this, and I'll probably add #6253 to it as well since they are for the same process and shouldn't be very big.
Author
Owner

@stale[bot] commented on GitHub (May 5, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (May 5, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (May 20, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (May 20, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@jolheiser commented on GitHub (May 23, 2019):

Just a note, this issue was actually fixed by #6290

@jolheiser commented on GitHub (May 23, 2019): Just a note, this issue was actually fixed by #6290
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3012