Docs.rs: 500 internal error on error pages

Created on 6 Jun 2020  路  5Comments  路  Source: rust-lang/docs.rs

While trying to handle an error, docs.rs will run into more errors!

2020/06/05 17:59:14 [ERROR] cratesfyi::web: internal server error: Template not found: resp

Possibly relevant code: https://github.com/rust-lang/docs.rs/blob/bdaf33b822247a428e11da64bc17e5699363b22b/src/web/mod.rs#L17

cc @Kixiron

A-frontend C-bug S-needs-reproduction-steps

Most helpful comment

I agree this this looks like it's just always been broken. I don't think #802 will have affected it since that only touched the error paths, this returns an Ok(BadRequest) (which seems wrong, all uses of ctry!/cexpect! seem like 500s, not 400s). (EDIT: Oh, but if by revealed you mean you got a 500 + a log-line instead of just a 404 when the template failed to render, maybe #802 could have made that happen).

Hitting any of the code paths that trigger this seems rare, they should all be "never happens" sorts of errors.

I think with the changes in #802 ctry and cexpect can probably be replaced by ?/.ok_or()? now, since that will now log the error and give back an error page.

All 5 comments

This is just weird as all get out, I think this may have been broken for an indefinite period of time, we've just never noticed it because it requires a ctry'd or cexpect'd internal server error, which (thankfully) don't happen often

Originally I thought it might be caused by #805 but it's possible this has been happening much longer and just recently got revealed by https://github.com/rust-lang/docs.rs/pull/802.

805 removed no code, it just added stuff

I agree this this looks like it's just always been broken. I don't think #802 will have affected it since that only touched the error paths, this returns an Ok(BadRequest) (which seems wrong, all uses of ctry!/cexpect! seem like 500s, not 400s). (EDIT: Oh, but if by revealed you mean you got a 500 + a log-line instead of just a 404 when the template failed to render, maybe #802 could have made that happen).

Hitting any of the code paths that trigger this seems rare, they should all be "never happens" sorts of errors.

I think with the changes in #802 ctry and cexpect can probably be replaced by ?/.ok_or()? now, since that will now log the error and give back an error page.

Was this page helpful?
0 / 5 - 0 ratings