Fetching issue events fails with error 500

For one project on my gitlab instance, I'm getting a error 500 while fetching issue events.

The following output can be found on the logs (I don't know in which exact file, as I execute sudo gitlab-ctl tail | grep issue)

ActionView::Template::Error (undefined method `issue_type' for #<Project id:333 NAMESPACE/PROJECT>>):

for all other projects, fetching issue events works file. it also fails in the dashboard with the same error mentioned above.

Full stacktrace
NoMethodError: undefined method `issue_type' for #<Project id:69389823 derTizen/FreifunkCompanion>> (NoMethodError)
Did you mean?  issue_path
  from active_model/attribute_methods.rb:512:in `method_missing'
  from active_record/attribute_methods.rb:495:in `method_missing'
  from grape-path-helpers/named_route_matcher.rb:7:in `method_missing'
  from app/presenters/event_presenter.rb:42:in `target_type_name'
  from app/views/events/event/_common.html.haml:12
  from action_view/base.rb:278:in `public_send'
  from action_view/base.rb:278:in `_run'
  from action_view/template.rb:285:in `block in render'
  from active_support/notifications.rb:212:in `instrument'
  from action_view/template.rb:584:in `instrument_render_template'
  from action_view/template.rb:273:in `render'
  from action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'
  from active_support/notifications.rb:212:in `instrument'
  from action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
  from action_view/renderer/partial_renderer.rb:237:in `render'
  from action_view/renderer/renderer.rb:78:in `render_partial_to_object'
  from action_view/renderer/renderer.rb:49:in `render_partial'
  from action_view/helpers/rendering_helper.rb:44:in `render'
  from app/views/events/_event.html.haml:33
  from action_view/base.rb:278:in `public_send'
  from action_view/base.rb:278:in `_run'
  from action_view/template.rb:285:in `block in render'
  from active_support/notifications.rb:212:in `instrument'
  from action_view/template.rb:584:in `instrument_render_template'
  from action_view/template.rb:273:in `render'
  from action_view/renderer/collection_renderer.rb:197:in `block in collection_with_template'
  from action_view/renderer/collection_renderer.rb:74:in `block in each_with_info'
  from action_view/renderer/collection_renderer.rb:74:in `each'
  from action_view/renderer/collection_renderer.rb:74:in `each_with_info'
  from action_view/renderer/collection_renderer.rb:188:in `each'
  from action_view/renderer/collection_renderer.rb:188:in `map'
  from action_view/renderer/collection_renderer.rb:188:in `collection_with_template'
  from action_view/renderer/collection_renderer.rb:170:in `block (2 levels) in render_collection'
  from action_view/renderer/partial_renderer/collection_caching.rb:21:in `cache_collection_render'
  from action_view/renderer/collection_renderer.rb:169:in `block in render_collection'
  from active_support/notifications.rb:212:in `instrument'
  from action_view/renderer/collection_renderer.rb:155:in `render_collection'
  from action_view/renderer/collection_renderer.rb:127:in `render_collection_with_partial'
  from action_view/renderer/renderer.rb:69:in `render_partial_to_object'
  from action_view/renderer/renderer.rb:29:in `render_to_object'
  from action_view/renderer/renderer.rb:24:in `render'
  from action_view/helpers/rendering_helper.rb:37:in `block in render'
  from action_view/base.rb:305:in `in_rendering_context'
  from action_view/helpers/rendering_helper.rb:33:in `render'
  from app/views/events/_events.html.haml:11
  from action_view/base.rb:278:in `public_send'
  from action_view/base.rb:278:in `_run'
  from action_view/template.rb:285:in `block in render'
  from active_support/notifications.rb:212:in `instrument'
  from action_view/template.rb:584:in `instrument_render_template'
  from action_view/template.rb:273:in `render'
  from action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'
  from active_support/notifications.rb:210:in `block in instrument'
  from active_support/notifications/instrumenter.rb:58:in `instrument'
  from active_support/notifications.rb:210:in `instrument'
  from action_view/renderer/template_renderer.rb:60:in `block in render_template'
  from action_view/renderer/template_renderer.rb:80:in `render_with_layout'
  from action_view/renderer/template_renderer.rb:59:in `render_template'
  from action_view/renderer/template_renderer.rb:11:in `render'
  from action_view/renderer/renderer.rb:58:in `render_template_to_object'
  from action_view/renderer/renderer.rb:31:in `render_to_object'
  from action_view/rendering.rb:135:in `block in _render_template'
  from action_view/base.rb:305:in `in_rendering_context'
  from action_view/rendering.rb:134:in `_render_template'
  from action_controller/metal/streaming.rb:258:in `_render_template'
  from action_view/rendering.rb:121:in `render_to_body'
  from action_controller/metal/rendering.rb:186:in `render_to_body'
  from action_controller/metal/renderers.rb:142:in `render_to_body'
  from abstract_controller/rendering.rb:47:in `render_to_string'
  from action_controller/metal/rendering.rb:175:in `render_to_string'
  from app/controllers/application_controller.rb:338:in `pager_json'
  from app/controllers/projects_controller.rb:164:in `block (2 levels) in activity'
  from action_controller/metal/mime_responds.rb:224:in `respond_to'
  from app/controllers/projects_controller.rb:160:in `activity'
  from action_controller/metal/basic_implicit_render.rb:8:in `send_action'
  from abstract_controller/base.rb:215:in `process_action'
  from action_controller/metal/rendering.rb:193:in `process_action'
  from abstract_controller/callbacks.rb:261:in `block in process_action'
  from active_support/callbacks.rb:121:in `block in run_callbacks'
  from app/controllers/application_controller.rb:487:in `set_current_admin'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from lib/gitlab/session.rb:11:in `with_session'
  from app/controllers/application_controller.rb:478:in `set_session_storage'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from lib/gitlab/i18n.rb:116:in `with_locale'
  from app/controllers/application_controller.rb:471:in `set_locale'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from app/controllers/application_controller.rb:458:in `set_current_context'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from lib/gitlab/ip_address_state.rb:11:in `with'
  from app/controllers/application_controller.rb:464:in `set_current_ip_address'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from marginalia.rb:109:in `record_query_comment'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from sentry/rails/controller_transaction.rb:34:in `block in sentry_around_action'
  from sentry/hub.rb:138:in `with_child_span'
  from sentry-ruby.rb:515:in `with_child_span'
  from sentry/rails/controller_transaction.rb:18:in `sentry_around_action'
  from active_support/callbacks.rb:130:in `block in run_callbacks'
  from active_support/callbacks.rb:141:in `run_callbacks'
  from abstract_controller/callbacks.rb:260:in `process_action'
  from action_controller/metal/rescue.rb:27:in `process_action'
  from action_controller/metal/instrumentation.rb:77:in `block in process_action'
  from active_support/notifications.rb:210:in `block in instrument'
  from active_support/notifications/instrumenter.rb:58:in `instrument'
  from active_support/notifications.rb:210:in `instrument'
  from action_controller/metal/instrumentation.rb:76:in `process_action'
  from action_controller/metal/params_wrapper.rb:259:in `process_action'
  from active_record/railties/controller_runtime.rb:39:in `process_action'
  from abstract_controller/base.rb:152:in `process'
  from action_view/rendering.rb:40:in `process'
  from action_controller/metal.rb:252:in `dispatch'
  from action_controller/metal.rb:333:in `block in dispatch'
  from lib/gitlab/middleware/action_controller_static_context.rb:23:in `call'
  from action_controller/metal.rb:333:in `dispatch'
  from action_dispatch/routing/route_set.rb:67:in `dispatch'
  from action_dispatch/routing/route_set.rb:50:in `serve'
  from action_dispatch/routing/mapper.rb:32:in `block in <class:Constraints>'
  from action_dispatch/routing/mapper.rb:62:in `serve'
  from action_dispatch/journey/router.rb:53:in `block in serve'
  from config/initializers/action_dispatch_journey_router.rb:52:in `block in find_routes'
  from config/initializers/action_dispatch_journey_router.rb:25:in `map!'
  from config/initializers/action_dispatch_journey_router.rb:25:in `find_routes'
  from action_dispatch/journey/router.rb:34:in `serve'
  from action_dispatch/routing/route_set.rb:896:in `call'
  from gitlab/experiment/middleware.rb:19:in `call'
  from omniauth/strategy.rb:202:in `call!'
  from omniauth/strategy.rb:169:in `call'
  from omniauth/strategy.rb:478:in `call_app!'
  from omni_auth/strategies/group_saml.rb:41:in `other_phase'
  from omniauth/strategy.rb:195:in `call!'
  from omniauth/strategy.rb:169:in `call'
  from omniauth/strategy.rb:202:in `call!'
  from omniauth/strategy.rb:169:in `call'
  from omniauth/strategy.rb:202:in `call!'
  from omniauth/strategy.rb:169:in `call'
  from omniauth/strategy.rb:202:in `call!'
  from omniauth/strategy.rb:169:in `call'
  from flipper/middleware/memoizer.rb:72:in `memoized_call'
  from flipper/middleware/memoizer.rb:37:in `call'
  from lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
  from lib/gitlab/middleware/sidekiq_shard_awareness_validation.rb:20:in `block in call'
  from lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
  from lib/gitlab/middleware/sidekiq_shard_awareness_validation.rb:20:in `call'
  from lib/gitlab/middleware/memory_report.rb:13:in `call'
  from lib/gitlab/middleware/speedscope.rb:13:in `call'
  from lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
  from lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
  from lib/gitlab/etag_caching/middleware.rb:21:in `call'
  from lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
  from lib/gitlab/metrics/web_transaction.rb:46:in `run'
  from lib/gitlab/metrics/rack_middleware.rb:16:in `call'
  from lib/gitlab/middleware/go.rb:21:in `call'
  from lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'
  from lib/gitlab/database/query_analyzer.rb:83:in `within'
  from lib/gitlab/middleware/query_analyzer.rb:11:in `call'
  from lib/ci/job_token/middleware.rb:11:in `call'
  from batch_loader/middleware.rb:11:in `call'
  from rack/attack.rb:105:in `call'
  from apollo_upload_server/middleware.rb:19:in `call'
  from lib/gitlab/middleware/multipart.rb:176:in `call'
  from lib/gitlab/middleware/rack_attack_headers.rb:42:in `call'
  from rack/attack.rb:129:in `call'
  from warden/manager.rb:36:in `block in call'
  from warden/manager.rb:34:in `catch'
  from warden/manager.rb:34:in `call'
  from rack/cors.rb:102:in `call'
  from rack/tempfile_reaper.rb:15:in `call'
  from rack/etag.rb:27:in `call'
  from rack/conditional_get.rb:27:in `call'
  from rack/head.rb:12:in `call'
  from action_dispatch/http/permissions_policy.rb:38:in `call'
  from action_dispatch/http/content_security_policy.rb:38:in `call'
  from lib/gitlab/middleware/read_only/controller.rb:40:in `call'
  from lib/gitlab/middleware/read_only.rb:18:in `call'
  from lib/gitlab/middleware/unauthenticated_session_expiry.rb:18:in `call'
  from rack/session/abstract/id.rb:266:in `context'
  from rack/session/abstract/id.rb:260:in `call'
  from lib/gitlab/middleware/secure_headers.rb:11:in `call'
  from action_dispatch/middleware/cookies.rb:704:in `call'
  from lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
  from action_dispatch/middleware/callbacks.rb:31:in `block in call'
  from active_support/callbacks.rb:101:in `run_callbacks'
  from action_dispatch/middleware/callbacks.rb:30:in `call'
  from sentry/rails/rescued_exception_interceptor.rb:14:in `call'
  from action_dispatch/middleware/debug_exceptions.rb:31:in `call'
  from lib/gitlab/middleware/path_traversal_check.rb:40:in `call'
  from lib/gitlab/middleware/handle_malformed_strings.rb:19:in `call'
  from lib/gitlab/middleware/json_validation.rb:165:in `call'
  from sentry/rack/capture_exceptions.rb:30:in `block (2 levels) in call'
  from sentry/hub.rb:299:in `with_session_tracking'
  from sentry-ruby.rb:428:in `with_session_tracking'
  from sentry/rack/capture_exceptions.rb:21:in `block in call'
  from sentry/hub.rb:89:in `with_scope'
  from sentry-ruby.rb:408:in `with_scope'
  from sentry/rack/capture_exceptions.rb:20:in `call'
  from action_dispatch/middleware/show_exceptions.rb:32:in `call'
  from lib/gitlab/middleware/basic_health_check.rb:25:in `call'
  from lograge/rails_ext/rack/logger.rb:15:in `call_app'
  from rails/rack/logger.rb:29:in `call'
  from action_dispatch/middleware/remote_ip.rb:96:in `call'
  from lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
  from lib/gitlab/middleware/request_context.rb:15:in `call'
  from lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
  from request_store/middleware.rb:19:in `call'
  from rack/method_override.rb:24:in `call'
  from rack/runtime.rb:22:in `call'
  from rack/timeout/core.rb:154:in `block in call'
  from rack/timeout/support/timeout.rb:19:in `timeout'
  from rack/timeout/core.rb:153:in `call'
  from config/initializers/fix_local_cache_middleware.rb:11:in `call'
  from lib/gitlab/middleware/compressed_json.rb:44:in `call'
  from action_dispatch/middleware/executor.rb:16:in `call'
  from lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
  from rack/sendfile.rb:127:in `call'
  from lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
  from lib/gitlab/metrics/requests_rack_middleware.rb:83:in `call'
  from labkit/middleware/rack.rb:22:in `block in call'
  from labkit/context.rb:43:in `with_context'
  from labkit/middleware/rack.rb:21:in `call'
  from action_dispatch/middleware/request_id.rb:33:in `call'
  from lib/gitlab/middleware/cors_static_assets.rb:19:in `call'
  from rails/engine.rb:535:in `call'
  from rails/railtie.rb:226:in `public_send'
  from rails/railtie.rb:226:in `method_missing'
  from lib/gitlab/middleware/release_env.rb:12:in `call'
  from rack/urlmap.rb:74:in `block in call'
  from rack/urlmap.rb:58:in `each'
  from rack/urlmap.rb:58:in `call'
  from puma/configuration.rb:279:in `call'
  from puma/request.rb:99:in `block in handle_request'
  from puma/thread_pool.rb:390:in `with_force_shutdown'
  from puma/request.rb:98:in `handle_request'
  from puma/server.rb:472:in `process_client'
  from puma/server.rb:254:in `block in run'
  from puma/thread_pool.rb:167:in `block in spawn_thread'
Edited by Alexandru Croitor