OpenKeel: the sovereign French Cloud solution of the inherent group, with a European reach Discover inherent

Reverse-spec · Services

barbican — Errors

Errors — barbican — branch stable/2026.2

Branch stable/2026.2 @ de32745a7a4f — repository https://opendev.org/openstack/barbican — analysed on 2026-10-29

1. Error body and translation

1.1 Body shapes

Who answersBodyWhere
Barbican (any webob.exc.HTTPError, including every pecan.abort){"code": <int>, "title": "<HTTP reason>", "description": "<text>"}, Content-Type: application/jsonbarbican/api/hooks.py:30
keystonemiddleware (missing/invalid token){"error": {"code": 401, "title": "Unauthorized", "message": "The request you have made requires authentication."}} and WWW-Authenticate: Keystone uri="…"keystonemiddleware; observed in _rewrite/observed-errors-functional_stable-2026.2.md
context middleware (X-Identity-Status not Confirmed and anonymous access off, or no project in the token)401 webob pagebarbican/api/middleware/context.py:66, barbican/api/middleware/context.py:85
unauthenticated pipeline without X-Project-Id400 Missing X-Project-Idbarbican/api/middleware/context.py:99
Pecan routing (no handler / generic index){"code": 405, "title": "Method Not Allowed", "description": ""}, or 404barbican/api/controllers/secrets.py:375
oslo.middleware healthchecktext / JSON per Acceptetc/barbican/barbican-api-paste.ini:59

Clients read title and description: python-barbicanclient builds "<title>: <description>" from the body (python-barbicanclient:barbicanclient/client.py:138).

1.2 Translation of exceptions (handle_exceptions)

Each handler carries an operation name (Secret creation, Secret payload retrieval…; see operation_name in _rewrite/routes_stable-2026.2.json). handle_exceptions (barbican/api/controllers/__init__.py:100) and generate_safe_exception_message (barbican/api/__init__.py:77) translate:

RaisedStatusdescription
webob.exc.HTTPError (e.g. pecan.abort(404, '…'))its ownits own text, unchanged (barbican/api/controllers/__init__.py:108)
oslo_policy.PolicyNotAuthorized / InvalidScope403"<Operation> attempt not allowed - please review your user/project privileges" (barbican/api/__init__.py:98)
BarbicanHTTPException subclassits status_code"<Operation> issue seen - <client_message>." (barbican/api/__init__.py:105, barbican/api/__init__.py:112)
anything else (incl. BarbicanException, NotFound, plugin errors, DB errors)500"<Operation> failure seen - please contact site administrator." (barbican/api/__init__.py:108)

Two exceptions to this rule:

  • errors raised while validating the body go through load_body, which aborts with the exception's status and bare client_message, without the operation prefix and without the trailing dot (barbican/api/__init__.py:69): POST /v1/secrets with a too-large payload answers 413 "Provided information too large to process", while PUT /v1/secrets/{id} answers 413 "Secret update issue seen - Provided information too large to process." (both observed).
  • client_message values ending with a dot get a second one ("Secret update issue seen - No data supplied to process..", observed).

The full observed catalogue — 116 (operation, status, title, description) combinations from the functional run and 130 from the API unit tests — is in _rewrite/observed-errors-functional_stable-2026.2.md and _rewrite/observed-errors-api-tests_stable-2026.2.md.

2. Exceptions raised by the business code

2.1 barbican/common/exception.py

ExceptionHTTPclient_message / messageSituationRaised at
InvalidObject400Provided object does not match schema '{schema}': {reason}. Invalid property: '{property}'body fails a JSON schema or a business check of a validatorbarbican/common/validators.py:124, barbican/common/validators.py:135
UnsupportedField400Provided field value is not supportedorder bit_length not a multiple of 8 / invalid EC size; container secret_ref not on this hostbarbican/common/validators.py:545, barbican/common/validators.py:716
FeatureNotImplemented500 [no HTTP status: base BarbicanException]Feature not implemented for value set on field …order of an unknown type (certificate)barbican/common/validators.py:561
LimitExceeded413Provided information too large to processpayload over max_allowed_secret_in_bytesbarbican/common/validators.py:315, barbican/api/controllers/secrets.py:236
NoDataToProcess400No data supplied to process.empty body on PUT /v1/secrets/{id} or PUT /v1/project-quotas/{id}barbican/api/controllers/secrets.py:234, barbican/api/controllers/quotas.py:90
SecretHasConsumers400Secret cannot be deleted as it has consumers.microversion ≥ 1.2, consumers exist, no forcebarbican/api/controllers/secrets.py:275
QuotaReached403Creation not allowed because a quota has been reachedcount of the project's resources ≥ quota, or quota = 0barbican/common/quota.py:200
InvalidMetadataKey400Invalid Key. Key must be URL safe.metadata key with characters outside [A-Za-z0-9_-]barbican/common/validators.py:415
MissingMetadataField400Missing required metadata field for %(required)s(helper, unused by the current order types)barbican/common/validators.py:495
ProvidedTransportKeyNotFound400Provided Transport key %(transport_key_id)s could not be foundtransport_key_id given at store time does not existbarbican/plugin/resources.py:56
InvalidContainer400Invalid container: %(reason)sstored-key RSA container reference invalid (helper)barbican/common/validators.py:64
NotFound500 when it escapesAn object with the specified identifier was not found.repository get without suppress_exception; most handlers catch it and abort 404 themselvesbarbican/model/repositories.py:333
ConstraintCheck500 when it escapesA defined SQL constraint check failed: %(error)sduplicate key on insert (project creation race is caught)barbican/model/repositories.py:369
Invalid500—create_from with an entity that already has an idbarbican/model/repositories.py:349
MultipleStore* (5 classes)500 / start-up failuresee classinconsistent [secretstore:*] configuration (no or several global_default, missing plugin value, store still preferred by a project)barbican/plugin/util/multiple_backends.py:47, barbican/plugin/util/multiple_backends.py:100, barbican/plugin/util/multiple_backends.py:191
PKCS11Exception family500HSM returned response code: 0x… CKR_…, No token was found in slot %(slot_id)s, More than one key found for label, Could not find key labeled …HSM call failed; the plugin re-initialises the library once and retries (barbican/plugin/crypto/p11_crypto.py:217)barbican/plugin/crypto/pkcs11.py:923, barbican/plugin/crypto/p11_crypto.py:399

The certificate-authority exceptions (InvalidCAID, SubCA*, CannotDeletePreferredCA… barbican/common/exception.py:247–barbican/common/exception.py:322) and the CMC/PKCS#10 ones (barbican/common/exception.py:100–barbican/common/exception.py:143) have no raise site left in the API: they belong to the removed certificate feature.

2.2 Secret-store plugin layer (barbican/plugin/interface/secret_store.py)

