Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - rfc805

#16
22.7 Legacy Series / AcmeClient upload_sftp debugging
November 05, 2022, 09:27:58 PM
So I think this is a topic that's come up before, but I can't seem to find an answer.

I have an upload_sftp automation set up which goes to an Ubuntu VM.  Testing the connection passes, but when I run the automation, nothing happens.  I see in the system log:

<13>1 2022-11-05T14:57:18-05:00 gwo opnsense 50444 - [meta sequenceId="3"] AcmeClient: running automations for certificate: <cn>
<13>1 2022-11-05T14:57:18-05:00 gwo opnsense 50444 - [meta sequenceId="4"] AcmeClient: running automation (configd): <cn> ssl dist

Nothing seems to happen at this point.  If I do a tcpdump on the interface it would go out, I don't see anything happen.  There are no further log messages.

If I run upload_sftp.php manually, it works fine.

root@gwo:/usr/local/opnsense/scripts/OPNsense/AcmeClient # ./upload_sftp.php --log --host=<cn> --user=ssldist --certificates=<cn>
INFO: Logging to stdout enabled
INFO: No host key specified, using existing known_hosts entry for '<cn>'
INFO: SFTP: Connected to <cn>.
INFO: SFTP: sftp> pwd
INFO: SFTP: sftp> cd '/home/ssldist/<cn>'
INFO: SFTP: stat remote: No such file or directory
INFO: Creating remote directory: /home/ssldist/<cn>
INFO: SFTP: sftp> pwd
INFO: SFTP: sftp> mkdir '/home/ssldist/<cn>'
INFO: SFTP: sftp> cd '/home/ssldist/<cn>'
INFO: SFTP: sftp> pwd
INFO: SFTP: sftp> ls -la
INFO: SFTP: sftp> put '/tmp/sftp-upload-AyaTmK' 'ca.pem'
INFO: SFTP: Uploading /tmp/sftp-upload-AyaTmK to /home/ssldist/<cn>/ca.pem
INFO: SFTP: sftp> put '/tmp/sftp-upload-Ws0HCw' 'cert.pem'
INFO: SFTP: Uploading /tmp/sftp-upload-Ws0HCw to /home/ssldist/<cn>/cert.pem
INFO: SFTP: sftp> put '/tmp/sftp-upload-5MZRRw' 'fullchain.pem'
INFO: SFTP: Uploading /tmp/sftp-upload-5MZRRw to /home/ssldist/<cn>/fullchain.pem
INFO: SFTP: sftp> put '/tmp/sftp-upload-e035Kt' 'key.pem'
INFO: SFTP: Uploading /tmp/sftp-upload-e035Kt to /home/ssldist/<cn>/key.pem
INFO: SFTP: sftp> exit

I can't seem to find a way to further debug why the automation fails - I would expect it to be using equivalent arguments to what I'm running, but they don't seem to be logged anywhere.  Any tips for why the automation would fail when the script works?