Search functionality also broken after converting a group to a sub group
Summary
Coincidentally, we are also setting up Elastic Search. I was testing out the search functionality... And when I go to the /search URL and click the drop down for groups, I get an error saying "Something went wrong on our end" at the top" and no groups are returned in the list. I looked in our logs, and found the information (Seen below).
For reference on subgroups, see Issue #2772 (closed)
Steps to reproduce
Move a group as a subgroup doing the steps given in Issue #29718 (closed) and then go to the /search URL and click the groups dropdown menu. You must be a member of that group, or owner.... Or whatever it is that qualifies it to normally show up on that list.
What is the current bug behavior?
Error and no results in the dropdown
What is the expected correct behavior?
List of groups to choose from
Relevant logs and/or screenshots
Started GET "/api/v3/groups.json?search=&per_page=20" for IP_ADDRESS at 2017-03-20 14:32:32 -0500
ActionController::UrlGenerationError (No route matches {:action=>"show", :controller=>"groups", :id=>#<Group id: 3864, name: "SUBGROUP_NAME", path: "SUBGROUP_NAME", owner_id: nil, created_at: "2017-03-15 13:31:56", updated_at: "2017-03-20 19:00:27", type: "Group", description: "", avatar: "image.png", membership_lock: true, share_with_group_lock: false, visibility_level: 10, request_access_enabled: false, ldap_sync_status: "ready", ldap_sync_error: nil, ldap_sync_last_update_at: "2017-03-20 19:00:27", ldap_sync_last_successful_update_at: "2017-03-20 19:00:27", ldap_sync_last_sync_at: "2017-03-20 19:00:27", deleted_at: nil, lfs_enabled: true, description_html: "", parent_id: 505, shared_runners_minutes_limit: nil, repository_size_limit: nil>} missing required keys: [:id]):
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/formatter.rb:46:in `generate'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:721:in `generate'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:752:in `generate'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:799:in `url_for'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:280:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:345:in `block (2 levels) in define_url_helper'
/opt/gitlab/embedded/service/gitlab-rails/app/models/group.rb:104:in `web_url'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/delegator/plain_object.rb:6:in `delegate'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/entity.rb:490:in `delegate_attribute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/delegator_exposure.rb:6:in `value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:79:in `valid_value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:63:in `serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:61:in `block (2 levels) in serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:109:in `block in with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/options.rb:102:in `with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:108:in `with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:60:in `block in serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each_with_object'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-entity-0.6.0/lib/grape_entity/entity.rb:471:in `serializable_hash'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:140:in `block in as_json'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:140:in `map'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:140:in `as_json'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:35:in `encode'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:22:in `encode'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/formatter/json.rb:6:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/formatter.rb:44:in `block in build_formatted_response'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/formatter.rb:44:in `collect'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/formatter.rb:44:in `build_formatted_response'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/formatter.rb:28:in `after'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/base.rb:33:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/base.rb:23:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/base.rb:30:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/base.rb:23:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-oauth2-1.2.3/lib/rack/oauth2/server/resource.rb:20:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-oauth2-1.2.3/lib/rack/oauth2/server/resource/bearer.rb:8:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/error.rb:34:in `block in call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/error.rb:33:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/error.rb:33:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/middleware/base.rb:23:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/endpoint.rb:222:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/endpoint.rb:216:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router/route.rb:68:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:71:in `block in identity'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:92:in `transaction'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:67:in `identity'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:52:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:115:in `with_optimization'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/router.rb:51:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/api.rb:119:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/api.rb:45:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/grape-0.18.0/lib/grape/api.rb:40:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/mapper.rb:51:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:817:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omniauth-1.3.2/lib/omniauth/strategy.rb:186:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omniauth-1.3.2/lib/omniauth/strategy.rb:164:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/multipart.rb:93:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/request_profiler/middleware.rb:15:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/go.rb:16:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-cors-0.4.0/lib/rack/cors.rb:80:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-attack-4.4.1/lib/rack/attack.rb:107:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/etag.rb:24:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/conditionalget.rb:25:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/readonly_geo.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/session/abstract/id.rb:225:in `context'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/session/abstract/id.rb:220:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/query_cache.rb:36:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:in `call_app'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:26:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/runtime.rb:18:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/lock.rb:17:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/sendfile.rb:113:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sentry-raven-2.0.2/lib/raven/integrations/rack.rb:50:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:518:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:165:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/urlmap.rb:66:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/urlmap.rb:50:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rack-1.6.5/lib/rack/urlmap.rb:50:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:562:in `process_client'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-worker-killer-0.4.4/lib/unicorn/worker_killer.rb:52:in `process_client'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:658:in `worker_loop'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:283:in `join'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
/opt/gitlab/embedded/bin/unicorn:22:in `load'
/opt/gitlab/embedded/bin/unicorn:22:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Results of GitLab environment info
Cannot run sudo commands (do not have permissions for root access on our servers). Can provide if it's 100% necessary to troubleshoot this. omnibus install
Results of GitLab application Check
Cannot run sudo commands (do not have permissions for root access on our servers). Can provide if it's 100% necessary to troubleshoot this. omnibus install
Possible fixes
Should owner_id be nil?