galaxy.exceptions package

This module defines Galaxy’s custom exceptions.

A Galaxy exception is an exception that extends MessageException which defines an HTTP status code (represented by the status_code attribute) and a default error message.

New exceptions should be defined by adding an entry to error_codes.json in this directory to define a default error message and a Galaxy “error code”. A concrete Python class should be added in this file defining an HTTP status code (as status_code) and error code (error_code) object loaded dynamically from error_codes.json.

Reflecting Galaxy’s origins as a web application, these exceptions tend to be a bit web-oriented. However this module is a dependency of modules and tools that have nothing to do with the web - keep this in mind when defining exception names and messages.

exception galaxy.exceptions.MessageException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: Exception

Most generic Galaxy exception - indicates merely that some exceptional condition happened.

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=0,message=Unknown error occurred while processing request.]
__init__(err_msg: str | None = None, type='info', **extra_error_info)[source]
static from_code(status_code, message)[source]
exception galaxy.exceptions.ItemDeletionException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

exception galaxy.exceptions.ObjectInvalid[source]

Bases: Exception

Accessed object store ID is invalid

exception galaxy.exceptions.AcceptedRetryLater(msg: str | None = None, retry_after=60)[source]

Bases: MessageException

status_code: int = 202
err_code: ErrorCode = ErrorCode[code=202001,message=Galaxy has accepted this request and is processing. A retry-after header indicates to the client when to retry.]
__init__(msg: str | None = None, retry_after=60)[source]
retry_after: int
exception galaxy.exceptions.NoContentException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 204
err_code: ErrorCode = ErrorCode[code=204001,message=Galaxy has no content to associate with this request.]
exception galaxy.exceptions.ActionInputError(err_msg, type='error')[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400008,message=Request contained invalid parameter, action could not be completed.]
__init__(err_msg, type='error')[source]
exception galaxy.exceptions.DuplicatedSlugException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400006,message=Slug must be unique per user.]
exception galaxy.exceptions.DuplicatedIdentifierException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400011,message=Request contained a duplicated identifier that must be unique.]
exception galaxy.exceptions.ObjectAttributeInvalidException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400004,message=Attempted to create or update object with invalid attribute value.]
exception galaxy.exceptions.ObjectAttributeMissingException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400005,message=Attempted to create or update object without required attribute.]
exception galaxy.exceptions.MalformedId(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400009,message=The id of the resource is malformed.]
exception galaxy.exceptions.UserInvalidRunAsException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400002,message=Invalid run_as request - run_as user does not exist.]
exception galaxy.exceptions.MalformedContents(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400013,message=The contents of the request are malformed.]
exception galaxy.exceptions.UnknownContentsType(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400010,message=The request contains unknown type of contents.]
exception galaxy.exceptions.RequestParameterMissingException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400007,message=Request is missing parameter required to complete desired action.]
exception galaxy.exceptions.ToolMetaParameterException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400012,message=Supplied incorrect or incompatible tool meta parameters.]
exception galaxy.exceptions.ToolMissingException(err_msg: str | None = None, type='info', tool_id=None, **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400014,message=Tool could not be found.]
__init__(err_msg: str | None = None, type='info', tool_id=None, **extra_error_info)[source]
exception galaxy.exceptions.RequestParameterInvalidException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
err_code: ErrorCode = ErrorCode[code=400008,message=Request contained invalid parameter, action could not be completed.]
exception galaxy.exceptions.ToolInputsNotReadyException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
error_code = ErrorCode[code=400015,message=Tool inputs not yet ready, try again later.]
exception galaxy.exceptions.ToolInputsNotOKException(err_msg: str | None = None, type='info', *, src: str, id: int, **extra_error_info)[source]

Bases: MessageException

