acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
41.69k stars 5.17k forks source link

The --deploy-hook cpanel_uapi warning: No such file or directory #6228

Open izmeez opened 1 month ago

izmeez commented 1 month ago

This is essentially a cosmetic issue, it does not limit how the script works.

After a certificate is created it can be deployed to cpanel with command line: acme.sh --deploy --deploy-hook cpanel_uapi -d example.com

Subsequently, when certificates are renewed the deploy hook works and cpanel is updated to use the renewed certificates.

A certificate can be created by either:

  1. Using the -d option for each domain.
  2. By first creating a CSR and then using the --signcsr --csr option.

When the second method is used, each time cron renews and deploys a certificate it outputs:

/home/user/.acme.sh/deploy/cpanel_uapi.sh: line 37: /home/user/.acme.sh/example.com/example.com.key: No such file or directory

Followed by several lines of warnings:

[2025-01-26 00:23:13 -0500] warn [Internal Warning while parsing unknown 1709225] Use of uninitialized value in goto at /var/cpanel/perl5/lib/NcCustomHooks/SSL.pm line 32. at /var/cpanel/perl5/lib/NcCustomHooks/SSL.pm line 32. NcCustomHooks::SSL::get_api_client("/var/cpanel/perl5/lib/NcCustomHooks/.hAPIcPanel.conf") called at /var/cpanel/perl5/lib/NcCustomHooks/SSL.pm line 100 NcCustomHooks::SSL::NotifyChanges(HASH(0x3d54338), HASH(0x3d543b0)) called at /usr/local/cpanel/Cpanel/Hooks.pm line 563 eval {...} called at /usr/local/cpanel/Cpanel/Hooks.pm line 561 Cpanel::Hooks::_exec_module("main", HASH(0x3d431e0), HASH(0x3d54338), HASH(0x3d543b0)) called at /usr/local/cpanel/Cpanel/Hooks.pm line 376 Cpanel::Hooks::_exec_hook("main", HASH(0x3d431e0), HASH(0x3d54338), HASH(0x3d543b0)) called at /usr/local/cpanel/Cpanel/Hooks.pm line 276 eval {...} called at /usr/local/cpanel/Cpanel/Hooks.pm line 271 Cpanel::Hooks::hook(HASH(0x3d54338), HASH(0x176cf80)) called at /usr/local/cpanel/Cpanel/EventHandler.pm line 146 Cpanel::EventHandler::_uapi_std_hook("SSL", "install_ssl", Cpanel::Args=HASH(0x3894e28), Cpanel::Result=HASH(0x3bf9b98), "post") called at /usr/local/cpanel/Cpanel/EventHandler.pm line 123 Cpanel::EventHandler::post_api("SSL", "install_ssl", Cpanel::Args=HASH(0x3894e28), Cpanel::Result=HASH(0x3bf9b98)) called at /usr/local/cpanel/Cpanel/API.pm line 260 Cpanel::API::execute("SSL", "install_ssl", HASH(0x3bf99b8)) called at /usr/local/cpanel/Cpanel/API.pm line 654 Cpanel::API::run_api_mode(HASH(0x3bf99b8)) called at uapi.pl line 307 main::script() called at uapi.pl line 139

[2025-01-26 00:23:13 -0500] warn [uapi] Use of uninitialized value in concatenation (.) or string at /var/cpanel/perl5/lib/NameCheap/RestApiClient.pm line 31.

This does not happen when the first method above is used because the acme.sh script finds the key file in the ~/.acme.sh/ directories, whereas with the second method the key file is added to cpanel when the CSR is created and it is not necessary for deployment of the certificate when it is renewed.

Seen on v3.1.0 and previous versions.

github-actions[bot] commented 1 month ago

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.