Issue boards with "Upcoming" or "Started" milestones cannot be retrieved via the API

Summary

If you assign the "Upcoming" or "Started" milestones to an issue board, trying to GET that board via the API results in a 500 internal server error.

Steps to reproduce

  1. Create a project
  2. Create an issue board with "Started" as the milestone
  3. GET https://gitlab.com/api/v4/projects/<project_id>/boards/<board_id>
  4. Get a 500 back from request

Example Project

https://gitlab.com/natemara/issue-board-issues/boards/660057

Try sending a GET request to https://gitlab.com/api/v4/projects/natemara%2Fissue-board-issues/boards/660057. You'll get a 500.

What is the current bug behavior?

GET-ing a board that has "Upcoming" or "Started" milestones results in a 500.

What is the expected correct behavior?

GET-ing a board that has "Upcoming" or "Started" milestones should return the board information.

Logs

NoMethodError (undefined method `project_id' for #<Milestone::MilestoneStruct:0x00007ffaefd8f4b8>
Did you mean?  object_id):
  /opt/gitlab/embedded/service/gitlab-rails/lib/api/entities.rb:411:in `block in <class:Milestone>'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:496:in `instance_exec'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:496:in `exec_with_object'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/condition/block_condition.rb:18:in `if_value'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/condition/base.rb:24:in `met?'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:94:in `block in conditions_met?'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:94:in `each'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:94:in `all?'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:94:in `conditions_met?'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:98:in `should_expose?'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:76:in `block (2 levels) in easy_normalized_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:116:in `block in with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/options.rb:90:in `with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:115:in `with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:75:in `block in easy_normalized_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb:53:in `select'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb:53:in `select'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:74:in `easy_normalized_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:83:in `normalized_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `map_entity_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:40:in `serializable_value'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:489:in `serializable_hash'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:69:in `serializable_value'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:41:in `block in serializable_value'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:120:in `block (2 levels) in map_entity_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:116:in `block in with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/options.rb:90:in `with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:115:in `with_attr_path'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:119:in `block in map_entity_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `each'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `each_with_object'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `map_entity_exposures'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:40:in `serializable_value'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:489:in `serializable_hash'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/core_ext/object/json.rb:140:in `block in as_json'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/core_ext/object/json.rb:140:in `map'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/core_ext/object/json.rb:140:in `as_json'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/json/encoding.rb:35:in `encode'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/json/encoding.rb:22:in `encode'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/formatter/json.rb:6:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/formatter.rb:44:in `block in build_formatted_response'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/formatter.rb:44:in `collect'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/formatter.rb:44:in `build_formatted_response'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/formatter.rb:28:in `after'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:34:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:24:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:31:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:24:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-oauth2-1.2.3/lib/rack/oauth2/server/resource.rb:20:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-oauth2-1.2.3/lib/rack/oauth2/server/resource/bearer.rb:8:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/error.rb:37:in `block in call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/error.rb:36:in `catch'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/error.rb:36:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:24:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape_logging-1.7.0/lib/grape_logging/middleware/request_logger.rb:60:in `block in call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape_logging-1.7.0/lib/grape_logging/middleware/request_logger.rb:58:in `catch'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape_logging-1.7.0/lib/grape_logging/middleware/request_logger.rb:58:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/middleware/base.rb:24:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/head.rb:13:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/endpoint.rb:227:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/endpoint.rb:221:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router/route.rb:72:in `exec'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:121:in `process_route'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:74:in `block in identity'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:93:in `transaction'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:72:in `identity'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:57:in `block in call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:137:in `with_optimization'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/router.rb:56:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/api.rb:119:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/api.rb:45:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/grape-1.0.3/lib/grape/api.rb:40:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/routing/mapper.rb:51:in `serve'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/journey/router.rb:43:in `block in serve'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/journey/router.rb:30:in `each'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/journey/router.rb:30:in `serve'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/routing/route_set.rb:817:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/omniauth-1.8.1/lib/omniauth/strategy.rb:190:in `call!'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/omniauth-1.8.1/lib/omniauth/strategy.rb:168:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/multipart.rb:95:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/request_profiler/middleware.rb:14:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/jira/middleware.rb:15:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/go.rb:17:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/etag_caching/middleware.rb:11:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/batch-loader-1.2.1/lib/batch_loader/middleware.rb:11:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-attack-4.4.1/lib/rack/attack.rb:107:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/warden-1.2.7/lib/warden/manager.rb:36:in `block in call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/warden-1.2.7/lib/warden/manager.rb:35:in `catch'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/warden-1.2.7/lib/warden/manager.rb:35:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/etag.rb:24:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/conditionalget.rb:25:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/head.rb:13:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only/controller.rb:28:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only.rb:16:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/flash.rb:260:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/session/abstract/id.rb:225:in `context'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/session/abstract/id.rb:220:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/cookies.rb:560:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/query_cache.rb:36:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:81:in `run_callbacks'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/rack/logger.rb:38:in `call_app'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/rack/logger.rb:20:in `block in call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/tagged_logging.rb:68:in `block in tagged'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/tagged_logging.rb:26:in `tagged'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/tagged_logging.rb:68:in `tagged'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/rack/logger.rb:20:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/request_context.rb:18:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionpack-4.2.10/lib/action_dispatch/middleware/request_id.rb:21:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/methodoverride.rb:22:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/runtime.rb:18:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/lock.rb:17:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/sendfile.rb:113:in `call'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/sentry-raven-2.7.2/lib/raven/integrations/rack.rb:51:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/engine.rb:518:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/application.rb:165:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/railtie.rb:194:in `public_send'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/railtie.rb:194:in `method_missing'
  /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/release_env.rb:10:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/urlmap.rb:66:in `block in call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/urlmap.rb:50:in `each'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/rack-1.6.10/lib/rack/urlmap.rb:50:in `call'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:562:in `process_client'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-worker-killer-0.4.4/lib/unicorn/worker_killer.rb:52:in `process_client'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:658:in `worker_loop'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:132:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `load'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
  /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
  /opt/gitlab/embedded/bin/bundle:23:in `load'
  /opt/gitlab/embedded/bin/bundle:23:in `<main>'

Screenshots

Screen_Shot_2018-07-10_at_14.04.17

Screen_Shot_2018-07-10_at_14.04.33

Output of checks

These are from the Docker Omnibus image with a Premium license, but the bug is also present on gitlab.com.

Results of GitLab environment info


System information
System:
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   2.4.4p296
Gem Version:    2.7.6
Bundler Version:1.16.2
Rake Version:   12.3.1
Redis Version:  3.2.11
Git Version:    2.17.1
Sidekiq Version:5.1.3
Go Version:     unknown

GitLab information
Version:        11.0.3-ee
Revision:       f25aa33
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     postgresql
DB Version:     9.6.8
URL:            http://gitlab
HTTP Clone URL: http://gitlab/some-group/some-project.git
SSH Clone URL:  git@gitlab:some-group/some-project.git
Elasticsearch:  no
Geo:            no
Using LDAP:     yes
Using Omniauth: no

GitLab Shell
Version:        7.1.4
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
Hooks:          /opt/gitlab/embedded/service/gitlab-shell/hooks
Git:            /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 7.1.4 ? ... OK (7.1.4)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
2/1 ... repository is empty
3/2 ... repository is empty
3/3 ... repository is empty
3/4 ... repository is empty
3/5 ... repository is empty
3/6 ... repository is empty
3/7 ... repository is empty
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml
Checking LDAP ...

Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
	REDACTED

Checking LDAP ... Finished

Checking GitLab ...

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
3/2 ... yes
3/3 ... yes
3/4 ... yes
3/5 ... yes
3/6 ... yes
3/7 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.4.4)
Git version >= 2.9.5 ? ... yes (2.17.1)
Git user has default SSH configuration? ... yes
Active users: ... 2
Elasticsearch version 5.1 - 5.5? ... skipped (elasticsearch is disabled)

Checking GitLab ... Finished

Ideas

It looks like these special milestone settings are stored in the database as negative numbers:

Screen_Shot_2018-07-10_at_14.05.02

I think that the get board logic in the API controller just fails to account for these negative numbers, and it tries to look up a milestone in the database with an ID of -3.

/labels ~bug customer