Pre/post hooks run OK, but with errors?

This isn't a big deal I don't think, but I'm curious...

I have a machine on which I need temporarily to stop a docker container that's running a web server on port 80 during renewal. So I've put pre and post scripts into /etc/letsencrypt/renewal-hooks that bounces the container down/up, like this:

#!/bin/bash

cd /opt/Signal-TLS-Proxy
docker compose down

That works fine, but certbot talks about errors along the way:

Hook 'pre-hook' ran with error output:
 Container signal-tls-proxy-nginx-terminate-1  Stopping
  Container signal-tls-proxy-nginx-relay-1  Stopping
  Container signal-tls-proxy-certbot-1  Stopping
  Container signal-tls-proxy-certbot-1  Stopped
  Container signal-tls-proxy-certbot-1  Removing
  Container signal-tls-proxy-certbot-1  Removed
  Container signal-tls-proxy-nginx-relay-1  Stopped
  Container signal-tls-proxy-nginx-relay-1  Removing
  Container signal-tls-proxy-nginx-relay-1  Removed
  Container signal-tls-proxy-nginx-terminate-1  Stopped
  Container signal-tls-proxy-nginx-terminate-1  Removing
  Container signal-tls-proxy-nginx-terminate-1  Removed
  Network signal-tls-proxy_default  Removing
  Network signal-tls-proxy_default  Removed

When I run the script by hand, I don't see those messages though, which is a bit strange. So I've just directed the outputs to /dev/null as it all seems to work (on a dry-run at least).

Curious as to why certbot interprets these lines as errors though.

Ubuntu 22.04.5 certbot 1.21.0

I think if the command outputs to the stderr stream then that's interpreted as an error:

2 Likes

It's a bit similar to container is up-to-date reports to stderr · Issue #6482 · docker/compose · GitHub

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.