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

Reverse-spec · Services

ec2-api — Errors

Errors — ec2-api — branch 17.0.0

Branch 17.0.0 @ 32740781f605 — repository https://opendev.org/openstack/ec2-api (retired; local branch pre-retirement) — analysed on 2026-10-29

1. How an error reaches the client

WhereConditionStatusBodySource
EC2KeystoneAuthno signature / no access key400EC2 XML, AuthFailure "Signature not provided" / "Access key not provided"ec2api/api/__init__.py:172, ec2api/api/__init__.py:178
EC2KeystoneAuthKeystone ec2tokens answers non-200 (bad signature, unknown key, expired, ec2credential disabled → 503…)Keystone's statusEC2 XML, AuthFailure, message = Keystone's reason phrase (Unauthorized, Not Found…)ec2api/api/__init__.py:213
EC2KeystoneAuth200 without a parsable token400EC2 XML, AuthFailure "Failure communicating with keystone"ec2api/api/__init__.py:221
EC2KeystoneAuthKeystone unreachable (requests exception)500 or 400FaultWrapper (row below)ec2api/api/__init__.py:211, ec2api/api/__init__.py:70
RequestifyTimestamp+Expires, missing Action400webob plain text (400 Bad Request\n\n<explanation>), not EC2 XMLec2api/api/__init__.py:274, ec2api/api/__init__.py:277
Requestifytimestamp expired or invalid403webob plain text "Timestamp failed validation."ec2api/api/__init__.py:262
FaultWrapperany exception outside the Executor (missing Version, Keystone connection error…)400 plain text if the request has no AWSAccessKeyId (SigV4); 500 EC2 XML with code HTTPInternalServerError otherwiseec2api/api/__init__.py:62, ec2api/api/faults.py:46
ExecutorEC2Exception subclass (§ 3)code = 400 for all of them, including *.NotFoundEC2 XML, ec2_code or class name, formatted messageec2api/api/__init__.py:389, ec2api/exception.py:131
Executorbotocore.exceptions.ClientError (S3 calls of RegisterImage)the S3 response's status (400 if absent)EC2 XML with the S3 error code and messageec2api/api/__init__.py:377
Executorany other exception ("unexpected")first integer attribute among code, status, status_code, http_status, else 500EC2 XML, code = the exception class name (NotFound, Forbidden, OverLimit, Conflict, TypeError, KeyError…), message = "Unknown error occurred." when status ≥ 500, else the exception's message or argsec2api/api/__init__.py:304

Consequences for a rewrite and for clients:

  • OpenStack client exceptions leak. An uncaught novaclient Forbidden (Nova policy), neutronclient NotFound, cinderclient OverLimit… is returned with the OpenStack status (403, 404, 413…) and the Python class name as EC2 code, with the OpenStack message (ec2api/api/__init__.py:320, ec2api/api/__init__.py:346). These codes are not in the AWS catalogue; SDKs treat them as generic errors. novaclient exceptions carry code (novaclient:novaclient/exceptions.py:95 [inferred: local clone, not the pinned version]), neutronclient ones status_code (neutronclient:neutronclient/common/exceptions.py:72).
  • Programming errors are 500 with the Python class name: TypeError (unknown parameter, numeric tag value), UnboundLocalError (boolean-looking security group description), KeyError, AttributeError. The probes of _rewrite/ec2-actions_17.0.0.json reproduce them.
  • Unexpected errors are logged at ERROR with the stack and the request environment's string values (ec2api/api/__init__.py:352), which includes the form body and headers [inferred: wsgi.input is not a string, so the body itself is not logged; the HTTP_AUTHORIZATION header is].
  • RequestID in the error is the context's request ID (the one generated by EC2KeystoneAuth), except for FaultWrapper errors which generate a new one (ec2api/api/faults.py:67).

2. Validation errors (before the implementation)

