deckhand.errors module¶
-
exception
deckhand.errors.
BarbicanClientException
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
A client-side 4xx error occurred with Barbican.
Troubleshoot:
- Ensure that Deckhand can authenticate against Keystone.
- Ensure that Deckhand’s Barbican configuration options are correct.
- Ensure that Deckhand and Barbican are contained in the Keystone service catalog.
-
code
= 400¶
-
msg_fmt
= 'Barbican raised a client error. Details: %(details)s'¶
-
exception
deckhand.errors.
BarbicanServerException
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
A server-side 5xx error occurred with Barbican.
-
code
= 500¶
-
msg_fmt
= 'Barbican raised a server error. Details: %(details)s'¶
-
-
exception
deckhand.errors.
DeckhandException
(message=None, code=500, **kwargs)[source]¶ Bases:
Exception
Base Deckhand Exception To correctly use this class, inherit from it and define a ‘msg_fmt’ property. That msg_fmt will get printf’d with the keyword arguments provided to the constructor.
-
msg_fmt
= 'An unknown exception occurred'¶
-
-
exception
deckhand.errors.
DeepDiffException
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
An Exception occurred while deep diffing
-
code
= 500¶
-
msg_fmt
= 'An Exception occurred while deep diffing. Details: %(details)s'¶
-
-
exception
deckhand.errors.
DocumentNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The requested document could not be found.
Troubleshoot:
-
code
= 404¶
-
msg_fmt
= 'The requested document using filters: %(filters)s was not found'¶
-
-
exception
deckhand.errors.
DuplicateDocumentExists
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
A document attempted to be put into a bucket where another document with the same schema and metadata.name already exist.
Troubleshoot:
-
code
= 409¶
-
msg_fmt
= 'Document [%(schema)s, %(layer)s] %(name)s already exists in bucket: %(bucket)s'¶
-
-
exception
deckhand.errors.
EncryptionSourceNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Required encryption source reference was not found.
Troubleshoot:
- Ensure that the secret reference exists among the encryption sources.
-
code
= 400¶
-
msg_fmt
= 'Required encryption source reference could not be resolved into a secret because it was not found among encryption sources. Ref: %(secret_ref)s. Referenced by: [%(schema)s, %(layer)s] %(name)s'¶
-
exception
deckhand.errors.
IndeterminateDocumentParent
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
More than one parent document was found for a document.
Troubleshoot:
-
code
= 400¶
-
msg_fmt
= 'Too many parent documents found for document [%(schema)s, %(layer)s] %(name)s. Found: %(found)s. Expected: 1'¶
-
-
exception
deckhand.errors.
InvalidDocumentFormat
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Schema validations failed for the provided document(s).
Troubleshoot:
-
code
= 400¶
-
msg_fmt
= 'The provided documents failed schema validation'¶
-
-
exception
deckhand.errors.
InvalidDocumentLayer
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The document layer is invalid.
Troubleshoot:
- Check that the document layer is contained in the layerOrder in the registered LayeringPolicy in the system.
-
code
= 400¶
-
msg_fmt
= "Invalid layer '%(document_layer)s' for document [%(document_schema)s] %(document_name)s was not found in layerOrder: %(layer_order)s for provided LayeringPolicy: %(layering_policy_name)s"¶
-
exception
deckhand.errors.
InvalidDocumentParent
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The document parent is invalid.
Troubleshoot:
- Check that the document schema and parent schema match.
- Check that the document layer is lower-order than the parent layer.
-
code
= 400¶
-
msg_fmt
= 'The document parent [%(parent_schema)s] %(parent_name)s is invalid for document [%(document_schema)s] %(document_name)s. Reason: %(reason)s'¶
-
exception
deckhand.errors.
InvalidDocumentReplacement
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The document replacement is invalid.
Troubleshoot:
- Check that the replacement document has the same
schema
andmetadata.name
as the document it replaces. - Check that the document with
replacement: true
has a parent. - Check that the document replacement isn’t being replaced by another document. Only one level of replacement is permitted.
-
code
= 400¶
-
msg_fmt
= 'Replacement document [%(schema)s, %(layer)s] %(name)s is invalid. Reason: %(reason)s'¶
- Check that the replacement document has the same
-
exception
deckhand.errors.
InvalidInputException
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
An Invalid Input provided due to which unable to process request.
-
code
= 400¶
-
msg_fmt
= 'Failed to process request due to invalid input: %(input_var)s'¶
-
-
exception
deckhand.errors.
LayeringPolicyNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Required LayeringPolicy was not found for layering.
Troubleshoot:
-
code
= 409¶
-
msg_fmt
= 'Required LayeringPolicy was not found for layering'¶
-
-
exception
deckhand.errors.
MissingDocumentKey
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Either the parent or child document data is missing the action path used for layering.
Troubleshoot:
- Check that the action path exists in the data section for both child and parent documents being layered together.
- Note that previous delete layering actions can affect future layering actions by removing a path needed by a future layering action.
- Note that substitutions that substitute in lists or objects into the rendered data for a document can also complicate debugging this issue.
-
code
= 400¶
-
msg_fmt
= 'Missing action path in %(action)s needed for layering from either the data section of the parent [%(parent_schema)s, %(parent_layer)s] %(parent_name)s or child [%(child_schema)s, %(child_layer)s] %(child_name)s document'¶
-
exception
deckhand.errors.
MissingDocumentPattern
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
‘Pattern’ is not None and data[jsonpath] doesn’t exist.
Troubleshoot:
- Check that the destination document’s data section contains the pattern specified under substitutions.dest.pattern in its data section at substitutions.dest.path.
-
code
= 400¶
-
msg_fmt
= "The destination document's `data` section is missing the pattern %(pattern)s specified under `substitutions.dest.pattern` at path %(jsonpath)s, specified under `substitutions.dest.path`"¶
-
exception
deckhand.errors.
PolicyNotAuthorized
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The policy action is not found in the list of registered rules.
Troubleshoot:
-
code
= 403¶
-
msg_fmt
= "Policy doesn't allow %(action)s to be performed"¶
-
-
exception
deckhand.errors.
RevisionNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The revision cannot be found or doesn’t exist.
Troubleshoot:
-
code
= 404¶
-
msg_fmt
= 'The requested revision=%(revision_id)s was not found'¶
-
-
exception
deckhand.errors.
RevisionTagBadFormat
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The tag data is neither None nor dictionary.
Troubleshoot:
-
code
= 400¶
-
msg_fmt
= 'The requested tag data %(data)s must either be null or dictionary'¶
-
-
exception
deckhand.errors.
RevisionTagNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The tag for the revision id was not found.
Troubleshoot:
-
code
= 404¶
-
msg_fmt
= "The requested tag '%(tag)s' for revision %(revision)s was not found"¶
-
-
exception
deckhand.errors.
SingletonDocumentConflict
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
A singleton document already exist within the system.
Troubleshoot:
-
code
= 409¶
-
msg_fmt
= 'A singleton document [%(schema)s, %(layer)s] %(name)s already exists in the system. The new document(s) %(conflict)s cannot be created. To create a document with a new name, delete the current one first'¶
-
-
exception
deckhand.errors.
SubstitutionDependencyCycle
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
An illegal substitution depdencency cycle was detected.
Troubleshoot:
- Check that there is no two-way substitution dependency between documents.
-
code
= 400¶
-
msg_fmt
= 'Cannot determine substitution order as a dependency cycle exists for the following documents: %(cycle)s'¶
-
exception
deckhand.errors.
SubstitutionSourceDataNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Required substitution source secret was not found in the substitution source document at the path
metadata.substitutions.[*].src.path
in the destination document.Troubleshoot:
- Ensure that the missing source secret exists at the
src.path
specified under the given substitution in the destination document and that thesrc.path
itself exists in the source document.
-
code
= 400¶
-
msg_fmt
= 'Required substitution source secret was not found at path %(src_path)s in source document [%(src_schema)s, %(src_layer)s] %(src_name)s which is referenced by destination document [%(dest_schema)s, %(dest_layer)s] %(dest_name)s under its `metadata.substitutions`'¶
- Ensure that the missing source secret exists at the
-
exception
deckhand.errors.
SubstitutionSourceNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
Required substitution source document was not found.
Troubleshoot:
- Ensure that the missing source document being referenced exists in the system or was passed to the layering module.
-
code
= 409¶
-
msg_fmt
= 'Required substitution source document [%(src_schema)s] %(src_name)s was not found, yet is referenced by [%(document_schema)s] %(document_name)s'¶
-
exception
deckhand.errors.
UnknownSubstitutionError
(*args, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
An unknown error occurred during substitution.
Troubleshoot:
-
code
= 500¶
-
-
exception
deckhand.errors.
UnsupportedActionMethod
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The action is not in the list of supported methods.
Troubleshoot:
-
code
= 400¶
-
msg_fmt
= 'Method in %(actions)s is invalid for document %(document)s'¶
-
-
exception
deckhand.errors.
ValidationNotFound
(message=None, code=500, **kwargs)[source]¶ Bases:
deckhand.errors.DeckhandException
The requested validation was not found.
Troubleshoot:
-
code
= 404¶
-
msg_fmt
= 'The requested validation entry %(entry_id)s was not found for validation name %(validation_name)s and revision ID %(revision_id)s'¶
-
-
deckhand.errors.
default_exception_handler
(req, resp, ex, params)[source]¶ Catch-all exception handler for standardized output.
If this is a standard falcon HTTPError, rethrow it for handling by
default_exception_serializer
below.
-
deckhand.errors.
default_exception_serializer
(req, resp, exception)[source]¶ Serializes instances of
falcon.HTTPError
into YAML format and formats the error body so it adheres to the Airship error formatting standard.
-
deckhand.errors.
format_error_resp
(req, resp, status_code='500 Internal Server Error', message='', reason=None, error_type=None, error_list=None, info_list=None)[source]¶ Generate a error message body and throw a Falcon exception to trigger an HTTP status.
Parameters: - req –
falcon
request object. - resp –
falcon
response object to update. - status_code –
falcon
status_code constant. - message – Optional error message to include in the body. This should be the summary level of the error message, encompassing an overall result. If no other messages are passed in the error_list, this message will be repeated in a generated message for the output message_list.
- reason – Optional reason code to include in the body
- error_type – If specified, the error type will be used; otherwise, this will be set to ‘Unspecified Exception’.
- error_list – optional list of error dictionaries. Minimally,
the dictionary will contain the ‘message’ field,
but should also contain ‘error’:
True
. - info_list – optional list of info message dictionaries.
Minimally, the dictionary needs to contain a
‘message’ field, but should also have a
‘error’:
False
field.
- req –