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

Forking an empty repo via the API leads to a repo that throws a 500 error #6633

Closed
2 of 7 tasks
shay-k opened this issue Apr 15, 2019 · 0 comments · Fixed by #6637
Closed
2 of 7 tasks

Forking an empty repo via the API leads to a repo that throws a 500 error #6633

shay-k opened this issue Apr 15, 2019 · 0 comments · Fixed by #6637
Labels
Milestone

Comments

@shay-k
Copy link

shay-k commented Apr 15, 2019

  • Gitea version (or commit ref): 1.7.6
  • Git version: 2.18.1
  • Operating system: macOS 10.14.3
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:
[Macaron] 2019-04-15 13:49:52: Started GET /gitea/foo for 172.17.0.1
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/04/15 13:49:52 [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{1, "foo"}
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `repo_id`, `type`, `config`, `created_unix` FROM `repo_unit` WHERE (repo_id = ?) []interface {}{3}
[git-module] /data/git/repositories/gitea/foo.git: git -c credential.helper= -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= tag -l --sort=-v:refname
2019/04/15 13:49:52 [I] [SQL] SELECT count(*) FROM `release` WHERE repo_id=? AND is_draft=? []interface {}{3, false}
2019/04/15 13:49:52 [I] [SQL] SELECT * FROM `user` INNER JOIN `team_user` ON `team_user`.org_id=`user`.id INNER JOIN `team` ON `team`.id=`team_user`.team_id WHERE (`team_user`.uid=?) AND (`team`.authorize=?) ORDER BY `user`.`name` ASC []interface {}{1, 4}
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 3}
[git-module] /data/git/repositories/gitea/foo.git: git -c credential.helper= -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= show-ref --verify refs/heads/master
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `uid`, `repo_id` FROM `star` WHERE `uid`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 3}
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{2}
2019/04/15 13:49:52 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}
[git-module] /data/git/repositories/gitea/foo.git: git -c credential.helper= -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= show-ref --verify refs/heads/master
[Macaron] 2019-04-15 13:49:52: Completed GET /gitea/foo 404 Not Found in 13.241989ms

Description

You can fork an empty repo using the API, when you do so the resulting fork is bugged and shows a 500 error page (404 from the HTTP status code).

Note that we want this to work and not just be blocked in the API. Our system does that in certain cases.

Screenshots

image

segevfiner pushed a commit to codeocean/gitea that referenced this issue Apr 15, 2019
Fixes go-gitea#6633

Signed-off-by: Segev Finer <segev@codeocean.com>
techknowlogick pushed a commit that referenced this issue Apr 15, 2019
Fixes #6633

Signed-off-by: Segev Finer <segev@codeocean.com>
@lunny lunny added the type/bug label Apr 16, 2019
segevfiner added a commit to codeocean/gitea that referenced this issue Apr 16, 2019
Fixes go-gitea#6633

Signed-off-by: Segev Finer <segev@codeocean.com>
zeripath pushed a commit that referenced this issue Apr 16, 2019
Fixes #6633

Signed-off-by: Segev Finer <segev@codeocean.com>
@lafriks lafriks added this to the 1.8.0 milestone Apr 18, 2019
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants