Skip to content

Error 500 when adding existing deploy key to project #3960

Closed
@FloMiau

Description

@FloMiau
  • Gitea version (or commit ref): 1546458 / 1.4.1
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04.4 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
==> xorm.log <==
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `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}
2018/05/13 13:02:34 [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2018/05/13 13:02:34 [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`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{1, "test1"}
2018/05/13 13:02:34 [I] [SQL] SELECT count(*) FROM `release` WHERE repo_id=? AND is_draft=? []interface {}{22, false}
2018/05/13 13:02:34 [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}
2018/05/13 13:02:34 [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`, `created_unix`, `updated_unix` FROM `repository` WHERE (owner_id=? AND fork_id=?) LIMIT 1 []interface {}{2, 22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `uid`, `repo_id` FROM `star` WHERE `uid`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `repo_id`, `type`, `config`, `created_unix` FROM `repo_unit` WHERE (repo_id = ?) []interface {}{22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `repo_id`, `type`, `config`, `created_unix` FROM `repo_unit` WHERE (repo_id = ?) []interface {}{22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `key_id`, `repo_id`, `name`, `fingerprint`, `mode`, `created_unix`, `updated_unix` FROM `deploy_key` WHERE (repo_id = ?) []interface {}{22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE `fingerprint`=? AND `mode`=? AND `type`=? LIMIT 1 []interface {}{"SHA256:wJ20x1yZnKtV3T8E6Aet6v7iAtSsi1/qCFWDIXit5rA", 1, 2}
2018/05/13 13:02:34 [I] [SQL] BEGIN TRANSACTION
2018/05/13 13:02:34 [I] [SQL] INSERT INTO `public_key` (`owner_id`,`name`,`fingerprint`,`content`,`mode`,`type`,`created_unix`,`updated_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) []interface {}{0, "ubuntutest", "SHA256:wJ20x1yZnKtV3T8E6Aet6v7iAtSsi1/qCFWDIXit5rA", "ssh-rsa ..key..", 1, 2, 1526209354, 1526209354}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `key_id`, `repo_id`, `name`, `fingerprint`, `mode`, `created_unix`, `updated_unix` FROM `deploy_key` WHERE (key_id = ? AND repo_id = ?) LIMIT 1 []interface {}{9, 22}
2018/05/13 13:02:34 [I] [SQL] SELECT `id`, `key_id`, `repo_id`, `name`, `fingerprint`, `mode`, `created_unix`, `updated_unix` FROM `deploy_key` WHERE (repo_id = ? AND name = ?) LIMIT 1 []interface {}{22, "ubuntutest"}
2018/05/13 13:02:34 [I] [SQL] ROLL BACK

Description

I tried to add a deploy key with different read/write settings to multiple repositories:

  1. add deploy key to repository 1 as read/write
  2. add deploy key to repository 1 again

Result:
website shows error 500

Screenshots

gitea3

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions