Deploy key doesn't work in multiple repositories (rw / r) #1782

Closed
opened 2025-11-02 04:13:08 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @FloMiau on GitHub (May 13, 2018).

  • 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 11:50:57 [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 {}{3, 8}

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 same deploy key to repository 2 as read

Result:
deploy key in repository 1 works
deploy key in repository 1 doesn't work

git clone git@try.gitea.io:flori/test1.git
Cloning into 'test1'...
The authenticity of host 'try.gitea.io (2604:a880:400:d1::6b0:2001)' can't be established.
ECDSA key fingerprint is SHA256:ZALpHWW7Q1lMvG/9K2EJPApn6XiO4hx2/PN/zWcY7CI.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'try.gitea.io,2604:a880:400:d1::6b0:2001' (ECDSA) to the list of known hosts.
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5/5), done.
Checking connectivity... done.
Cloning into 'test2'...
Gitea: Key access denied
Deploy key access denied: [key_id: 247, repo_id: 5568]
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Screenshots

gitea1
gitea2

Originally created by @FloMiau on GitHub (May 13, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - 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 - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ``` xorm.log 2018/05/13 11:50:57 [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 {}{3, 8} ``` ## 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 same deploy key to repository 2 as read Result: deploy key in repository 1 works deploy key in repository 1 doesn't work ``` git clone git@try.gitea.io:flori/test1.git Cloning into 'test1'... The authenticity of host 'try.gitea.io (2604:a880:400:d1::6b0:2001)' can't be established. ECDSA key fingerprint is SHA256:ZALpHWW7Q1lMvG/9K2EJPApn6XiO4hx2/PN/zWcY7CI. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'try.gitea.io,2604:a880:400:d1::6b0:2001' (ECDSA) to the list of known hosts. remote: Counting objects: 5, done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 0), reused 0 (delta 0) Receiving objects: 100% (5/5), done. Checking connectivity... done. ``` ``` git clone git@try.gitea.io:flori/test2.git Cloning into 'test2'... Gitea: Key access denied Deploy key access denied: [key_id: 247, repo_id: 5568] fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` ## Screenshots ![gitea1](https://user-images.githubusercontent.com/37121807/39966465-87976e44-56ac-11e8-96f5-cd52b4d6da61.PNG) ![gitea2](https://user-images.githubusercontent.com/37121807/39966467-8a275322-56ac-11e8-974e-d76262b4eb72.PNG) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 04:13:08 -06:00
Author
Owner

@lafriks commented on GitHub (May 13, 2018):

Currently it is not supported to reuse key on multiple repositories

@lafriks commented on GitHub (May 13, 2018): Currently it is not supported to reuse key on multiple repositories
Author
Owner

@stale[bot] commented on GitHub (Jan 27, 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 (Jan 27, 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

@zeripath commented on GitHub (Mar 25, 2019):

This should be fixed by #5939

Therefore I'm going to close this.

@zeripath commented on GitHub (Mar 25, 2019): This should be fixed by #5939 Therefore I'm going to close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1782