API: create repo with invalid label set hangs gitea #6686

Closed
opened 2025-11-02 07:03:48 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @noerw on GitHub (Jan 13, 2021).

Originally assigned to: @6543 on GitHub.

Description

Using the API to create a repo with a non-existent label-set makes gitea hang, and leaves a partially initialized repo.

On gitea.com the repo is partially created, and an empty error message is returned.
Testing locally with 9659808172, Gitea hangs indefinitely instead of finishing the request.

Following requests give repository files already exist.

To reproduce:

tea repo create --name foo --labels asdfasdf404

ref: https://gitea.com/gitea/gitea.com/issues/21

Originally created by @noerw on GitHub (Jan 13, 2021). Originally assigned to: @6543 on GitHub. <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.0+dev-454-g19ae6439b - Git version: 2.29.2 - Operating system: fedora linux <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (probably, at least on gitea.com, see https://gitea.com/gitea/gitea.com/issues/21 - [ ] No - Log gist: https://pastebin.com/eXZc273c ## Description Using the API to create a repo with a non-existent label-set makes gitea hang, and leaves a partially initialized repo. On gitea.com the repo is partially created, and an empty error message is returned. Testing locally with 9659808172b0d33a79eca44e37cabaf33fbf1b8b, Gitea hangs indefinitely instead of finishing the request. Following requests give `repository files already exist`. To reproduce: ``` tea repo create --name foo --labels asdfasdf404 ``` ref: https://gitea.com/gitea/gitea.com/issues/21
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 07:03:48 -06:00
Author
Owner

@lunny commented on GitHub (Jan 13, 2021):

I got the error message

2021/01/14 00:27:01 Failed to run app with [tea repo create --login=local --name foo --labels asdfasdf404]: InitializeLabels: Failed to load label template file 'asdfasdf404': GetRepoInitFile: Asset file does not exist: label/asdfasdf404
@lunny commented on GitHub (Jan 13, 2021): I got the error message ``` 2021/01/14 00:27:01 Failed to run app with [tea repo create --login=local --name foo --labels asdfasdf404]: InitializeLabels: Failed to load label template file 'asdfasdf404': GetRepoInitFile: Asset file does not exist: label/asdfasdf404 ```
Author
Owner

@lunny commented on GitHub (Jan 13, 2021):

When create a repository with labels, opts.IssueLabels is the label template name but not labels themselves. So I think the response error Failed to load label template file 'asdfasdf404' is right.

@lunny commented on GitHub (Jan 13, 2021): When create a repository with labels, `opts.IssueLabels` is the label template name but not labels themselves. So I think the response error `Failed to load label template file 'asdfasdf404'` is right.
Author
Owner

@lunny commented on GitHub (Jan 14, 2021):

@noerw I can confirm the bug also affect v1.13 so I changed the milestone.

@lunny commented on GitHub (Jan 14, 2021): @noerw I can confirm the bug also affect v1.13 so I changed the milestone.
Author
Owner

@6543 commented on GitHub (Jan 18, 2021):

could not reporduce it, so #14384 is only a draft ... would be nice if those who can reproduce could test it ...

@6543 commented on GitHub (Jan 18, 2021): could not reporduce it, so #14384 is only a **draft** ... would be nice if those who can reproduce could test it ...
Author
Owner

@6543 commented on GitHub (Jan 18, 2021):

Edit: I think this is a sqlite deadlock ...
wait ... I'll setup a extra test instance

@6543 commented on GitHub (Jan 18, 2021): Edit: I think this is a sqlite deadlock ... wait ... I'll setup a extra test instance
Author
Owner

@lunny commented on GitHub (Jan 18, 2021):

The problem is the parameter of tea think it's a label value, but Gitea think the parameter is a label set template name.

@lunny commented on GitHub (Jan 18, 2021): The problem is the parameter of `tea` think it's a label value, but `Gitea` think the parameter is a label set template name.
Author
Owner

@6543 commented on GitHub (Jan 18, 2021):

This is caused by a weak struct field description ... changed this in my pull too

Gitea should not freeze anyway ...

@6543 commented on GitHub (Jan 18, 2021): This is caused by a weak struct field description ... changed this in my pull too Gitea should not freeze anyway ...
Author
Owner

@6543 commented on GitHub (Jan 18, 2021):

#14384 is ready 🚀

@6543 commented on GitHub (Jan 18, 2021): #14384 is ready :rocket:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6686