SituationCodeMessage (example)Source
unknown ActionInvalidRequestThe request received was invalid.ec2api/api/apirequest.py:56
required parameter missingMissingParameterThe required parameter 'cidr_block' is missing (Python name)ec2api/api/cloud.py:75
string too long / not a stringValidationError…'key_name should not be greater than 255 characters.' (also for non-strings)ec2api/api/validator.py:27
boolean / integer expectedValidationErrorExpected a boolean value for parameter allow_reassociationec2api/api/validator.py:36, ec2api/api/validator.py:43
list expectedInvalidParameterValueValue (x) for parameter instance_id is invalid. Expected a list hereec2api/api/validator.py:51
bad EC2 ID or wrong prefixInvalidParameterValueValue (vpc-xyz) for parameter vpc_id is invalid. Expected: vpc-...ec2api/api/validator.py:136
bad IPv4 / CIDRInvalidParameterValue…Not a valid IP address / This is not a valid CIDR block.ec2api/api/validator.py:160, ec2api/api/validator.py:99
VPC or subnet CIDR outside /16–/28InvalidVpc.Range / InvalidSubnet.RangeThe CIDR '10.0.0.0/8' is invalid.ec2api/api/validator.py:122, ec2api/api/validator.py:127
filter without name or valuesInvalidFilterThe filter is invalid.ec2api/api/validator.py:180
unknown filter nameInvalidParameterValueValue (foo) for parameter filter is invalid. invalid filterec2api/api/common.py:327
key/value list entry without key or valueInvalidParameterValue…Expected list of key value dictionariesec2api/api/validator.py:188
security group name empty / bad charactersValidationError…Specified value for parameter Groupgroup_name is invalid. Content limited to 'allowed'. (literal allowed, not the character set)ec2api/api/validator.py:197
VPN type not ipsec.1InvalidParameterValueValue (<class 'type'>) for parameter type is invalid. Invalid VPN connection type. (the builtin type is formatted, not the value)ec2api/api/validator.py:225
MaxResults < 5InvalidParameterValueValue ( 3 ) for parameter maxResults is invalid. Expecting a value greater than 5. (raised with a message only, so the template is bypassed)ec2api/api/common.py:391

Messages name Python parameters (cidr_block, vpc_id), not wire names (CidrBlock, VpcId), because the validator receives the decoded name (ec2api/api/cloud.py:69).

3. Exception catalogue

All AWS-style exceptions derive from EC2Exception (ec2api/exception.py:124, code = 400). The EC2 code is ec2_code when the class defines it, else the class name (ec2api/api/__init__.py:291). The message is msg_fmt % kwargs, or the message argument given at the raise site; a formatting error logs the exception and falls back to the raw msg_fmt (ec2api/exception.py:49, fatal_exception_format_errors = false). "Raised at" lists the direct exception.X( sites (first six); the *.NotFound classes are also raised generically through ec2api/api/ec2utils.py:222 (get_db_item, get_db_items, describers). The machine-readable list is _rewrite/ec2-actions_17.0.0.json (exceptions).

ClassEC2 codeHTTPMessage templateRaised at
AddressLimitExceededAddressLimitExceeded400The maximum number of addresses has been reached.ec2api/api/address.py:221
AuthFailureAuthFailure400Not authorized.ec2api/api/address.py:313, ec2api/api/address.py:326, ec2api/api/address.py:415, ec2api/api/address.py:455, ec2api/api/image.py:655, ec2api/context.py:134 (+1)
CannotDeleteCannotDelete400Cannot delete the default VPC security groupec2api/api/security_group.py:530
DependencyViolationDependencyViolation400Object %(obj1_id)s has dependent resource %(obj2_id)sec2api/api/dhcp_options.py:101, ec2api/api/internet_gateway.py:102, ec2api/api/route_table.py:321, ec2api/api/security_group.py:535, ec2api/api/subnet.py:108, ec2api/api/vpc.py:80
EC2DuplicateExceptionEC2DuplicateException400(inherited: An unknown exception occurred.)—
EC2ExceptionEC2Exception400(inherited: An unknown exception occurred.)ec2api/api/image.py:150, ec2api/api/image.py:1029, ec2api/api/image.py:1034, ec2api/api/image.py:1044, ec2api/api/image.py:1095, ec2api/db/migration.py:42 (+2)
EC2InUseExceptionEC2InUseException400(inherited: An unknown exception occurred.)—
EC2IncorrectStateExceptionEC2IncorrectStateException400(inherited: An unknown exception occurred.)—
EC2InvalidExceptionEC2InvalidException400(inherited: An unknown exception occurred.)ec2api/api/image.py:1066
EC2NotFoundExceptionEC2NotFoundException400(inherited: An unknown exception occurred.)—
EC2OverlimitExceptionEC2OverlimitException400(inherited: An unknown exception occurred.)—
GatewayNotAttachedGateway.NotAttached400resource %(gw_id)s is not attached to network %(vpc_id)sec2api/api/address.py:370, ec2api/api/internet_gateway.py:78, ec2api/api/route_table.py:111
IncorrectInstanceStateIncorrectInstanceState400The instance '%(instance_id)s' is not in a state from which the requested operation can be performed.ec2api/api/instance.py:678, ec2api/api/instance.py:1067
IncorrectStateIncorrectState400The resource is in incorrect state for the request - reason: '%(reason)s'ec2api/api/customer_gateway.py:56, ec2api/api/image.py:127, ec2api/api/image.py:316, ec2api/api/image.py:544, ec2api/api/image.py:561, ec2api/api/snapshot.py:43 (+2)
InsufficientFreeAddressesInSubnetInsufficientFreeAddressesInSubnet400The specified subnet does not have enough free addresses to satisfy the request.ec2api/api/network_interface.py:135, ec2api/api/network_interface.py:296
InvalidAMIIDNotFoundInvalidAMIID.NotFound400The image id '[%(id)s]' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP, ec2api/api/ec2utils.py:362, ec2api/api/ec2utils.py:370, ec2api/api/image.py:389
InvalidAMIIDUnavailableInvalidAMIID.Unavailable400Image %(image_id)s is not active.ec2api/api/instance.py:885
InvalidAddressNotFoundInvalidAddress.NotFound400The specified elastic IP address %(ip)s cannot be found.—
InvalidAllocationIDNotFoundInvalidAllocationID.NotFound400The allocation ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP, ec2api/api/address.py:254, ec2api/api/address.py:347
InvalidAssociationIDNotFoundInvalidAssociationID.NotFound400The association ID '%(id)s' does not existec2api/api/address.py:426, ec2api/api/route_table.py:176, ec2api/api/route_table.py:190, ec2api/api/route_table.py:216, ec2api/api/route_table.py:221
InvalidAttachmentIDNotFoundInvalidAttachmentID.NotFound400Attachment %(id)s could not be found.ec2api/api/network_interface.py:419, ec2api/api/network_interface.py:478
InvalidAttributeInvalidAttribute400Attribute not supported: %(attr)sec2api/api/instance.py:89, ec2api/api/instance.py:92
InvalidAvailabilityZoneNotFoundInvalidAvailabilityZone.NotFound400Availability zone %(id)s not foundvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidBlockDeviceMappingInvalidBlockDeviceMapping400(inherited: An unknown exception occurred.)ec2api/api/instance.py:937, ec2api/api/instance.py:978, ec2api/api/instance.py:983, ec2api/api/instance.py:987, ec2api/api/instance.py:996
InvalidCustomerGatewayDuplicateIpAddressInvalidCustomerGateway.DuplicateIpAddress400Conflict among chosen gateway IP addresses.ec2api/api/vpn_connection.py:63
InvalidCustomerGatewayIDNotFoundInvalidCustomerGatewayID.NotFound400The customerGateway ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidDhcpOptionsIDNotFoundInvalidDhcpOptionsID.NotFound400The dhcp options ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidFilterInvalidFilter400The filter is invalid.ec2api/api/validator.py:184
InvalidGatewayIDNotFoundInvalidGatewayID.NotFound400The gateway ID '%(id)s' does not existec2api/api/route_table.py:375
InvalidGroupDuplicateInvalidGroup.Duplicate400Security group '%(name)s' already exists.ec2api/api/security_group.py:80
InvalidGroupNotFoundInvalidGroup.NotFound400The security group ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP, ec2api/api/network_interface.py:125, ec2api/api/security_group.py:585
InvalidGroupReservedInvalidGroup.Reserved400The security group '%(group_name)' is reserved.ec2api/api/security_group.py:65
InvalidIDInvalidID400The ID '%(id)s' is not validec2api/api/tag.py:71
InvalidIPAddressInUseInvalidIPAddress.InUse400Address %(ip_address)s is in use.ec2api/api/address.py:272, ec2api/api/address.py:275
InvalidInputInvalidInput400Invalid input received: %(reason)sec2api/service.py:86, ec2api/wsgi.py:108
InvalidInstanceIDNotFoundInvalidInstanceID.NotFound400The instance ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP, ec2api/api/instance.py:1088
InvalidInstanceIdInvalidInstanceID400There are multiple interfaces attached to instance '%(instance_id)s'. Please specify an interface ID for the operation instead.ec2api/api/address.py:337, ec2api/api/instance.py:512, ec2api/api/instance.py:522, ec2api/api/instance.py:649, ec2api/api/instance.py:664, ec2api/api/route_table.py:402
InvalidInternetGatewayIDNotFoundInvalidInternetGatewayID.NotFound400The internetGateway ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidKeyPairDuplicateInvalidKeyPair.Duplicate400Key pair '%(key_name)s' already exists.ec2api/api/key_pair.py:116, ec2api/api/key_pair.py:134
InvalidKeypairNotFoundInvalidKeyPair.NotFound400Keypair %(id)s is not foundvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidNetworkInterfaceIDNotFoundInvalidNetworkInterfaceID.NotFound400Network interface %(id)s could not be found.via ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidNetworkInterfaceInUseInvalidNetworkInterface.InUse400Interface: %(interface_ids)s in use.ec2api/api/instance.py:1395
InvalidParameterInvalidParameter400The property '%(name)s' is not validec2api/api/availability_zone.py:150, ec2api/api/image.py:600
InvalidParameterCombinationInvalidParameterCombination400The combination of parameters in incorrectec2api/api/address.py:62, ec2api/api/address.py:83, ec2api/api/address.py:95, ec2api/api/address.py:309, ec2api/api/address.py:335, ec2api/api/image.py:215 (+26)
InvalidParameterValueInvalidParameterValue400Value (%(value)s) for parameter %(parameter)s is invalid. %(reason)sec2api/api/address.py:47, ec2api/api/address.py:243, ec2api/api/address.py:400, ec2api/api/address.py:419, ec2api/api/common.py:329, ec2api/api/common.py:394 (+63)
InvalidPermissionDuplicateInvalidPermission.Duplicate400The specified rule already exists for that security group.ec2api/api/security_group.py:558
InvalidPermissionNotFoundInvalidPermission.NotFound400(inherited: An unknown exception occurred.) — **msg_fmg typo: real message is the inherited one**ec2api/api/security_group.py:397
InvalidRequestInvalidRequest400The request received was invalid.ec2api/api/apirequest.py:56, ec2api/api/ec2utils.py:190, ec2api/api/image.py:539, ec2api/api/image.py:644, ec2api/api/route_table.py:412
InvalidRouteNotFoundInvalidRoute.NotFound400No route with destination-cidr-block %(destination_cidr_block)s in route table %(route_table_id)sec2api/api/route_table.py:82, ec2api/api/vpn_connection.py:139
InvalidRouteTableIDNotFoundInvalidRouteTableID.NotFound400The routeTable ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidSecurityGroupIDNotFoundInvalidSecurityGroupID.NotFound400The securityGroup ID '%(id)s' does not exist—
InvalidSnapshotIDMalformedInvalidSnapshotID.Malformed400(inherited: An unknown exception occurred.) — **msg_fmg typo: real message is the inherited one**ec2api/api/instance.py:917
InvalidSnapshotNotFoundInvalidSnapshot.NotFound400Snapshot %(id)s could not be found.via ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidSubnetConflictInvalidSubnet.Conflict400The CIDR '%(cidr_block)s' conflicts with another subnetec2api/api/subnet.py:75
InvalidSubnetIDNotFoundInvalidSubnetID.NotFound400The subnet ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP, ec2api/api/network_interface.py:68
InvalidSubnetRangeInvalidSubnet.Range400The CIDR '%(cidr_block)s' is invalid.ec2api/api/subnet.py:48, ec2api/api/validator.py:129
InvalidVolumeNotFoundInvalidVolume.NotFound400The volume '%(id)s' does not exist.via ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidVpcIDNotFoundInvalidVpcID.NotFound400The vpc ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidVpcRangeInvalidVpc.Range400The CIDR '%(cidr_block)s' is invalid.ec2api/api/validator.py:124
InvalidVpcStateInvalidVpcState400VPC %(vpc_id)s is currently attached to the Virtual Private Gateway %(vgw_id)sec2api/api/vpn_gateway.py:49
InvalidVpnConnectionIDNotFoundInvalidVpnConnectionID.NotFound400The vpnConnection ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
InvalidVpnGatewayAttachmentNotFoundInvalidVpnGatewayAttachment.NotFound400The attachment with vpn gateway ID '%(vgw_id)s' and vpc ID '%(vpc_id)s' does not existec2api/api/vpn_gateway.py:81
InvalidVpnGatewayIDNotFoundInvalidVpnGatewayID.NotFound400The vpnGateway ID '%(id)s' does not existvia ec2api/api/ec2utils.py:222 NOT_FOUND_EXCEPTION_MAP
MissingInputMissingInput400(inherited: An unknown exception occurred.)ec2api/api/instance.py:1313
MissingParameterMissingParameter400The required parameter '%(param)s' is missingec2api/api/address.py:58, ec2api/api/address.py:65, ec2api/api/address.py:79, ec2api/api/address.py:91, ec2api/api/cloud.py:75, ec2api/api/dhcp_options.py:95 (+10)
OperationNotPermittedOperationNotPermitted400The specified operation is not allowed.ec2api/api/instance.py:197, ec2api/api/network_interface.py:480
ResourceAlreadyAssociatedResource.AlreadyAssociated400(inherited: An unknown exception occurred.)ec2api/api/address.py:359, ec2api/api/internet_gateway.py:52, ec2api/api/route_table.py:157
ResourceLimitExceededResourceLimitExceeded400You have reached the limit of %(resource)sec2api/api/key_pair.py:114, ec2api/api/key_pair.py:132, ec2api/api/security_group.py:96
RouteAlreadyExistsRouteAlreadyExists400The route identified by %(destination_cidr_block)s already exists.ec2api/api/route_table.py:428
RulesPerSecurityGroupLimitExceededRulesPerSecurityGroupLimitExceeded400You've reached the limit on the number of rules that you can add to a security group.ec2api/api/security_group.py:556
SecurityGroupLimitExceededSecurityGroupLimitExceeded400You have reached the limit of security groups—
SubnetLimitExceededSubnetLimitExceeded400You have reached the limit on the number of subnets that you can createec2api/api/subnet.py:70
UnsupportedUnsupported400The specified request is unsupported. %(reason)sec2api/api/customer_gateway.py:39, ec2api/api/customer_gateway.py:41, ec2api/api/ec2utils.py:474, ec2api/api/instance.py:1457, ec2api/api/instance.py:1461, ec2api/api/vpn_connection.py:49
UnsupportedOperationUnsupportedOperation400The specified request includes an unsupported operation.ec2api/api/instance.py:1355, ec2api/api/volume.py:86, ec2api/api/volume.py:124
VPCIdNotSpecifiedVPCIdNotSpecified400No default VPC for this user.ec2api/api/ec2utils.py:499
ValidationErrorValidationError400The input fails to satisfy the constraints specified by an AWS service: '%(reason)s'ec2api/api/validator.py:31, ec2api/api/validator.py:39, ec2api/api/validator.py:46, ec2api/api/validator.py:221
VpcLimitExceededVpcLimitExceeded400The maximum number of VPCs has been reached.ec2api/api/vpc.py:134
VpnGatewayAttachmentLimitExceededVpnGatewayAttachmentLimitExceeded400The maximum number of virtual private gateway attachments has been reached.ec2api/api/vpn_gateway.py:46
EC2APIConfigNotFoundEC2APIConfigNotFound500Could not find config at %(path)sec2api/wsgi.py:498
EC2APIExceptionEC2APIException500An unknown exception occurred.ec2api/api/instance.py:698
EC2APIPasteAppNotFoundEC2APIPasteAppNotFound500Could not load paste app '%(name)s' from %(path)sec2api/wsgi.py:514
EC2DBDuplicateEntryEC2DBDuplicateEntry500Entry %(id)s already exists in DB.ec2api/db/sqlalchemy/api.py:193
EC2DBInvalidOsIdUpdateEC2DBInvalidOsIdUpdate500Invalid update of os_id of %(item_id)s item from %(old_os_id)s to %(new_os_id)sec2api/db/sqlalchemy/api.py:153
EC2KeystoneDiscoverFailureEC2KeystoneDiscoverFailure500Could not discover keystone versions.—
EC2MetadataExceptionEC2MetadataException500(inherited: An unknown exception occurred.)—
EC2MetadataInvalidAddressEC2MetadataInvalidAddress500(inherited: An unknown exception occurred.)ec2api/metadata/__init__.py:209
EC2MetadataNotFoundEC2MetadataNotFound500(inherited: An unknown exception occurred.)ec2api/metadata/api.py:79, ec2api/metadata/api.py:88, ec2api/metadata/api.py:100, ec2api/metadata/api.py:147, ec2api/metadata/api.py:164, ec2api/metadata/api.py:305 (+1)

3.1 Main situations, in business terms

CodeSituationsSource
<Kind>.NotFound (InvalidInstanceID.NotFound, InvalidVpcID.NotFound, InvalidAMIID.NotFound, InvalidVolume.NotFound…)the ID is not an item of the caller's project (other projects' items are invisible), or the prefix does not match the expected kind, or a Describe with explicit IDs did not find all of them (the first missing one is reported)ec2api/api/ec2utils.py:245, ec2api/api/ec2utils.py:267, ec2api/api/common.py:442
InvalidInstanceID.NotFoundadditionally: the server vanished from Nova during Reboot/Stop/Start (the item is then deleted)ec2api/api/instance.py:1087
InvalidAMIID.NotFoundimage ID unmapped, or Glance 404ec2api/api/ec2utils.py:358
InvalidAMIID.UnavailableRunInstances on an image that is not available (message "Image must be available")ec2api/api/instance.py:882
IncorrectInstanceStateReboot/Stop/Start from a disallowed vm_state; resize of a non-stopped instanceec2api/api/instance.py:1066, ec2api/api/instance.py:675
OperationNotPermittedTerminateInstances with disableApiTermination; DetachNetworkInterface at index 0ec2api/api/instance.py:197, ec2api/api/network_interface.py:480
InvalidParameterCombinationmutually exclusive parameters (RunInstances network options, ModifyInstanceAttribute, AssociateAddress, MaxResults with IDs…)ec2api/api/instance.py:1243, ec2api/api/instance.py:610, ec2api/api/address.py:59
DependencyViolationdeleting a VPC, subnet, route table, internet gateway, DHCP options or security group still in use (Neutron 409 on a security group)ec2api/api/vpc.py:80, ec2api/api/subnet.py:108, ec2api/api/route_table.py:321, ec2api/api/security_group.py:535
VpcLimitExceeded, SubnetLimitExceeded, AddressLimitExceeded, ResourceLimitExceeded, RulesPerSecurityGroupLimitExceeded, InsufficientFreeAddressesInSubnetNeutron/Nova quota (OverQuotaClient, OverLimit) or no free IPec2api/api/vpc.py:134, ec2api/api/subnet.py:70, ec2api/api/address.py:221, ec2api/api/key_pair.py:114, ec2api/api/security_group.py:556, ec2api/api/network_interface.py:135
InvalidSubnet.ConflictNeutron refuses the router interface (overlapping CIDR)ec2api/api/subnet.py:75
Unsupportedno or several external networks ("Feature is restricted by OS admin"); no or several EC2-Classic networks; BGP VPN; customer gateway without IPec2api/api/ec2utils.py:474, ec2api/api/instance.py:1457, ec2api/api/vpn_connection.py:49, ec2api/api/customer_gateway.py:39
AuthFailure (inside actions)image of another project in Deregister/Modify/Describe attribute; elastic IP that is not the caller'sec2api/api/image.py:655, ec2api/api/address.py:455
VPCIdNotSpecifieddisable_ec2_classic and the default VPC could not be createdec2api/api/ec2utils.py:499
MissingInputdefault VPC without subnet (code MissingInput, message given at the raise site)ec2api/api/instance.py:1313

