openai/codex · error
login error page template must render
Error message
login error page template must render: {err} What it means
render_login_error_page failed to substitute values into the static LOGIN_ERROR_PAGE_TEMPLATE. The inputs are HTML-escaped before rendering, so a failure means the embedded template's placeholders are malformed — a build/packaging invariant, not bad user input.
Solutions
- Report as a bug: the embedded error page template has invalid placeholders
- Rebuild from a source tree with a valid assets/error.html
- Fall back to a plain-text error response if HTML rendering keeps failing
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/login/src/server.rs:1115 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/e3364896d357af62.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/login/src/server.rs:1115
)
} else {
(
"Sign-in could not be completed".to_string(),
message.to_string(),
error_description.unwrap_or(message).to_string(),
"Return to Codex to retry, switch accounts, or contact your workspace admin if access is restricted."
.to_string(),
)
};
LOGIN_ERROR_PAGE_TEMPLATE
.render([
("error_title", html_escape(&title)),
("error_message", html_escape(&display_message)),
("error_code", html_escape(code)),
("error_description", html_escape(&display_description)),
("error_help", html_escape(&help_text)),
])
.unwrap_or_else(|err| panic!("login error page template must render: {err}"))
.into_bytes()
}
/// Escapes error strings before inserting them into HTML.
fn html_escape(input: &str) -> String {
let mut escaped = String::with_capacity(input.len());
for ch in input.chars() {
match ch {
'&' => escaped.push_str("&"),
'<' => escaped.push_str("<"),
'>' => escaped.push_str(">"),
'"' => escaped.push_str("""),
'\'' => escaped.push_str("'"),
_ => escaped.push(ch),
}
}
escaped
}View on GitHub (pinned to 339751715c)