Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

certbot: `renew --once` exits 0 when the renewed hook fails

Aberta
#1,012 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
64/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
rust
Domínio
cli

Direção de pesquisa

Comece em dstack/certbot/src/bot.rs, acompanhando como renew_and_run_hook relata falhas do hook de renovação, e depois siga o caminho --once em cli/src/main.rs. Preserve o comportamento atual do loop do daemon de registrar e continuar, mas faça com que --once retorne um código de saída diferente de zero quando o hook não for executado ou terminar sem sucesso. Verifique ambas as semânticas com os caminhos de comando relevantes do certbot.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug rust

Follow-up to #924.

certbot renew --once is the cron/one-shot entry point. #924 made it invoke the renewed_hook (correct — a one-shot renewal that skips the reload hook leaves the serving process on the old cert), but hook failures are only logged:

// dstack/certbot/src/bot.rs
match std::process::Command::new("/bin/sh").arg("-c").arg(hook).status() {
    Ok(status) if status.success() => {}
    Ok(status) => error!("renewed hook failed with status: {status}"),
    Err(error) => error!("failed to run renewed hook: {error:?}"),
}
Ok(true)

So renew_and_run_hook returns Ok(true) regardless, and certbot renew --once exits 0 even when the hook never ran or exited non-zero. A cron job or systemd OneShot unit wrapping this sees success while the certificate on disk is new and the serving process is still holding the old one — exactly the failure that is supposed to be visible.

Swallowing the error is right for the daemon (the next interval retries), wrong for --once (there is no next interval).

Proposal

Split the two semantics. Options, roughly in order of preference:

  1. Have renew_and_run_hook return the hook outcome (e.g. Result<Outcome> carrying hook_failed) and let the --once path in cli/src/main.rs turn a hook failure into a non-zero exit, while run() keeps logging and continuing.
  2. Add a fail_on_hook_error: bool parameter, set from the once flag.

Either way the daemon loop must keep its current behaviour: a failing hook should not abort the loop.

Linguagem predominante
Rust
Estrelas
551
Forks
97
Merge médio
19h 22min
PRs com merge (30d)
109

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Dstack-TEE/dstack

Todas as issues de Dstack-TEE/dstack

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.