ExceptionHTTPclient_messageSituationRaised at
SecretStorePluginNotFound400No plugin was found that could support your requesta transport key refers to a plugin that is not loadedbarbican/plugin/interface/secret_store.py:590
SecretStoreSupportedPluginNotFound400Secret store supported plugin not found.no store accepts the key spec (or none offers a transport key)barbican/plugin/interface/secret_store.py:603
SecretGenerateSupportedPluginNotFound400Secret generate supported plugin not found.no store can generate the requested algorithm/size (order)barbican/plugin/interface/secret_store.py:641
SecretContentTypeNotSupportedException400content-type of '…' not supportednormalised content type unsupportedbarbican/plugin/util/translations.py:79, barbican/plugin/util/translations.py:117
SecretContentEncodingMustBeBase64400Text-based binary secret payloads must specify a content-encoding of 'base64'binary type with another encoding on POSTbarbican/plugin/util/translations.py:65
SecretAcceptNotSupportedException406Wrong payload content-typeAccept not supported, or text/plain requested for non-UTF-8 bytesbarbican/plugin/util/translations.py:86, barbican/plugin/util/translations.py:103
SecretNotFoundException404Secret not found.store_crypto asked for a secret without encrypted_databarbican/plugin/store_crypto.py:116
SecretAlgorithmNotSupportedException400Requested algorithm is not supportedalgorithm unknown to store_crypto/KMIP/castellanbarbican/plugin/store_crypto.py:162, barbican/plugin/store_crypto.py:274
GeneratePassphraseNotSupportedException400passphrase not supportedasymmetric order with passphrase on a castellan storebarbican/plugin/castellan_secret_store.py:183
StorePluginNotAvailableOrMisconfigured500—the plugin_name stored with a secret is not loaded any more (configuration changed)barbican/plugin/interface/secret_store.py:624
SecretStorePluginsNotConfigured500—no secret-store plugin loadedbarbican/plugin/interface/secret_store.py:549
SecretGeneralException500—back-end failure (KMIP, Vault, castellan)barbican/plugin/castellan_secret_store.py:129, barbican/plugin/kmip_secret_store.py:401
SecretNoPayloadProvidedException500—empty payload reached normalisation (should be prevented by validation)barbican/plugin/util/translations.py:43

2.3 Crypto plugin layer (barbican/plugin/crypto/base.py)

ExceptionSituationRaised at
CryptoPluginNotFound → 500 Crypto plugin not found.no crypto plugin instantiated (e.g. simple_crypto without [simple_crypto_plugin] kek: the constructor raises ValueError("SimpleCrypto KEK is undefined"), logged, plugin skipped)barbican/plugin/crypto/manager.py:93, barbican/plugin/crypto/simple_crypto.py:60
CryptoPluginUnsupportedOperation → 500no plugin supports the type/algorithm/size, or the plugin that encrypted a secret (kek_data.plugin_name) is not loadedbarbican/plugin/crypto/manager.py:107, barbican/plugin/crypto/manager.py:130
CryptoKEKBindingException → 500bind_kek_metadata returned Nonebarbican/plugin/store_crypto.py:295
CryptoPrivateKeyFailureException → 500asymmetric generation with an algorithm other than RSA/DSAbarbican/plugin/crypto/simple_crypto.py:156
cryptography.fernet.InvalidToken → 500wrong master KEK, wrong project KEK, tampered ciphertext (simple_crypto)barbican/plugin/crypto/simple_crypto.py:79, barbican/plugin/crypto/simple_crypto.py:102
NotImplementedError → 500asymmetric generation on PKCS#11barbican/plugin/crypto/p11_crypto.py:198

3. pecan.abort sites (controller-level errors)

StatusDescriptionWhere
404Secret not found. / Not Found. Provided secret id is invalid.barbican/api/controllers/secrets.py:43, barbican/api/controllers/secrets.py:48
404Not Found. Sorry but your secret has no payload.barbican/api/controllers/secrets.py:53
409Secret already has data, cannot modify it.barbican/api/controllers/secrets.py:58
400URI provided invalid query string parameters. (date filters, sort, force)barbican/api/controllers/secrets.py:62
400Transport key wrapped session key has been provided to wrap secrets for retrieval, but the transport key id has not been provided.barbican/api/controllers/secrets.py:71
415Content-Type of '<type>' is not supported for PUT. / Unexpected content type. Expected content types are: [...]barbican/api/controllers/secrets.py:224, barbican/api/controllers/__init__.py:145
405(empty) — wrong method; /payload with non-GET; metadata item with POSTbarbican/api/controllers/secrets.py:111, barbican/api/controllers/secrets.py:205, barbican/api/controllers/secrets.py:104
404unknown sub-resource of a secret (/v1/secrets/{id}/xyz)barbican/api/controllers/secrets.py:107
404Secrets container not found. / Not Found. Provided container id is invalid.barbican/api/controllers/containers.py:36, barbican/api/controllers/containers.py:41
404Secret provided for '<name>' doesn't exist. / Secret provided doesn't exist. / Secret provided is not in the containerbarbican/api/controllers/containers.py:206, barbican/api/controllers/containers.py:260, barbican/api/controllers/containers.py:318
400Only 'generic' containers can be modified.barbican/api/controllers/containers.py:247
409Conflict. A secret with that name and ID is already stored in this container. …barbican/api/controllers/containers.py:268
404Order not found.; 405 Order update is not supported.barbican/api/controllers/orders.py:32, barbican/api/controllers/orders.py:42
404Consumer not found. / Not Found. Provided consumer id is invalid.barbican/api/controllers/consumers.py:33, barbican/api/controllers/consumers.py:44
403Not Allowed. Sorry, only the creator of a consumer can delete it.barbican/api/controllers/consumers.py:38
404Secret metadata not found.; 409 Conflict. Key in request is already in the secret metadata; 409 Key in request data does not match key in the request url.barbican/api/controllers/secretmeta.py:28, barbican/api/controllers/secretmeta.py:95, barbican/api/controllers/secretmeta.py:158
404Project quotas not found.barbican/api/controllers/quotas.py:32
404Not Found. Secret store not found. / … No preferred secret store defined for this project. / … Multiple backends support is not enabled in service configuration.barbican/api/controllers/secretstores.py:30, barbican/api/controllers/secretstores.py:35, barbican/api/controllers/secretstores.py:41
404Not Found. Transport Key not found. / … Provided transport key id is invalid.barbican/api/controllers/transportkeys.py:33, barbican/api/controllers/transportkeys.py:38
400 / 500Malformed JSON / Read Errorbarbican/api/__init__.py:65, barbican/api/__init__.py:55
404The version you requested wasn't foundbarbican/api/controllers/versions.py:77

Note the message Order update is not supported. exists but PUT /v1/orders/{id} does not reach it: OrderController has no PUT handler, so Pecan answers a bare 405 (observed PUT /v1/orders/<id> → 401/405).

4. Errors outside the API

WhereSituationWhat happensSeen by
order task (BeginTypeOrder)generation fails (plugin not found, HSM error, unsupported algorithm…)order set to ERROR with error_status_code and error_reason built like an API message ("Process TypeOrder issue seen - …" or "… failure seen - please contact site administrator."), exception suppressed so the status is committed (barbican/tasks/resources.py:102, barbican/tasks/resources.py:189, barbican/tasks/resources.py:45)GET /v1/orders/{id}; castellan raises KeyManagerError("Order is in ERROR status - status code: …, status reason: …") (castellan:castellan/key_manager/barbican_key_manager.py:526)
order task without a workerany exceptionlogged >>>>> Task exception seen for synchronous task invocation… and swallowed (barbican/queue/client.py:79)order stays PENDING if the failure happened before handle_error
worker transactional wrapperunexpected exceptionLOG.exception("Problem seen processing worker task: …"), rollback (barbican/queue/server.py:96)order stays PENDING
retry schedulerenqueue failsProblem enqueuing method …, rollback, task kept for the next cycle (barbican/queue/retry_scheduler.py:155)logs
Keystone listenercleanup failsrollback; REQUEUE if [keystone_notifications] allow_requeue, else HANDLED (message dropped) (barbican/queue/keystone_listener.py:100); the handle_error log itself fails with AttributeError on project.project_id (barbican/tasks/keystone_consumer.py:79)logs
PKCS#11token removed / library errorLOG.warning("Reinitializing PKCS#11 library: …"), one retry (barbican/plugin/crypto/p11_crypto.py:218)500 if the retry fails
API startDB unreachable, secret-store sync failsLOG.exception('Failed to sync secret_stores table.'), the app does not start (barbican/api/app.py:90)deployment
keystone-listener start[keystone_notifications] enable = Falselogs Exiting as Barbican Keystone listener is not enabled... and exits 0 (barbican/cmd/keystone_listener.py:59)deployment

Source: reverse-spec-barbican/02-errors_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.