3.2 Defects in the catalogue (keep or fix deliberately)

  • InvalidSnapshotIDMalformed and InvalidPermissionNotFound define msg_fmg instead of msg_fmt (ec2api/exception.py:252, ec2api/exception.py:391): their message is the base "An unknown exception occurred.". InvalidPermission.NotFound is what RevokeSecurityGroupIngress/Egress returns for a missing VPC rule (ec2api/api/security_group.py:397).
  • InvalidGroupReserved has a broken template '%(group_name)' (ec2api/exception.py:494): formatting fails, the error is logged, and the client gets the raw template The security group '%(group_name)' is reserved.
  • InvalidParameterValue(msg) and other classes raised with a bare message bypass the template (ec2api/api/common.py:394); raised with keyword arguments but a missing key (InvalidParameterValue(parameter=…, value=…) without reason) they fall back to the raw template [inferred from ec2api/exception.py:53].
  • MissingInput has no msg_fmt (ec2api/exception.py:197); it is only raised with a message.
  • InvalidAddressNotFound, InvalidSecurityGroupIDNotFound, SecurityGroupLimitExceeded are never raised.
  • NOT_FOUND_EXCEPTION_MAP has no entry for eipassoc, rtbassoc, eni-attach, r, aki/ari describers use ami's class; a lookup of an unmapped kind would raise KeyError → 500 (ec2api/api/ec2utils.py:263) [inferred: callers always pass a mapped kind].

