Milestone Deletion Fails
Summary
We have the problem, we can't delete a milestone as the deletion request results in 500 Internal Server Error.
Steps to reproduce
- We had created our milestones in the top level group
- We assigned issues and merge requests to them
- We decided to change our milestones and tried to delete the outdated milestones
- The Milestone fails to delete
Confirmed steps to reproduce
- Create a milestone in the top-level group
- Assign an to an MR from a project immediately beneath that group (possibly works with projects in subgroups also)
- Try to delete the milestone, notice an error with missing
jira_subscription_exists?
method
Example Project
On gitlab.com the milestone deletion is working correctly
What is the current bug behavior?
Additionally, the "Delete" modal is not rendering properly:
What is the expected correct behavior?
The milestone would have been deleted
Relevant logs and/or screenshots
Expand for Tail Output
==> /var/log/gitlab/gitlab-rails/production.log <== Completed 500 Internal Server Error in 3669ms (ActiveRecord: 457.4ms | Elasticsearch: 0.0ms | Allocations: 1900270) ==> /var/log/gitlab/gitlab-rails/production_json.log <== {"method":"DELETE","path":"/groups/removed/-/milestones/1","format":"json","controller":"Groups::MilestonesController","action":"destroy","status":500,"time":"2021-05-08T15:40:40.666Z","params":[{"key":"group_id","value":"removed"},{"key":"id","value":"1"}],"remote_ip":"removed","user_id":6,"username":"Taucher2003","ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36","correlation_id":"01F56A6F1DMJ5R3SD02MFGDMW8","meta.user":"Taucher2003","meta.root_namespace":"removed","meta.caller_id":"Groups::MilestonesController#destroy","meta.remote_ip":"removed","meta.feature_category":"issue_tracking","meta.client_id":"user/6","gitaly_calls":3,"gitaly_duration_s":0.018214,"redis_calls":109,"redis_duration_s":0.037925,"redis_read_bytes":4694,"redis_write_bytes":1876610,"redis_cache_calls":78,"redis_cache_duration_s":0.030802,"redis_cache_read_bytes":3384,"redis_cache_write_bytes":1821449,"redis_queues_calls":15,"redis_queues_duration_s":0.002432,"redis_queues_read_bytes":814,"redis_queues_write_bytes":51009,"redis_shared_state_calls":16,"redis_shared_state_duration_s":0.004691,"redis_shared_state_read_bytes":496,"redis_shared_state_write_bytes":4152,"db_count":604,"db_write_count":95,"db_cached_count":92,"cpu_s":3.454016,"mem_objects":2111614,"mem_bytes":179273419,"mem_mallocs":871182,"queue_duration_s":0.014826,"cf_ray":"64c3c999b93b073e-FRA","cf_request_id":"09ee3c54170000073e9a2f3000000001","exception.class":"NoMethodError","exception.message":"undefined method `jira_subscription_exists?' for #","exception.backtrace":["app/services/merge_requests/base_service.rb:62:in `enqueue_jira_connect_messages_for'","lib/gitlab/metrics/instrumentation.rb:160:in `block in enqueue_jira_connect_messages_for'","lib/gitlab/metrics/method_call.rb:27:in `measure'","lib/gitlab/metrics/instrumentation.rb:160:in `enqueue_jira_connect_messages_for'","app/services/merge_requests/base_service.rb:27:in `execute_hooks'","ee/app/services/ee/merge_requests/base_service.rb:14:in `execute_hooks'","app/services/issuable_base_service.rb:261:in `update'","app/services/merge_requests/base_service.rb:78:in `update'","lib/gitlab/metrics/instrumentation.rb:160:in `block in update'","lib/gitlab/metrics/method_call.rb:27:in `measure'","lib/gitlab/metrics/instrumentation.rb:160:in `update'","app/services/merge_requests/update_service.rb:90:in `general_fallback'","ee/app/services/ee/merge_requests/update_service.rb:18:in `general_fallback'","app/services/merge_requests/update_service.rb:14:in `execute'","lib/gitlab/metrics/instrumentation.rb:160:in `block in execute'","lib/gitlab/metrics/method_call.rb:27:in `measure'","lib/gitlab/metrics/instrumentation.rb:160:in `execute'","app/services/milestones/destroy_service.rb:14:in `block (2 levels) in execute'","app/services/milestones/destroy_service.rb:13:in `block in execute'","lib/gitlab/database.rb:342:in `block in transaction'","lib/gitlab/database.rb:341:in `transaction'","app/services/milestones/destroy_service.rb:6:in `execute'","lib/gitlab/metrics/instrumentation.rb:160:in `block in execute'","lib/gitlab/metrics/method_call.rb:27:in `measure'","lib/gitlab/metrics/instrumentation.rb:160:in `execute'","app/controllers/groups/milestones_controller.rb:50:in `destroy'","ee/lib/gitlab/ip_address_state.rb:10:in `with'","ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'","app/controllers/application_controller.rb:485:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:476:in `set_session_storage'","lib/gitlab/i18n.rb:73:in `with_locale'","lib/gitlab/i18n.rb:79:in `with_user_locale'","app/controllers/application_controller.rb:470:in `set_locale'","app/controllers/application_controller.rb:463:in `block in set_current_context'","lib/gitlab/application_context.rb:70:in `block in use'","lib/gitlab/application_context.rb:70:in `use'","lib/gitlab/application_context.rb:27:in `with_context'","app/controllers/application_controller.rb:454:in `set_current_context'","lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'","lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'","lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'","lib/gitlab/metrics/transaction.rb:56:in `run'","lib/gitlab/metrics/rack_middleware.rb:16:in `call'","lib/gitlab/request_profiler/middleware.rb:17:in `call'","lib/gitlab/jira/middleware.rb:19:in `call'","lib/gitlab/middleware/go.rb:20:in `call'","lib/gitlab/etag_caching/middleware.rb:21:in `call'","lib/gitlab/middleware/multipart.rb:172:in `call'","lib/gitlab/middleware/read_only/controller.rb:50:in `call'","lib/gitlab/middleware/read_only.rb:18:in `call'","lib/gitlab/middleware/same_site_cookies.rb:27:in `call'","lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'","lib/gitlab/middleware/basic_health_check.rb:25:in `call'","lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'","lib/gitlab/middleware/request_context.rb:21:in `call'","config/initializers/fix_local_cache_middleware.rb:11:in `call'","lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:21:in `call'","lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'","lib/gitlab/middleware/release_env.rb:12:in `call'"],"db_duration_s":0.45736,"view_duration_s":0.0,"duration_s":3.85877} ==> /var/log/gitlab/gitlab-rails/production.log <== NoMethodError (undefined method `jira_subscription_exists?' for #): app/services/merge_requests/base_service.rb:62:in `enqueue_jira_connect_messages_for' lib/gitlab/metrics/instrumentation.rb:160:in `block in enqueue_jira_connect_messages_for' lib/gitlab/metrics/method_call.rb:27:in `measure' lib/gitlab/metrics/instrumentation.rb:160:in `enqueue_jira_connect_messages_for' app/services/merge_requests/base_service.rb:27:in `execute_hooks' ee/app/services/ee/merge_requests/base_service.rb:14:in `execute_hooks' app/services/issuable_base_service.rb:261:in `update' app/services/merge_requests/base_service.rb:78:in `update' lib/gitlab/metrics/instrumentation.rb:160:in `block in update' lib/gitlab/metrics/method_call.rb:27:in `measure' lib/gitlab/metrics/instrumentation.rb:160:in `update' app/services/merge_requests/update_service.rb:90:in `general_fallback' ee/app/services/ee/merge_requests/update_service.rb:18:in `general_fallback' app/services/merge_requests/update_service.rb:14:in `execute' lib/gitlab/metrics/instrumentation.rb:160:in `block in execute' lib/gitlab/metrics/method_call.rb:27:in `measure' lib/gitlab/metrics/instrumentation.rb:160:in `execute' app/services/milestones/destroy_service.rb:14:in `block (2 levels) in execute' app/services/milestones/destroy_service.rb:13:in `block in execute' lib/gitlab/database.rb:342:in `block in transaction' lib/gitlab/database.rb:341:in `transaction' app/services/milestones/destroy_service.rb:6:in `execute' lib/gitlab/metrics/instrumentation.rb:160:in `block in execute' lib/gitlab/metrics/method_call.rb:27:in `measure' lib/gitlab/metrics/instrumentation.rb:160:in `execute' app/controllers/groups/milestones_controller.rb:50:in `destroy' ee/lib/gitlab/ip_address_state.rb:10:in `with' ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address' app/controllers/application_controller.rb:485:in `set_current_admin' lib/gitlab/session.rb:11:in `with_session' app/controllers/application_controller.rb:476:in `set_session_storage' lib/gitlab/i18n.rb:73:in `with_locale' lib/gitlab/i18n.rb:79:in `with_user_locale' app/controllers/application_controller.rb:470:in `set_locale' app/controllers/application_controller.rb:463:in `block in set_current_context' lib/gitlab/application_context.rb:70:in `block in use' lib/gitlab/application_context.rb:70:in `use' lib/gitlab/application_context.rb:27:in `with_context' app/controllers/application_controller.rb:454:in `set_current_context' lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call' lib/gitlab/middleware/rails_queue_duration.rb:33:in `call' lib/gitlab/metrics/rack_middleware.rb:16:in `block in call' lib/gitlab/metrics/transaction.rb:56:in `run' lib/gitlab/metrics/rack_middleware.rb:16:in `call' lib/gitlab/request_profiler/middleware.rb:17:in `call' lib/gitlab/jira/middleware.rb:19:in `call' lib/gitlab/middleware/go.rb:20:in `call' lib/gitlab/etag_caching/middleware.rb:21:in `call' lib/gitlab/middleware/multipart.rb:172:in `call' lib/gitlab/middleware/read_only/controller.rb:50:in `call' lib/gitlab/middleware/read_only.rb:18:in `call' lib/gitlab/middleware/same_site_cookies.rb:27:in `call' lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call' lib/gitlab/middleware/basic_health_check.rb:25:in `call' lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call' lib/gitlab/middleware/request_context.rb:21:in `call' config/initializers/fix_local_cache_middleware.rb:11:in `call' lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:21:in `call' lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call' lib/gitlab/middleware/release_env.rb:12:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 10 Proxy: no Current User: git Using RVM: no Ruby Version: 2.7.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 6.0.12 Git Version: 2.31.1 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.11.3-ee Revision: 7fde0affe23 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.6 URL: https://removed HTTP Clone URL: https://removed/some-group/some-project.git SSH Clone URL: git@removed:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.17.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.17.0 ? ... OK (13.17.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 7/3 ... yes 7/4 ... yes 7/5 ... yes 7/6 ... yes 7/7 ... yes 7/8 ... yes 8/9 ... yes 22/10 ... yes 8/11 ... yes 7/12 ... yes 28/13 ... yes 7/15 ... yes 31/16 ... yes 33/17 ... yes Redis version >= 5.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.31.0 ? ... yes (2.31.1) Git user has default SSH configuration? ... yes Active users: ... 12 Is authorized keys file accessible? ... skipped (authorized keys not enabled) GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x (6.4 - 6.x deprecated to be removed in 13.8)? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
To be edited by a developer
Additional information
Our Gitlab Instance is running on 13.11.3-ee with free license
If any other information is needed feel free to tell me in this issue