Description of problem:
Under normal operation, Candlepin automatically creates /var/cache/candlepin/sync if it's missing. However, if the entire /var/cache/candlepin/ directory is removed (e.g., due to cleanup scripts or admin action), Candlepin fails to recreate it — causing manifest refresh and async operations to fail with a JobExecutionException.
Steps to Reproduce:
1. Remove the Candlepin cache directory:
- rm -rf /var/cache/candlepin/
2. Attempt to refresh a manifest again.
Actual result:
Manifest refresh fails with:
org.candlepin.async.JobExecutionException: Unable to create base dir for sync: /var/cache/candlepin/sync
Expected Result:
Candlepin should detect the missing directory and recreate /var/cache/candlepin/ and /var/cache/candlepin/sync with proper permissions automatically.
Business Impact / Additional info:
Breaks critical workflows (e.g., manifest refresh) when /var/cache/candlepin/ is missing.
Relies on a directory that may be deleted or cleaned up, and is not usually monitored or backed up.