Skip to content

500 error in Project Milestone detail page with JSON format request

Summary

Project Milestone detail page with the request of JSON format always returns a 500 error of the HTTP status code, not 406.

Steps to reproduce

  1. You can see 500 error when you execute the following code in your terminal:
curl -v -H 'Accept: application/json' https://gitlab.com/gitlab-org/gitlab-ce/milestones/1

Example Project

Reproduced on gitlab.com (as of 2017-07-17) as well as master of gitlab-ce source.

What is the current bug behavior?

< HTTP/1.1 500 Internal Server Error
< Content-Type: text/html; charset=utf-8
< [...]
<
<!DOCTYPE html>
<html>
<head>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
  <title>Something went wrong (500)</title>
[...]

What is the expected correct behavior?

< HTTP/1.1 406 Not Acceptable
< Content-Type: text/html; charset=utf-8
< Content-Length: 0
< [...]

Relevant logs and/or screenshots

ActionView::MissingTemplate at /gitlab-org/gitlab-ce/milestones/1
=================================================================

> Missing template projects/milestones/show, projects/application/show, application/show with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :haml]}. Searched in:

Output of checks / Results of GitLab environment info / Results of GitLab application Check

This bug happens on GitLab.com.

Possible fixes

We may return 406 status code.

Edited by Takuya Noguchi