Unable to disable a deploy key
Summary
I'm unable to disable a deploy key. The following workaround permits to solve it
delete from deploy_keys_projects where deploy_key_id = 250;
DELETE 1
delete from keys where id = 250;
DELETE 1
- remove the ssh key from the gitlab authorized keys file
Steps to reproduce
(How one can reproduce the issue - this is very important)
Example Project
None
What is the current bug behavior?
Deploy key disabling doesn't work
What is the expected correct behavior?
it should be removed from project
Relevant logs and/or screenshots
==> /var/log/gitlab/gitlab-rails/production.log <==
Started PUT "/pole-pegase/tardis/deploy_keys/250/disable" for 172.20.232.165 at 2018-05-03 17:53:31 +0200
Processing by Projects::DeployKeysController#disable as JSON
Parameters: {"namespace_id"=>"pole-pegase", "project_id"=>"tardis", "id"=>"250", "deploy_key"=>{}}
ActiveRecord::RecordNotFound (Couldn't find DeployKey with 'id'=250 [WHERE "keys"."type" IN ('DeployKey') AND "keys"."id" IN (20, 49, 93, 149, 150)]):
app/controllers/projects/deploy_keys_controller.rb:100:in `load_key'
app/controllers/projects/deploy_keys_controller.rb:63:in `disable'
lib/gitlab/i18n.rb:50:in `with_locale'
lib/gitlab/i18n.rb:56:in `with_user_locale'
app/controllers/application_controller.rb:334:in `set_locale'
lib/gitlab/middleware/multipart.rb:95:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
ee/lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only/controller.rb:28:in `call'
lib/gitlab/middleware/read_only.rb:16:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
lib/gitlab/middleware/release_env.rb:10:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 7.11 Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknownGitLab information Version: 10.7.2-ee Revision: a4f29081 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.5 URL: http://gitlab.info.local HTTP Clone URL: http://gitlab.info.local/some-group/some-project.git SSH Clone URL: git@gitlab.info.local:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 7.1.2 Repository storage paths:
- default: /home/git/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Nothing interesting there