__init__(err_msg: str | None = None, type='info', *, src: str, id: int, **extra_error_info)[source]
status_code: int = 400
error_code = ErrorCode[code=400017,message=Tool inputs not in required OK state.]
exception galaxy.exceptions.RealUserRequiredException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 400
error_code = ErrorCode[code=400016,message=Only real users can make this request.]
exception galaxy.exceptions.AuthenticationFailed(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 401
err_code: ErrorCode = ErrorCode[code=401001,message=Authentication failed, invalid credentials supplied.]
exception galaxy.exceptions.AuthenticationRequired(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403001,message=Authentication required for this request]
exception galaxy.exceptions.ItemAccessibilityException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403002,message=User cannot access specified item.]
exception galaxy.exceptions.ItemOwnershipException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403003,message=User does not own specified item.]
exception galaxy.exceptions.ItemImmutableException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403003,message=The specified item is immutable.]
exception galaxy.exceptions.ConfigDoesNotAllowException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403004,message=The configuration of this Galaxy instance does not allow that operation]
exception galaxy.exceptions.InsufficientPermissionsException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403005,message=You don't have proper permissions to perform the requested operation]
exception galaxy.exceptions.UserCannotRunAsException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=400001,message=User does not have permissions to run jobs as another user.]
exception galaxy.exceptions.UserRequiredException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403008,message=Action requires user authentication.]
exception galaxy.exceptions.AdminRequiredException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403006,message=Action requires admin account.]
exception galaxy.exceptions.UserActivationRequiredException(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 403
err_code: ErrorCode = ErrorCode[code=403007,message=Action requires account activation.]
exception galaxy.exceptions.ObjectNotFound(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

Accessed object was not found

status_code: int = 404
err_code: ErrorCode = ErrorCode[code=404001,message=No such object found.]
exception galaxy.exceptions.Conflict(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 409
err_code: ErrorCode = ErrorCode[code=409001,message=Database conflict prevented fulfilling the request.]
exception galaxy.exceptions.DeprecatedMethod(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

Method (or a particular form/arg signature) has been removed and won’t be available later

status_code: int = 410
err_code: ErrorCode = ErrorCode[code=410001,message=This API method or call signature has been deprecated and is no longer available]
exception galaxy.exceptions.ConfigurationError[source]

Bases: Exception

status_code = 500
err_code = ErrorCode[code=500003,message=Error in a configuration file.]
exception galaxy.exceptions.InconsistentDatabase(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 500
err_code: ErrorCode = ErrorCode[code=500002,message=Inconsistent database prevented fulfilling the request.]
exception galaxy.exceptions.InternalServerError(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 500
err_code: ErrorCode = ErrorCode[code=500001,message=Internal server error.]
exception galaxy.exceptions.ToolExecutionError(err_msg, type='error', job=None)[source]

Bases: MessageException

status_code: int = 500
err_code: ErrorCode = ErrorCode[code=500004,message=Tool execution failed due to an internal server error.]
__init__(err_msg, type='error', job=None)[source]
exception galaxy.exceptions.NotImplemented(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 501
err_code: ErrorCode = ErrorCode[code=501001,message=Method is not implemented.]
exception galaxy.exceptions.InvalidFileFormatError(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 500
err_code: ErrorCode = ErrorCode[code=500005,message=File format not supported for this operation.]
exception galaxy.exceptions.ReferenceDataError(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 500
err_code: ErrorCode = ErrorCode[code=500006,message=Reference data required for program execution failed to load.]
exception galaxy.exceptions.ServerNotConfiguredForRequest(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

status_code: int = 501
err_code: ErrorCode = ErrorCode[code=501002,message=Server not configured for the request. The Galaxy admin may be able to resolve the problem by installing additional dependencies or setting up new infrastructure.]
exception galaxy.exceptions.HandlerAssignmentError(msg=None, obj=None, **kwargs)[source]

Bases: Exception

__init__(msg=None, obj=None, **kwargs)[source]

Submodules

galaxy.exceptions.error_codes module

Defines the ErrorCode class and instantiates concrete objects from JSON.

See the file error_codes.json for actual error code descriptions.

class galaxy.exceptions.error_codes.ErrorCode(code: int, default_error_message: str)[source]

Bases: object

Small class allowing object representation for error descriptions loaded from JSON.

__init__(code: int, default_error_message: str)[source]

Construct a ErrorCode from supplied integer and error message.