create-backup.sh fails with the error: 'Failed to obtain current webserver certificate ID' using cron for VMware Cloud Director 10.5.x
search cancel

create-backup.sh fails with the error: 'Failed to obtain current webserver certificate ID' using cron for VMware Cloud Director 10.5.x

book

Article ID: 380469

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • A cron job is being used to call the /opt/vmware/appliance/bin/create-backup.sh script to perform backups of VMware Cloud Director (vCD) 10.5.x, but does not execute correctly.
  • Errors similar to the following are seen in the cron log:

    (root) CMDOUT (Failed to obtain current webserver certificate ID.)

  • Executing the create-backup.sh from the vCD command line shell as root completes successfully.

Environment

VMware Cloud Director 10.5.x

Cause

In VMware Cloud Director 10.5.x, the create-backup.sh script does not contain the appropriate paths for the item to successfully be executed directly using cron.

Resolution

In order to call the create-backup.sh using cron, the PATH environmental variable can be configured in the crontab using the following steps:

  1. Initiate an SSH or console session using the root credentials and collect the current PATH environmental variable using the following command:

    env | grep PATH

    There may be multiple values returned. The appropriate line item will start with the value: PATH=

  2. Configure the crontab with the PATH value retrieved using one of the following options:

    (Option 1): Add the PATH environmental variable to the top of the crontab file, as in the following example:



    Please note, all commands configured in the file will utilize this PATH variable with this configuration.

    (Option 2): Add the PATH environmental variable before the create-back.sh command, as in the following: