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

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

Closed
1 of 3 tasks
mateusza opened this issue Mar 6, 2019 · 6 comments · Fixed by #6260
Closed
1 of 3 tasks

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

mateusza opened this issue Mar 6, 2019 · 6 comments · Fixed by #6260
Labels
issue/duplicate The issue has already been reported. issue/stale

Comments

@mateusza
Copy link

mateusza commented 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

@mateusza
Copy link
Author

mateusza commented 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]

@techknowlogick techknowlogick added the issue/duplicate The issue has already been reported. label Mar 6, 2019
@techknowlogick
Copy link
Member

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

@jolheiser
Copy link
Member

The issue with the same problem is #3799

The problem is these lines:

case models.IsErrNamePatternNotAllowed(err):

err = util.URLSanitizedError(err, remoteAddr)

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

// URLSanitizedError returns the sanitized version an error whose message may
// contain a sensitive URL
func URLSanitizedError(err error, unsanitizedURL string) error {
return urlSafeError{err: err, unsanitizedURL: unsanitizedURL}
}

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.

@stale
Copy link

stale bot commented 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 stale bot added the issue/stale label May 5, 2019
@stale
Copy link

stale bot commented May 20, 2019

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

@stale stale bot closed this as completed May 20, 2019
@jolheiser
Copy link
Member

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

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported. issue/stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants