Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal Server Error, expected 404 #68

Open
just806me opened this issue Feb 12, 2022 · 1 comment
Open

500 Internal Server Error, expected 404 #68

just806me opened this issue Feb 12, 2022 · 1 comment

Comments

@just806me
Copy link
Contributor

I, [2022-02-12T13:36:05.949149 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3] Started GET "/contests/1/statistics" for 207.46.13.172 at 2022-02-12 13:36:05 +0200
I, [2022-02-12T13:36:05.950508 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3] Processing by StatisticsController#index as */*
I, [2022-02-12T13:36:05.950766 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Parameters: {"contest_id"=>"1"}
I, [2022-02-12T13:36:05.952530 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Device ID: fe52e922-63bf-4d7e-a547-57ff46ce7e33
D, [2022-02-12T13:36:05.954122 #31113] DEBUG -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Rendering layout layouts/application.html.erb
D, [2022-02-12T13:36:05.954906 #31113] DEBUG -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Rendering statistics/index.html.erb within layouts/application
D, [2022-02-12T13:36:05.958151 #31113] DEBUG -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Contest Exists? (0.9ms)  SELECT 1 AS one FROM "contests" WHERE "contests"."archived" = $1 AND (upload_open OR registration_open) LIMIT $2  [["archived", false], ["LIMIT", 1]]
D, [2022-02-12T13:36:05.960017 #31113] DEBUG -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Contest Load (0.8ms)  SELECT "contests".* FROM "contests" WHERE "contests"."archived" = $1 AND "contests"."id" = $2 LIMIT $3  [["archived", false], ["id", 1], ["LIMIT", 1]]
I, [2022-02-12T13:36:05.961083 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Rendered statistics/index.html.erb within layouts/application (Duration: 5.9ms | Allocations: 1196)
I, [2022-02-12T13:36:05.961267 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   Rendered layout layouts/application.html.erb (Duration: 6.4ms | Allocations: 1245)
I, [2022-02-12T13:36:05.961697 #31113]  INFO -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3] Completed 500 Internal Server Error in 10ms (ActiveRecord: 1.7ms | Allocations: 2283)
F, [2022-02-12T13:36:05.963667 #31113] FATAL -- : [095aa819-e451-4e38-b935-55bd4e7fc4b3]   
[095aa819-e451-4e38-b935-55bd4e7fc4b3] ActionView::Template::Error (Couldn't find Contest with 'id'=1 [WHERE "contests"."archived" = $1]):
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     4:     <tr>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     5:       <th>ID</th>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     6:       <th>Прізвище, Ім'я, По батькові</th>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     7:       <% contest.tasks.order(:id).each do |task| %>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     8:         <th><%= task.display_name %></th>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]     9:       <% end %>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]    10:     </tr>
[095aa819-e451-4e38-b935-55bd4e7fc4b3]   
[095aa819-e451-4e38-b935-55bd4e7fc4b3] app/controllers/application_controller.rb:45:in `contest'
[095aa819-e451-4e38-b935-55bd4e7fc4b3] app/controllers/application_controller.rb:29:in `contest'
[095aa819-e451-4e38-b935-55bd4e7fc4b3] app/views/statistics/index.html.erb:7

@just806me
Copy link
Contributor Author

It actually returns "HTTP/1.1 404 Not Found", but in the logs it shows "Completed 500 Internal Server Error" 🤔

$ curl -I http://localhost:3000/contests/1/statistics             
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
X-Request-Id: 5ae4cd4e-9bbd-4013-80aa-e8c1b5d0535e
X-Runtime: 0.020854
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 1722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant