snikket-im/snikket-server

How to force certbot to re-request new certificates for first time?

st1111th opened this issue · 3 comments

I seem to be stuck at requesting the certs. I had some issues to fix but all should be good, however it seems the certs are not being requested.

logs from snikket/snikket-cert-manager:beta

Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)
Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)
Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)
Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)
Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)
Anacron 2.3 started on 2023-11-17
Normal exit (0 jobs run)

I tried this:

docker-compose exec snikket_certs su letsencrypt -- -c "certbot renew --config-dir /snikket/letsencrypt --cert-path /etc/ssl/certbot --force-renew

But it doesn't work, is there a different command I should be running? ie not renew, it's the first time getting certs.

Also getting this error when starting:

docker container logs bdab55f564a2
Anacron 2.3 started on 2023-11-23
Will run job cron.daily' Will run job cron.weekly'
Will run job cron.monthly' Jobs will be executed sequentially Job cron.daily' started
Job cron.daily' terminated (mailing output) Job cron.weekly' started
From: Anacron
To: root
Subject: Anacron job 'cron.daily' on bdab55f564a2
Content-Type: text/plain; charset=US-ASCII

/etc/cron.daily/certbot:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in
sys.exit(load_entry_point('certbot==1.12.0', 'console_scripts', 'certbot')())
File "/usr/lib/python3/dist-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1377, in main
log.pre_arg_parse_setup()
File "/usr/lib/python3/dist-packages/certbot/_internal/log.py", line 62, in pre_arg_parse_setup
temp_handler = TempHandler()
File "/usr/lib/python3/dist-packages/certbot/_internal/log.py", line 248, in init
self._workdir = tempfile.mkdtemp()
File "/usr/lib/python3.9/tempfile.py", line 487, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "/usr/lib/python3.9/tempfile.py", line 257, in _sanitize_params
dir = gettempdir()
File "/usr/lib/python3.9/tempfile.py", line 426, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/lib/python3.9/tempfile.py", line 358, in _get_default_tempdir
raise FileNotFoundError(_errno.ENOENT,
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
sed: can't read /var/log/letsencrypt/letsencrypt.log: No such file or directory
Job cron.weekly' terminated Job cron.monthly' started
Job `cron.monthly' terminated
Normal exit (3 jobs run)

Will keep trying things

Hey, did you have luck with this? I've not seen those errors before, so it sounds like something has gone weird with your setup. If you need help, I recommend the community chat, links here: https://snikket.org/contact/

Based on the commands you ran, I assume you also saw these docs, but just in case: https://snikket.org/service/help/setup/troubleshooting/#certificate-problems

I think I had some issue with routes,

I progressed past it and the issue resolved itself once I was deploying on a VPS with a public IP.

I'm sure there is a way for this to work behind a NAT, but I was only using it on my local PC for testing before deploying to VPS anyway.

Cheers