Repository navigation
Canton Data App 4.2.12
This release prevents Helm charts rendered by Argo CD or helm template from generating replacement keys and documents recovery without deleting the database. The backend recovery message now points to the public recovery guides. The frontend and database have no functional changes.
Use the complete 4.2.12 Compose bundle or Helm chart and its pinned images. Back up the database and its encryption keys before upgrading. Argo CD installations must complete the migration below before syncing the new chart. For Helm, use your values file; do not use --reuse-values.
What changes
- Offline renders no longer generate keys.
helm template, client-side dry runs and Argo CD render the chart without reading the cluster. Earlier charts generated three new random keys in every such render. The chart now stops withRefusing to generate secretsbefore it produces any manifest, and lists the settings that are still empty amongaccounting.tokenEncryption.existingSecret,installation.kek.existingSecretandinstallation.canary.existingSecret. - A newly generated accounting key Secret is immutable. Kubernetes rejects any apply that would replace
ACCOUNTING_TOKEN_ENCRYPTION_KEYin it. An existing accounting Secret is left as it is: an upgrade keeps its key byte for byte and does not add the immutable flag to a Secret that an earlier chart generated without it. A Secret that already is immutable stays immutable. - An ordinary upgrade does not block rollback, but rollback across an accounting key change is not safe. An installation upgraded from an earlier chart keeps its mutable accounting Secret, so
helm rollbackto the earlier revision does not fail on the immutable-field error, as long as the accounting key is the same in both revisions. Every Helm revision that rendered the generated Secret stores the key bytes of that time: a rollback to a revision with another key can succeed and still overwrite a key you restored or replaced by hand, and it fails against an immutable Secret. After restoring or replacing the key, run the installation's normalhelm upgradeso that the newest revision records it; older revisions with another key remain unsafe, and you must not roll back to them. - A downgrade below this chart can fail against any newly generated accounting Secret. Such a Secret is immutable, whether a new installation created it or an upgrade generated it after the earlier Secret was lost. An earlier chart version's manifest for this Secret omits the immutable flag, and Kubernetes rejects an update that removes the flag. A new installation has no earlier revision, so there this concerns only a deliberate downgrade. An upgrade that regenerates the Secret does have earlier revisions, and regenerating a Secret also changes the key: those revisions can contain a different key, and removing the immutable flag does not make a rollback to them safe. This compatibility note concerns only a chart downgrade that keeps the current key. That downgrade can proceed only after you explicitly recreate the Secret without the flag and with the same key. Changing the key does not help: the rejected change is the flag, and a different key cannot decrypt the stored accounting provider credentials.
- An accounting Secret without its key fails the render. The chart names the Secret and the key instead of writing a new key into it.
- A lost KEK has a documented fallback. When the original KEK cannot be recovered at all, the backend log now links to Installation credential secrets, which points to the recovery procedures for Helm and Docker Compose. With Helm it deletes the failed backend Deployment and lets Helm or Argo CD create it again, so that later upgrades accept the replacement KEK; scaling the Deployment down and up is not enough. Docker Compose has the same procedure.
helm install and helm upgrade against a cluster work as before: they read the cluster, reuse the Secrets they find, and generate the three Secrets on a new installation, also with --create-namespace into a namespace that does not exist yet. Docker Compose installations are not affected by the chart changes.
Before you upgrade with Helm
- Helm must be able to list Secrets in the release namespace. The chart tells a render that reads the cluster from an offline one by listing the namespace's Secrets. Without that permission the command stops with Helm's own lookup error.
- Replace plain
helm templatechecks. Usehelm template --dry-run=serverorhelm upgrade --dry-run=server, which read the cluster. A--dry-runwithout=serverrenders offline and stops likehelm template.helm lintstill passes and prints the refusal as a note. - Restoring or rotating the accounting key means deleting and recreating its Secret and restarting the backend. The documented procedure keeps the mutability the Secret had: an immutable Secret is recreated immutable, and a mutable one stays mutable. It requires the key name configured in
accounting.tokenEncryption.keyinACCOUNTING_KEY_NAME(chart defaultaccounting-token-encryption-key) and a Secret that holds only that key; otherwise it stops before deleting anything. If it is interrupted after it starts the delete, it keeps the prepared replacement manifest in a private directory and prints the path. Afterwards, record the key with your normalhelm upgrade; do not roll back to a revision from before the change. A new key cannot decrypt stored accounting provider credentials, and Disconnect may fail as well; contact Noves support to reset the integrations so that they can be connected again. See Restore or rotate the accounting key.
Argo CD and helm template: required migration
An installation synced by Argo CD, or applied from helm template output, must manage all three Secrets itself before it moves to this chart. Follow the steps in this order. Do not change the values first.
Set the variables the commands use. Do not note or copy anything from the running installation yet; step 1 comes first:
export KUBE_CONTEXT=
export NAMESPACE=
export FULLNAME=noves-canton-data-app # the release name, or fullnameOverride when set
export ARGOCD_APP= # the Argo CD Application that syncs this release
export SOURCE_ACCOUNTING_SECRET="$FULLNAME-accounting-token-encryption"
export SOURCE_KEK_SECRET="$FULLNAME-installation-kek"
export SOURCE_CANARY_SECRET="$FULLNAME-installation-canary"The three SOURCE_ variables name the Secrets the installation uses now. The chart shortens generated names when the full name is long, so compare them with the output of kubectl get secret -l app.kubernetes.io/instance=<release> and set the exact names it lists.
-
Pause automatic sync before you note or copy anything. While the earlier chart is still the sync target, an automatic sync or self-heal can write a new accounting key and a new canary into the generated Secrets and restart the backend. If that happens after you copy the values in step 3 and before the sync in step 6, the copies no longer match what the backend used in between, and accounting provider credentials stored in that time cannot be decrypted with the copied key. First look at the current policy, because step 9 restores exactly that:
argocd app get "${ARGOCD_APP:?set the Argo CD Application name}" -o yamlNote whether
spec.syncPolicy.automatedis present, and theprune,selfHeal,allowEmptyandenabledvalues it sets. If it is absent, or hasenabled: false, sync is already manual and there is nothing to pause. Otherwise pause it:argocd app set "${ARGOCD_APP:?set the Argo CD Application name}" --sync-policy none
If the Application is defined declaratively (in Git, by a parent app-of-apps Application, by an ApplicationSet template or by another tool), pause it there instead, by removing
spec.syncPolicy.automatedfrom that definition, and wait until the change has reached the Application. A change made only with the CLI is reverted by whatever owns the definition, which turns automatic sync back on in the middle of the migration. Run theargocd app getcommand again and continue only whenspec.syncPolicyshows noautomatedblock, or one withenabled: false.An automatic sync that was already running when you paused is not stopped by the pause, and a sync that failed (with an earlier chart, often on the immutable-field error listed below) may still be retrying. Before you note the installation identity or copy any live value, let that operation finish or terminate it, and confirm in Argo CD that the Application has no operation still running or retrying. The earlier chart's sync does not have to succeed; it only has to be over.
Leave automatic sync paused through step 8, and do not start a sync of the earlier chart by hand. If you apply
helm templateoutput yourself instead, do not apply output of the earlier chart during these steps. -
Only now note the installation identity. Open the Backend Status page and note the installation ID and status in the Installation Identity section.
-
Copy the live values into new Secrets whose names differ from the generated ones. The copies go through private files that are removed afterwards, and the command confirms each copy without printing a value:
( set -eu : "${KUBE_CONTEXT:?set the exact context}" "${NAMESPACE:?set the exact namespace}" : "${SOURCE_ACCOUNTING_SECRET:?set the current accounting key Secret name}" : "${SOURCE_KEK_SECRET:?set the current KEK Secret name}" : "${SOURCE_CANARY_SECRET:?set the current canary Secret name}" umask 077 secret_dir="$(mktemp -d)" trap 'rm -rf "$secret_dir"' EXIT secret_data() { kubectl --context "$KUBE_CONTEXT" --namespace "$NAMESPACE" \ get secret "$1" -o "jsonpath={.data.$2}" } copy_secret() { secret_data "$1" "$2" | base64 -d > "$secret_dir/$2" test "$(wc -c < "$secret_dir/$2" | tr -d ' ')" = 44 kubectl --context "$KUBE_CONTEXT" --namespace "$NAMESPACE" \ create secret generic "$3" --from-file="$2=$secret_dir/$2" test "$(secret_data "$1" "$2")" = "$(secret_data "$3" "$2")" } copy_secret "$SOURCE_ACCOUNTING_SECRET" accounting-token-encryption-key \ noves-canton-data-app-operator-accounting-key copy_secret "$SOURCE_KEK_SECRET" installation-kek \ noves-canton-data-app-operator-kek copy_secret "$SOURCE_CANARY_SECRET" installation-canary-capability \ noves-canton-data-app-operator-canary echo "Copied all three values." )
The block stops at the first failure and prints
Copied all three values.only when every copy matches its source. -
Keep Argo CD from pruning the old Secrets during the next sync, so that they stay until you have verified the result. Helm's
helm.sh/resource-policy: keepannotation does not stop Argo CD from pruning:kubectl --context "${KUBE_CONTEXT:?set the exact context}" \ --namespace "${NAMESPACE:?set the exact namespace}" \ annotate secret \ "${SOURCE_ACCOUNTING_SECRET:?set the current accounting key Secret name}" \ "${SOURCE_KEK_SECRET:?set the current KEK Secret name}" \ "${SOURCE_CANARY_SECRET:?set the current canary Secret name}" \ argocd.argoproj.io/sync-options=Prune=false
Argo CD reports the Application as out of sync while Secrets it would prune remain.
-
Set all three
existingSecretvalues, together with the new chart version:accounting: tokenEncryption: existingSecret: noves-canton-data-app-operator-accounting-key key: accounting-token-encryption-key installation: kek: existingSecret: noves-canton-data-app-operator-kek key: installation-kek canary: existingSecret: noves-canton-data-app-operator-canary key: installation-canary-capability
installation.kek.existingSecretandinstallation.canary.existingSecretmust not name<fullname>-installation-kekor<fullname>-installation-canary: the chart reserves the names it generates. Use distinct names for all three. -
Sync the Application by hand, for example with
argocd app sync "$ARGOCD_APP". Automatic sync stays paused. The backend and frontend restart once to mount the new Secrets. With these values the render contains no random data, so later syncs show no difference and restart nothing. -
Verify before removing anything. The backend becomes ready, and the Installation Identity section of the Backend Status page shows the same installation ID and status you noted in step 2:
kubectl --context "${KUBE_CONTEXT:?set the exact context}" \ --namespace "${NAMESPACE:?set the exact namespace}" \ rollout status "deployment/${FULLNAME:?set the release full name}-backend" --timeout=20m
Then check each accounting provider integration, as described below.
-
Only then remove the old generated Secrets. Make sure the accounting key and the KEK are in your backup first:
kubectl --context "${KUBE_CONTEXT:?set the exact context}" \ --namespace "${NAMESPACE:?set the exact namespace}" \ delete secret \ "${SOURCE_ACCOUNTING_SECRET:?set the current accounting key Secret name}" \ "${SOURCE_KEK_SECRET:?set the current KEK Secret name}" \ "${SOURCE_CANARY_SECRET:?set the current canary Secret name}"
-
Restore the sync policy you noted in step 1, and only now that step 7 has passed and step 8 is done. If sync was manual before, leave it manual. Otherwise:
argocd app set "${ARGOCD_APP:?set the Argo CD Application name}" --sync-policy automated
Add
--auto-prune,--self-healand--allow-emptyto that command only for the options that were on in step 1. Do not enable an option that was off before. For a declaratively defined Application, put thespec.syncPolicy.automatedblock back into its definition exactly as it was.
The accounting key may already have been replaced. With earlier chart versions the generated accounting Secret was not immutable, so every Argo CD sync could write a new random key into it while Kubernetes rejected the new KEK in the same sync. The value you copy in step 3 is then the latest key, not the one your stored provider credentials were encrypted with, and the earlier key cannot be read back from the live Secret. If you have a backup of the earlier key, use it as the value of the new accounting Secret; see Restore or rotate the accounting key. After the migration, open each accounting provider integration (QuickBooks, Xero) and confirm that it still refreshes and exports. If one fails and no backup of its key exists, contact Noves support to reset that integration so that it can be connected again; Disconnect may fail as well, because it reads the stored credentials first.
A new Argo CD installation creates the namespace and the three Secrets before the first sync, each from openssl rand -base64 32 | tr -d '\n' written to a private file. See New installation.
Errors you may see
| Error | Meaning | Action |
|---|---|---|
Secret "<fullname>-installation-kek" is invalid: data: Forbidden: field is immutable when `immutable` is set, reported by the Kubernetes API during a sync |
An offline render of an earlier chart tried to replace the KEK, and Kubernetes refused. The live KEK is intact and protected. | Do not delete the Secret to make the sync pass. Follow the migration above. |
Refusing to generate secrets, reported while rendering, in Argo CD as a manifest generation error |
This chart stopped an offline render that would have generated new keys. The render produced no manifest, so nothing was applied and the running installation is unchanged. | Create the Secrets the message lists and set the values. |
The complete reference is Argo CD and helm template.