EC2ResponseError

EC2ResponseError: 400 Bad Request <?xml version='1.0' encoding='UTF-8'?> <Response><RequestID>842485b9-b64d-4f45-ba5a-ffbfd306cb34</RequestID><Errors><Error><Code>AuthFailure</Code><Message>User not authorized.</Message></Error></Errors></Response> search by Google

_errorResultSet : ResultSet
[<boto.exception._EC2Error object at 0x7f8110cc0f90>]
_error_message : NoneType
None
args : tuple
(400, 'Bad Request', b"<?xml version='1.0' encoding='UTF-8'?>\n<Response><RequestID>842485b9-b64d-4f45-ba5a-ffbfd306cb34</RequestID><Errors><Error><Code>AuthFailure</Code><Message>User not authorized.</Message></Error></Errors></Response>")
body : str
<?xml version='1.0' encoding='UTF-8'?> <Response><RequestID>842485b9-b64d-4f45-ba5a-ffbfd306cb34</RequestID><Errors><Error><Code>AuthFailure</Code><Message>User not authorized.</Message></Error></Errors></Response>
box_usage : NoneType
None
error_code : str
AuthFailure
errors : list
[('AuthFailure', 'User not authorized.')]
message : str
User not authorized.
reason : str
Bad Request
request_id : str
842485b9-b64d-4f45-ba5a-ffbfd306cb34
status : int
400

