Re-enqueue a failed cleanup task and return the updated cleanup task state. When the task reports pending_decision, the request body must carry the answer: owned_objects_decision for kind owned_objects (the revoked account still owns objects on the target), account_decision for kind unproven_account (Principal cannot prove the ClickHouse account of the rule). A retry without the answer of an owned_objects request is rejected with 409 cleanup.decision_required. A retry without an answer to an unproven_account request checks the account again, for a user fixed on the target meanwhile. A failed target deletion can instead finish with remove_from_principal_only: the target leaves Principal and nothing more is sent to it. A decision sent for a task without a pending decision is rejected with 409 cleanup.decision_not_pending. While the task's job is still pending, queued or running (a failed attempt waiting for its automatic retry keeps its job pending), or when a concurrent retry already requeued the task, the retry is rejected with 409 cleanup.retry_already_scheduled and the scheduled attempt is left in place. details.next_retry_at and Retry-After tell when it runs, if known. The refusal names the cleanup job in details.job_id. Once Principal has read that job, it also names it like every launch that meets a running job: details.existing_job_id, details.started_at when that job was started, resources (relation running_operation) and resolution.code operation.view_running.
pending_decision.kind |
Body | Meaning |
|---|---|---|
owned_objects |
{"owned_objects_decision": "keep_data"} or "delete_data" |
Keep or drop objects owned by the revoked account |
unproven_account |
{"account_decision": "forget"} |
Forget an unproven ClickHouse account |
Missing decision returns 409 cleanup.decision_required. Retrying while running or scheduled returns 409 cleanup.retry_already_scheduled (with Retry-After if known).
Parameters
Cleanup Task ID (UUID)
Request body application/json · RetryCleanupTaskRequest
The body is optional.
Answer to a pending owned objects decision. keep_data reassigns the objects to the Principal service account before the role is dropped. delete_data drops the objects together with the role. Omit when the task has no pending decision.
keep_data delete_data Answer to a pending unproven_account request. forget stops Principal managing the account: the rule is deleted with Principal's records and stored credentials of the account, and nothing is sent to the target, so the user and its rights stay there. Omit when the task has no such request. Send it without owned_objects_decision.
forgetFinish a failed target deletion without touching the target again: Principal deletes the target and its rules, and everything the failed attempts did not revoke stays on the target. Only for a target cleanup task in cleanup_failed. Send it without owned_objects_decision and account_decision. Any other state is rejected with 409.
Responses
Accepted
CleanupTaskResponse · 22 fields
Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.
8 fields
Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.
ACCESS_PROFILE_STALE AMBIGUOUS_TARGET_OUTCOME APPLY_INTERRUPTED AUTHENTICATION_FAILED CLICKHOUSE_REPLICAS_OUT_OF_SYNC CLICKHOUSE_USER_NAME_RESERVED CONNECTION_FAILED CONNECTION_REFUSED CONNECTION_TIMEOUT CONNECTOR_CREDENTIALS_MISSING CONNECTOR_PAUSED CONNECTOR_SOURCE_CHANGED CONNECTOR_TYPE_UNAVAILABLE CONSTRAINT_VIOLATION CREDENTIAL_EXPIRED CREDENTIAL_NOT_FOUND DATABASE_NOT_FOUND DRIFT_BINDING_NOT_FOUND DRIFT_DEFAULT_INHERITED_SKIPPED DRIFT_NO_EXECUTABLE_DIFF DRIFT_PARTIAL_APPLY DRIFT_PLAN_GENERATION_FAILED DRIFT_RESOURCE_MISMATCH DRIFT_RULE_DELETING DRIFT_RUN_OUTDATED DRIFT_SCOPE_MISMATCH GROUP_EXPANSION_LIMIT_EXCEEDED HANDLER_NOT_FOUND K8S_CHANGE_REJECTED K8S_CLUSTER_UNREACHABLE K8S_NAMESPACE_FORBIDDEN K8S_NAMESPACE_NOT_FOUND K8S_RBAC_FORBIDDEN KUBERNETES_MEMBER_CREDENTIALS_PENDING KUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUED MARIADB_TRUNCATE_UNSUPPORTED MARIADB_USAGE_UNSUPPORTED MARIADB_GRANTS_AMBIGUOUS MUTATION_LOCKED MYSQL_MANAGEMENT_PRIVILEGES_MISSING 34 more values
NOT_FOUND OPERATION_BACKOFF OPERATION_CANCELLED OPERATION_TIMEOUT OWNED_OBJECTS_DECISION_REQUIRED PERMISSION_DENIED PLAN_APPLY_ARTIFACT_INVALID PLAN_APPLY_ORPHANED_LOCK PLAN_APPLY_ROLLBACK_BASELINE_INVALID PLAN_APPLY_RULE_CHANGED PLAN_APPLY_TARGET_STATE_CHANGED PLAN_APPLY_ACCESS_IMPACT_CHANGED POSTGRES_FUTURE_OBJECT_CREATORS_MISSING POSTGRES_GRANT_AUTHORITY_MISSING POSTGRES_MANAGEMENT_PRIVILEGES_MISSING POSTGRES_ROLE_ATTRIBUTE_UNSUPPORTED POSTGRES_ROLE_NAME_RESERVED POSTGRES_TLS_FILE_NOT_ALLOWED PROVIDER_REQUEST_FAILED RATE_LIMITED ROLE_EXISTS ROLE_NOT_FOUND ROTATION_CHECK_REQUIRED SECRET_STORE_UNAVAILABLE SERIALIZATION_ERROR TARGET_ACCOUNT_IDENTITY_MISMATCH TARGET_ACCOUNT_IDENTITY_UNVERIFIED TARGET_ACCOUNT_IMPORT_PENDING TARGET_ACCOUNT_PRINCIPAL_LOGIN TARGET_ACCOUNT_TAKEN TARGET_CONNECTION_MISSING TARGET_REPAIR_REQUIRED UNKNOWN_ERROR VALIDATION_FAILED Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.
Whether the failed attempt was eligible for an automatic retry under the actual queue policy.
Known operation phase at failure, when available.
Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.
The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.
State of the background job that runs this cleanup, present while the task has a job: whether a retry is queued, running or waiting, and when it runs next.
21 fields
Where a background operation is in the shared lifecycle (decision S1). outcome says how a finished operation ended and substate qualifies the state.
queuedrunningfinishedWhether the job has finished.
Final operation result, or null while the operation is active.
successfailurecancelledpartialQualifies the status and outcome of an operation where they alone would hide what the operator must know. Null when none applies.
rollback_in_progress rolled_back needs_repair outcome_unknown interruptedrequires_approval holds_lock awaiting_confirmation expiredtimed_out rescheduledSafe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.
8 fields
Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.
ACCESS_PROFILE_STALE AMBIGUOUS_TARGET_OUTCOME APPLY_INTERRUPTED AUTHENTICATION_FAILED CLICKHOUSE_REPLICAS_OUT_OF_SYNC CLICKHOUSE_USER_NAME_RESERVED CONNECTION_FAILED CONNECTION_REFUSED CONNECTION_TIMEOUT CONNECTOR_CREDENTIALS_MISSING CONNECTOR_PAUSED CONNECTOR_SOURCE_CHANGED CONNECTOR_TYPE_UNAVAILABLE CONSTRAINT_VIOLATION CREDENTIAL_EXPIRED CREDENTIAL_NOT_FOUND DATABASE_NOT_FOUND DRIFT_BINDING_NOT_FOUND DRIFT_DEFAULT_INHERITED_SKIPPED DRIFT_NO_EXECUTABLE_DIFF DRIFT_PARTIAL_APPLY DRIFT_PLAN_GENERATION_FAILED DRIFT_RESOURCE_MISMATCH DRIFT_RULE_DELETING DRIFT_RUN_OUTDATED DRIFT_SCOPE_MISMATCH GROUP_EXPANSION_LIMIT_EXCEEDED HANDLER_NOT_FOUND K8S_CHANGE_REJECTED K8S_CLUSTER_UNREACHABLE K8S_NAMESPACE_FORBIDDEN K8S_NAMESPACE_NOT_FOUND K8S_RBAC_FORBIDDEN KUBERNETES_MEMBER_CREDENTIALS_PENDING KUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUED MARIADB_TRUNCATE_UNSUPPORTED MARIADB_USAGE_UNSUPPORTED MARIADB_GRANTS_AMBIGUOUS MUTATION_LOCKED MYSQL_MANAGEMENT_PRIVILEGES_MISSING 34 more values
NOT_FOUND OPERATION_BACKOFF OPERATION_CANCELLED OPERATION_TIMEOUT OWNED_OBJECTS_DECISION_REQUIRED PERMISSION_DENIED PLAN_APPLY_ARTIFACT_INVALID PLAN_APPLY_ORPHANED_LOCK PLAN_APPLY_ROLLBACK_BASELINE_INVALID PLAN_APPLY_RULE_CHANGED PLAN_APPLY_TARGET_STATE_CHANGED PLAN_APPLY_ACCESS_IMPACT_CHANGED POSTGRES_FUTURE_OBJECT_CREATORS_MISSING POSTGRES_GRANT_AUTHORITY_MISSING POSTGRES_MANAGEMENT_PRIVILEGES_MISSING POSTGRES_ROLE_ATTRIBUTE_UNSUPPORTED POSTGRES_ROLE_NAME_RESERVED POSTGRES_TLS_FILE_NOT_ALLOWED PROVIDER_REQUEST_FAILED RATE_LIMITED ROLE_EXISTS ROLE_NOT_FOUND ROTATION_CHECK_REQUIRED SECRET_STORE_UNAVAILABLE SERIALIZATION_ERROR TARGET_ACCOUNT_IDENTITY_MISMATCH TARGET_ACCOUNT_IDENTITY_UNVERIFIED TARGET_ACCOUNT_IMPORT_PENDING TARGET_ACCOUNT_PRINCIPAL_LOGIN TARGET_ACCOUNT_TAKEN TARGET_CONNECTION_MISSING TARGET_REPAIR_REQUIRED UNKNOWN_ERROR VALIDATION_FAILED Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.
Whether the failed attempt was eligible for an automatic retry under the actual queue policy.
Known operation phase at failure, when available.
Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.
The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.
The job, with the fields below under the same names as in GET /admin/jobs/{id}. Present only when the caller may read jobs (jobs:read). Without that right the job carries only its state above.
49 fields
Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.
Bulk action that this job runs. GET /bulk-operations/{id} reads it.
Items remediated. For kubernetes_credential_refresh, kubeconfigs re-issued for the target's current authentication mode.
For kubernetes_credential_refresh, kubeconfigs of another authentication mode removed because the identity has no access in the current mode.
Connector sync only. Accounts this sync added to the duplicates of the connector.
Connector sync only. Accounts the sync skipped as duplicates, the new ones included.
pendingqueuedrunningcompletedfailedcancelledtimeoutokerrorrescheduledsucceededpartially_succeeded rollback_in_progress rolled_back failed_needs_repair successpartial_success Shared Kubernetes roles the cleanup kept because another binding still uses them. After a target deletion they stay in the cluster and Principal no longer removes them.
Accounts a target deletion with revoke left on the target because Principal can't confirm it created or adopted them. The target is deleted. The accounts keep their access.
True when a failed target deletion ended with remove_from_principal_only. Principal deleted the target without revoking what the failed attempts left. That access stays on the target.
Operator decision about a job whose attempt a worker of the previous job protocol left running, recorded by the maintenance CLI registry (docs/maintenance-cutover.md). Returned to job administrators only.
ID of the target the job works on.
Raw error of the job, only for a caller who may manage jobs, as in GET /admin/jobs/{id}.
4 fields
A stage actually emitted by a discovery worker.
application_discovery_warning checking_staleness cleaned_stale cleaning_stale completeconnectconnectingdatabases_complete discovered_api_resources discovered_application_candidates discovered_cluster_role_bindings discovered_cluster_roles discovered_namespaces discovered_role_bindings discovered_roles discovered_tables discovering_api_resources discovering_application_candidates discovering_cluster_role_bindings discovering_cluster_roles discovering_complete discovering_databases discovering_namespaces discovering_role_bindings discovering_role_bindings_warning discovering_roles discovering_roles_warning discovering_schemas discovering_tables discovering_users finalizingpropagating_future_objects propagation_warning resources_complete resources_connecting resources_databases_complete resources_discovering_databases resources_discovering_tables resources_finalizing resources_scanned_database 6 more values
roles_complete scanned_database scanning_complete staleness_warning usersusers_complete Persisted worker progress. Even 100 does not imply that the job is terminal.
Safe static English presentation of the stage.
Steps of the job. Error_message only for a caller who may manage jobs.
9 fields
Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.
Final operation result, or null while the operation is active.
successfailurecancelledpartialpendingrunningcompletedfailedskippedWhether this operation has finished.
Final operation result, or null while the operation is active.
successfailurecancelledpartialQualifies the status and outcome of an operation where they alone would hide what the operator must know. Null when none applies.
rollback_in_progress rolled_back needs_repair outcome_unknown interruptedrequires_approval holds_lock awaiting_confirmation expiredtimed_out rescheduledThe removal was accepted, but its job was never queued (for example the database failed in between) and nothing has run for two minutes. A retry or another delete request queues it again.
Operator's recorded answer to the owned objects decision, if any.
keep_data delete_data Operator's recorded answer to an unproven account request, if any.
forgetSet while a cleanup task is stopped in cleanup_failed waiting for the operator. Principal never deletes data owned by a revoked account on its own.
3 fields
Decision kind: owned_objects (keep or delete the objects a revoked account owns) or unproven_account (forget a ClickHouse account Principal cannot prove).
owned_objects unproven_account 4 fields
Why Principal cannot prove the account (kind unproven_account).
True after a failed target deletion was told to finish with remove_from_principal_only.
Accounts the target deletion left on the target because Principal can't confirm it created them.
Only for a target cleanup task in cleanup_failed: the accounts Principal still manages on the target, created by Principal or adopted. They stay on the target when the deletion finishes with remove_from_principal_only. Absent when there are none.
4 fields
The account as the target names it, for example the PostgreSQL role or user@host on MariaDB, or the name of a Kubernetes object.
The kind of a Kubernetes object or account, for example RoleBinding or ServiceAccount. Absent on other engines.
The namespace of a namespaced Kubernetes object or account. Absent for a cluster-wide object and on other engines.
True when Principal created the account. False when it was adopted.
Where a background operation is in the shared lifecycle (decision S1). outcome says how a finished operation ended and substate qualifies the state.
queuedrunningfinishedConflict
Common errors: 400 401 403 404 413 429 503 504. They mean the same for every operation, see Errors.