4. Errors outside the API

WhereSituationWhat happensSource
CreateImage (green thread)stop/snapshot fails, or the server does not reach SHUTOFF within 1 hitem state=failed (DescribeImages shows failed), LOG.exception('Failed to complete image %s creation'); the server is restarted in any case, failures logged at WARNINGec2api/api/image.py:158, ec2api/api/image.py:168
RegisterImage from S3 (green thread)download, decrypt (openssl enc -d -aes-128-cbc), untar or upload failsGlance property image_state = failed_download / failed_decrypt / failed_untar / failed_upload (EC2 state failed), logged; the temporary directory is left behind on failure; an image deleted meanwhile is logged at INFOec2api/api/image.py:887, ec2api/api/image.py:949
S3 manifest decryptionx509_root_private_key not set or wrongEC2Exception "Path to ca private key isn't configured" / "Failed to decrypt private key" → image failed_decryptec2api/api/image.py:1091, ec2api/api/image.py:1027
Rollbacks (OnCrashCleaner)a cleanup step failsLOG.warning('Error cleaning up <function>(<args>)'), the original error is still returned; OpenStack objects may be left behindec2api/api/common.py:63
Default VPC creationany failureLOG.exception('Failed to create default vpc'), the call continues as if there were no default VPCec2api/api/vpc.py:184
Default security group repairduplicate item or VPC vanishedLOG.exception('Failed to create default security group.')ec2api/api/security_group.py:124
VPC/subnet/VPN deletionNeutron 409 on router, network, vpnservice, IKE/IPsec policylogged at WARNING, the EC2 deletion still succeeds: Neutron objects can be orphanedec2api/api/vpc.py:94, ec2api/api/subnet.py:129, ec2api/api/vpn_gateway.py:199, ec2api/api/vpn_connection.py:166
Metadata serviceunknown path/version, instance not found or of another project404 (EC2MetadataNotFound); other exceptions 500 "An unknown error has occurred. Please try your request again."ec2api/metadata/__init__.py:113
Metadata proxy to NovaNova metadata answers 403/400/404/409/500same status (403 logged as a shared-secret mismatch); other statuses raise → 500ec2api/metadata/__init__.py:146
S3 serverany handler exception501 with <Error><Code>BadRequest</Code><Message>Unhandled error</Message></Error>ec2api/s3/s3server.py:150
Databaserandom ID collision on items.idDBDuplicateEntry re-raised → 500 DBDuplicateEntry (probability ≈ n/2³² per insert)ec2api/db/sqlalchemy/api.py:107
Databaseconcurrent update_item after a deleteNoResultFound → 500ec2api/db/sqlalchemy/api.py:148

5. Errors observed in the tests

_rewrite/observed-errors-api-tests_17.0.0.md lists the (action, status, code, message) combinations the unit tests produced (227 rows). The 500 Exception rows come from tests that inject a generic exception to check the rollbacks; they are not reachable as such. The metadata and S3 runs are in _rewrite/observed-errors-metadata-tests_17.0.0.md and _rewrite/observed-errors-s3-tests_17.0.0.md.

Source: reverse-spec-ec2-api/02-errors_17.0.0.md. The _rewrite/ and _inventory/ files are not published on the site.