Traceback

  1. /usr/local/lib/python3.7/unittest/case.py in testPartExecutor (arguments )

    self : _Outcome
    <unittest.case._Outcome object at 0x7f8111572d50>
    test_case : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    isTest : bool
    False
    1. @contextlib.contextmanager
    2. def testPartExecutor(self, test_case, isTest=False):
    3. old_success = self.success
    4. self.success = True
    5. try:
    6. yield
    7. except KeyboardInterrupt:
    8. raise
    9. except SkipTest as e:
    10. self.success = False

    Locals

    exc_info : NoneType
    None
    old_success : bool
    True

    Globals

    __unittest : bool
    True
    _subtest_msg_sentinel : object
    <object object at 0x7f8128eeafb0>
    DIFF_OMITTED : str
    Diff is %s characters long. Set self.maxDiff to None to see it.
  2. /usr/local/lib/python3.7/unittest/case.py in run (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    result : DiagnosticsTestResult
    <xmlrunner.extra.diagnosticstestrunner.DiagnosticsTestResult run=1 errors=0 failures=0>
    1. outcome = _Outcome(result)
    2. try:
    3. self._outcome = outcome
    4. with outcome.testPartExecutor(self):
    5. self.setUp()
    6. if outcome.success:
    7. outcome.expecting_failure = expecting_failure
    8. with outcome.testPartExecutor(self, isTest=True):
    9. testMethod()

    Locals

    expecting_failure : bool
    False
    expecting_failure_class : bool
    False
    expecting_failure_method : bool
    False
    orig_result : DiagnosticsTestResult
    <xmlrunner.extra.diagnosticstestrunner.DiagnosticsTestResult run=1 errors=0 failures=0>
    outcome : _Outcome
    <unittest.case._Outcome object at 0x7f8111572d50>
    testMethod : method
    <bound method TransitGateways.test_describe_tgw of <c2tests.ec2.transit_gateways.TransitGateways testMethod=test_describe_tgw>>

    Globals

    __unittest : bool
    True
    _subtest_msg_sentinel : object
    <object object at 0x7f8128eeafb0>
    DIFF_OMITTED : str
    Diff is %s characters long. Set self.maxDiff to None to see it.
  3. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in setUp (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. self.entities[resources.VPC_VPCS] = self.get_all_vpcs()
    2. self.entities[resources.VPC_DHCP_OPTIONS] = self.get_all_dhcp_options()
    3. def setUp(self):
    4. self._default_vpcs = dict([(i, None) for i in profile.AVAILABLE_PROJECTS])
    5. super(VPCTestCase, self).setUp()
    6. zones = self.get_all_zones()
    7. def _setup():
    8. # ensure that default VPC exists

    Locals

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  4. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in setUp (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. """
    2. return self.profile.get_connection(profile.EC2Connection)
    3. def setUp(self):
    4. super(_EC2TestCase, self).setUp()
    5. self._default_acls = {i: None for i in profile.AVAILABLE_PROJECTS}
    6. self._default_groups = {i: None for i in profile.AVAILABLE_PROJECTS}
    7. self._default_subnets = {i: {} for i in profile.AVAILABLE_PROJECTS}
    8. self._default_keypair = None

    Locals

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  5. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in setUp (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. self.log.warning(message, *args, **kwargs)
    2. def setUp(self):
    3. self.report("Cleaning up before the test")
    4. self.cleanup()
    5. self.report("Cleaning up finished")
    6. self.log.warning("Running testcase: {0}".format(self._testMethodName))
    7. def tearDown(self):

    Locals

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  6. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in cleanup (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    projects : NoneType
    None
    1. for project in projects or profile.AVAILABLE_PROJECTS:
    2. with self.switch_project(project):
    3. self.report("Filling up {0} project entities...".format(project))
    4. self._fill_entities()
    5. self.report("Cleaning up {0} project entities...".format(project))
    6. self._cleanup()
    7. def cleanup_prod(self):
    8. """Cleans up all data created by the test in production environment."""

    Locals

    project : str
    p1

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  7. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in _cleanup (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. _setup()
    2. with self.switch_project(profile.P2_PROJECT):
    3. _setup()
    4. def _cleanup(self):
    5. super(VPCTestCase, self)._cleanup()
    6. self._delete_vpn_connections()
    7. self._delete_subnets()
    8. self._delete_route_tables()

    Locals

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  8. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in _cleanup (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. def _cleanup(self):
    2. super(_EC2TestCase, self)._cleanup()
    3. self._delete_addresses()
    4. self._delete_instances()
    5. self._delete_network_interfaces()
    6. self._delete_placement_groups()
    7. self._delete_security_groups()
    8. self._detach_external_networks()

    Locals

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  9. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/__init__.py in _delete_instances (arguments )

    self : TransitGateways
    test_describe_tgw (c2tests.ec2.transit_gateways.TransitGateways)
    1. [instance.id],
    2. [
    3. constants.INSTANCE_STATE_RUNNING,
    4. constants.INSTANCE_STATE_STOPPED,
    5. ],
    6. check_for_errors=False,
    7. )
    8. try:
    9. self.log.warning("1. Deleting: {0}".format(instance))

    Locals

    instance : Instance
    Instance:i-865514C1
    instances : list
    [Instance:i-865514C1]

    Globals

    gethostbyname : builtin_function_or_method
    <built-in function gethostbyname>
    UNSIGNED : UNSIGNED
    <botocore.UNSIGNED object at 0x7f811b6a9410>
  10. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/utils.py in wait_for_instance_states (arguments )

    conn : EC2ConnectionLegacy
    <c2tests.profile.EC2ConnectionLegacy object at 0x7f8119ca1150>
    instance_ids : list
    ['i-865514C1']
    states : list
    ['running', 'stopped']
    check_for_errors : bool
    False
    1. raise Error("Instance {0} has disappeared.",
    2. set(instance_ids).difference(got_ids).pop())
    3. return True
    4. wait(10 * constants.MINUTE_SECONDS, check_state)
    5. def wait_for_extnet_attached(conn, *extnets):
    6. """Wait for External Network attached state."""

    Locals

    aws_error_states : list
    ['error', 'failed', 'crashed']
    aws_states : list
    ['running', 'stopped']

    Globals

    _DD : str
    /bin/dd
    _QEMU_IMG : str
    /usr/bin/qemu-img
    LOG : RootLogger
    <RootLogger root (DEBUG)>
    md5 : builtin_function_or_method
    <built-in function openssl_md5>
    RULES : list
    [{'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'tcp', 'from_port': '22', 'to_port': '22'}, {'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'icmp', 'from_port': '-1', 'to_port': '-1'}]
  11. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/utils.py in wait (arguments )

    timeout : int
    600
    func : function
    <function wait_for_instance_states.<locals>.check_state at 0x7f81113f4440>
    *args : tuple
    ()
    **kwargs : dict
    {}
    1. def wait(timeout, func, *args, **kwargs):
    2. """Fail unless func return success within specified number of seconds"""
    3. endtime = time.time() + float(timeout)
    4. while time.time() < endtime:
    5. result = func(*args, **kwargs)
    6. if result:
    7. return result
    8. time.sleep(min(timeout, 0.1))

    Locals

    endtime : float
    1693572820.092874
    result : bool
    False

    Globals

    _DD : str
    /bin/dd
    _QEMU_IMG : str
    /usr/bin/qemu-img
    LOG : RootLogger
    <RootLogger root (DEBUG)>
    md5 : builtin_function_or_method
    <built-in function openssl_md5>
    RULES : list
    [{'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'tcp', 'from_port': '22', 'to_port': '22'}, {'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'icmp', 'from_port': '-1', 'to_port': '-1'}]
  12. /root/c2tests/.venv/lib/python3.7/site-packages/c2tests/utils.py in check_state (arguments )

    1. for state in constants.ERROR_INSTANCE_STATES]
    2. def check_state():
    3. got_ids = set()
    4. for reservation in conn.get_all_instances(instance_ids):
    5. for instance in reservation.instances:
    6. got_ids.add(instance.id)
    7. if check_for_errors and instance.state in aws_error_states:
    8. raise Error("Instance {0} got {1} state.",

    Locals

    aws_error_states : list
    ['error', 'failed', 'crashed']
    aws_states : list
    ['running', 'stopped']
    check_for_errors : bool
    False
    conn : EC2ConnectionLegacy
    <c2tests.profile.EC2ConnectionLegacy object at 0x7f8119ca1150>
    got_ids : set
    set()
    instance_ids : list
    ['i-865514C1']

    Globals

    _DD : str
    /bin/dd
    _QEMU_IMG : str
    /usr/bin/qemu-img
    LOG : RootLogger
    <RootLogger root (DEBUG)>
    md5 : builtin_function_or_method
    <built-in function openssl_md5>
    RULES : list
    [{'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'tcp', 'from_port': '22', 'to_port': '22'}, {'cidr_ip': '0.0.0.0/0', 'ip_protocol': 'icmp', 'from_port': '-1', 'to_port': '-1'}]
  13. /root/c2tests/.venv/src/boto/boto/ec2/connection.py in get_all_instances (arguments )

    self : EC2Connection
    EC2Connection:api.dev.c2.croc.ru
    instance_ids : list
    ['i-865514C1']
    filters : NoneType
    None
    dry_run : bool
    False
    max_results : NoneType
    None
    1. warnings.warn(('The current get_all_instances implementation will be '
    2. 'replaced with get_all_reservations.'),
    3. PendingDeprecationWarning)
    4. return self.get_all_reservations(instance_ids=instance_ids,
    5. filters=filters, dry_run=dry_run,
    6. max_results=max_results)
    7. def get_only_instances(self, instance_ids=None, filters=None,
    8. dry_run=False, max_results=None):
    9. # A future release should rename this method to get_all_instances
  14. /root/c2tests/.venv/src/boto/boto/ec2/connection.py in get_all_reservations (arguments )

    self : EC2Connection
    EC2Connection:api.dev.c2.croc.ru
    instance_ids : list
    ['i-865514C1']
    filters : NoneType
    None
    dry_run : bool
    False
    max_results : NoneType
    None
    next_token : NoneType
    None
    1. if max_results is not None:
    2. params['MaxResults'] = max_results
    3. if next_token:
    4. params['NextToken'] = next_token
    5. return self.get_list('DescribeInstances', params,
    6. [('item', Reservation)], verb='POST')
    7. def get_all_instance_status(self, instance_ids=None,
    8. max_results=None, next_token=None,
    9. filters=None, dry_run=False,

    Locals

    params : dict
    {'InstanceId.1': 'i-865514C1'}

    Globals

  15. /root/c2tests/.venv/src/boto/boto/connection.py in get_list (arguments )

    self : EC2Connection
    EC2Connection:api.dev.c2.croc.ru
    action : str
    DescribeInstances
    params : dict
    {'InstanceId.1': 'i-865514C1'}
    markers : list
    [('item', <class 'boto.ec2.instance.Reservation'>)]
    path : str
    /
    parent : EC2Connection
    EC2Connection:api.dev.c2.croc.ru
    verb : str
    POST
    1. xml.sax.parseString(body, h)
    2. return rs
    3. else:
    4. boto.log.error('%s %s' % (response.status, response.reason))
    5. boto.log.error('%s' % body)
    6. raise self.ResponseError(response.status, response.reason, body)
    7. def get_object(self, action, params, cls, path='/',
    8. parent=None, verb='GET'):
    9. if not parent:

    Locals

    body : bytes
    <?xml version='1.0' encoding='UTF-8'?> <Response><RequestID>842485b9-b64d-4f45-ba5a-ffbfd306cb34</RequestID><Errors><Error><Code>AuthFailure</Code><Message>User not authorized.</Message></Error></Errors></Response>
    response : HTTPResponse
    <boto.connection.HTTPResponse object at 0x7f8110e1b310>

    Globals

    config : Config
    <boto.pyami.config.Config object at 0x7f811bd6c310>
    DEFAULT_CA_CERTS_FILE : str
    /root/c2tests/.venv/src/boto/boto/cacerts/cacerts.txt
    HAVE_HTTPS_CONNECTION : bool
    True
    ON_APP_ENGINE : bool
    False
    PORTS_BY_SECURITY : dict
    {True: 443, False: 80}
    UserAgent : str
    Boto/2.46.1 Python/3.7.9 Linux/3.10.0-862.2.3.el7.x86_64

Environment

Time of report generation
2023-09-01 15:44:11
Python version
3.7.9 (default, Sep 21 2022, 19:11:27) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Path to executable
/root/c2tests/.venv/bin/python
Working directory
/root/c2tests
Arguments vector
  1. /root/c2tests/.venv/bin/c2tests
  2. run
  3. -s
  4. ec2