Recover an Interrupted Certificate Operation#
Use this guide to finish an interrupted certificate installation or restore the certificates used before it started. For routine maintenance, use Replace Deployment Certificates.
Prerequisites#
The operation ID reported by the failed certificate command.
Terminal access to the deployment directory as the user who owns its files.
The Dioptra container images used by the deployment.
Docker with Docker Compose.
Python 3.11 or newer.
Recovery#
Step 1: Find the Operation ID#
Find the operation ID in the terminal output or saved log from the interrupted initialization or certificate replacement command. In your terminal, run the following command to save the ID in a shell variable:
operation_id='OPERATION_ID'
Replace OPERATION_ID with the reported operation ID.
This command produces no output.
Use the same terminal session for the recovery commands that follow.
Step 2: Choose the Recovery Action#
Choose the recovery action:
Action |
Purpose |
|---|---|
|
Finish installing the certificates prepared by the interrupted operation. |
|
Restore the certificates and trust settings used before the operation started. |
To resume, keep the prepared certificate files and deployment configuration unchanged. To roll back, the saved previous certificates must still be valid. Rollback is unavailable during first-time initialization because there are no previous certificates to restore.
Step 3: Run the Selected Action#
For an interrupted init, stop normal deployment services before recovery:
docker compose stop
Recovery of init leaves normal services stopped.
For an interrupted replacement, keep backend services available so recovery can restart affected services and verify HTTPS.
If you selected resume, run:
python3 scripts/manage_ssl.py recover --operation "$operation_id" --action resume
If you selected rollback, run:
python3 scripts/manage_ssl.py recover --operation "$operation_id" --action rollback
Wait for the command to report success before continuing. If it reports a problem, save the error message and resolve the reported file or configuration problem before running the command again.
Step 4: Check the Recovered Certificates#
If the failed certificate operation occurred during init-deployment.sh, return to Step 4 of deployment preparation and rerun the initializer with the same options to finish setup.
It preserves recovered certificates, verifies HTTPS, registers the worker account, and tears services down.
After full initialization, or after recovery of a standalone manage_ssl.py init, start normal services:
docker compose up -d
Check the recovered certificates:
python3 scripts/manage_ssl.py validate
Confirm that validation succeeds with no unavailable checks.
Step 5: Update Certificate Trust (Optional)#
If recovery changed the CA certificate, follow the workstation or Python client instructions to verify its fingerprint and update trust.
Step 6: Verify Access#
Open the deployment’s HTTPS address in your browser and confirm that the frontend loads without certificate warnings. If you have an account, log in to check authenticated access. For external Python clients, repeat the client connection and login checks.
Update your protected backup with the recovered CA and server certificates, their private keys and the recovery files. See Certificate Backups for the files to retain.
See Also#
recover defines recovery options and failure behavior.
Certificate Policy Reference lists certificate requirements.