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

access of lfs ressources not possible when using deploy key (401 Auth required) #6127

Closed
2 of 7 tasks
krombel opened this issue Feb 19, 2019 · 2 comments
Closed
2 of 7 tasks

Comments

@krombel
Copy link

krombel commented Feb 19, 2019

  • Gitea version (or commit ref): 1.7.2 (1.7.1 was not working as well)
  • Git version: 2.11.0 - git lfs version 2.7.0
  • Operating system: linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant (lfs is not enabled)
  • Log gist:

serv.log:

2019/02/19 21:33:49 [T] GetRepositoryByOwnerAndName: http://127.0.0.1:3000/api/internal/repo/myorg/myrepo
2019/02/19 21:33:49 [T] GetPublicKeyByID: http://127.0.0.1:3000/api/internal/ssh/4
2019/02/19 21:33:49 [T] GetDeployKey: http://127.0.0.1:3000/api/internal/repositories/1/keys/4
2019/02/19 21:33:49 [T] UpdateDeployKeyUpdated: http://127.0.0.1:3000/api/internal/repositories/1/keys/4/update

xorm.log

2019/02/19 21:33:49 [I] [SQL] SELECT repository.* FROM `repository` INNER JOIN `user` ON `user`.id = repository.owner_id WHERE (repository.lower_name = ?) AND (`user`.lower_name = ?) LIMIT 1 []interface {}{"myrepo", "myorg"}                                                                                                                                                                       2019/02/19 21:33:49 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `login_source_id`, `created_unix`, `updated_unix` FROM `public_key` WHERE `id`=? LIMIT 1 []interface {}{4}                                                                                                                                                                                         2019/02/19 21:33:49 [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 {}{4, 1}                                                                                                                                                                                               2019/02/19 21:33:49 [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 {}{4, 1}                                                                                                                                                                                               2019/02/19 21:33:49 [I] [SQL] UPDATE `deploy_key` SET `updated_unix` = ? WHERE `id`=? []interface {}{1550608429, 3}
2019/02/19 21:33:49 [I] [SQL] SELECT repository.* FROM `repository` INNER JOIN `user` ON `user`.id = repository.owner_id WHERE (repository.lower_name = ?) AND (`user`.lower_name = ?) LIMIT 1 []interface {}{"myrepo", "myorg"}                                                                                                                                                                       2019/02/19 21:33:49 [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 {}{1}

http.log

[19/Feb/2019:21:33:49 +0100] "POST /myorg/myrepo.git/info/lfs/objects/batch HTTP/1.1" 401 26 "-" "git-lfs/2.7.0 (GitHub; linux amd64; go 1.11.1)"

Description

Fetching lfs ressources when checked out via deploy key (and therefore via ssh) is not working.
It is working though when I checkout via ssh with an ssh key which is assigned to my user

@stale
Copy link

stale bot commented Apr 20, 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 Apr 20, 2019
@zeripath
Copy link
Contributor

I think this is fixed by #5939 and its backport #5966

Certainly it seems to work on the latest docker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants