YetOpen/certbot-zimbra

zmcertmgr error

skelkelos992 opened this issue · 1 comments

The following error is shown when renewing a certificate and the deploy-hook is executed on a Rocky Linux 8 / Zimbra 9.0.0 server:

 Deploying certificates.
 zmcertmgr: ERROR deploycrt(comm /run/certbot_zimbra.sh/certs-oXnDDaXJ/cert.pem /run/certbot_zimbra.sh/certs-oXnDDaXJ/zimbra_chain.pem) failed:
  chdir(/root) failed: Permission denied

Folder permissions are the following

dr-xr-x--- 2 root zimbra 100 4 giu 10.08 certs-9YhF8BWL

To solve the issue I had to manually run as zimbra user

zmcertmgr deploycrt comm /run/certbot_zimbra.sh/certs-9YhF8BWL/cert.pem /run/certbot_zimbra.sh/certs-9YhF8BWL/zimbra_chain.pem

and then

zmcontrol restart

zmcertmgr seems to want to chdir into PWD, since PWD=/root and zmcertmgr is ran as zimbra it doesn't have permission to access that path. I don't know why zmcertmgr is doing this, it doesn't need to. I didn't encounter this bug when doing testing as I always ran certbot_zimbra with sudo, never as logged-in root in /root.