Uploaded image for project: 'DC/OS'
  1. DC/OS
  2. DCOS_OSS-1812

test_mesos.test_if_marathon_app_can_be_debugged returned 500

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: testing
    • Labels:
      None

      Description

      test_mesos.py:36 (test_if_marathon_app_can_be_debugged)
      dcos_api_session = <dcos_test_utils.dcos_api.DcosApiSession object at 0x7f3d4bf99518>
      
          def test_if_marathon_app_can_be_debugged(dcos_api_session):
              # Launch a basic marathon app (no image), so we can debug into it!
              # Cannot use deploy_and_cleanup because we must attach to a running app/task/container.
              app, test_uuid = test_helpers.marathon_test_app()
              app_id = 'integration-test-{}'.format(test_uuid)
              with dcos_api_session.marathon.deploy_and_cleanup(app):
                  # Fetch the mesos master state once the task is running
                  master_ip = dcos_api_session.masters[0]
                  r = dcos_api_session.get('/state', host=master_ip, port=5050)
                  assert r.status_code == 200
                  state = r.json()
          
                  # Find the agent_id and container_id from master state
                  container_id = None
                  agent_id = None
                  for framework in state['frameworks']:
                      for task in framework['tasks']:
                          if app_id in task['id']:
                              container_id = task['statuses'][0]['container_status']['container_id']['value']
                              agent_id = task['slave_id']
                  assert container_id is not None, 'Container ID not found for instance of app_id {}'.format(app_id)
                  assert agent_id is not None, 'Agent ID not found for instance of app_id {}'.format(app_id)
          
                  # Find hostname and URL from agent_id
                  agent_hostname = None
                  for agent in state['slaves']:
                      if agent['id'] == agent_id:
                          agent_hostname = agent['hostname']
                  assert agent_hostname is not None, 'Agent hostname not found for agent_id {}'.format(agent_id)
                  logging.debug('Located %s with containerID %s on agent %s', app_id, container_id, agent_hostname)
          
                  def _post_agent(url, headers, json=None, data=None, stream=False):
                      r = dcos_api_session.post(
                          url,
                          host=agent_hostname,
                          port=5051,
                          headers=headers,
                          json=json,
                          data=data,
                          stream=stream)
                      assert r.status_code == 200
                      return r
          
                  # Prepare nested container id data
                  nested_container_id = {
                      'value': 'debug-%s' % str(uuid.uuid4()),
                      'parent': {'value': '%s' % container_id}}
          
                  # Launch debug session and attach to output stream of debug container
                  output_headers = {
                      'Content-Type': 'application/json',
                      'Accept': 'application/recordio',
                      'Message-Accept': 'application/json'
                  }
                  lncs_data = {
                      'type': 'LAUNCH_NESTED_CONTAINER_SESSION',
                      'launch_nested_container_session': {
                          'command': {'value': 'cat'},
                          'container_id': nested_container_id}}
      >           launch_output = _post_agent('/api/v1', output_headers, json=lncs_data, stream=True)
      
      test_mesos.py:96: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      
      url = '/api/v1'
      headers = {'Accept': 'application/recordio', 'Content-Type': 'application/json', 'Message-Accept': 'application/json'}
      json = {'launch_nested_container_session': {'command': {'value': 'cat'}, 'container_id': {'parent': {'value': '059f1170-ea4d-...fd2-604164e20b58'}, 'value': 'debug-e1d8b1a6-8e25-4bd2-a4b2-08cdb8a33908'}}, 'type': 'LAUNCH_NESTED_CONTAINER_SESSION'}
      data = None, stream = True
      
          def _post_agent(url, headers, json=None, data=None, stream=False):
              r = dcos_api_session.post(
                  url,
                  host=agent_hostname,
                  port=5051,
                  headers=headers,
                  json=json,
                  data=data,
                  stream=stream)
      >       assert r.status_code == 200
      E       assert 500 == 200
      E        +  where 500 = <Response [500]>.status_code
      
      test_mesos.py:77: AssertionError
      ------- Stderr: -------
      [2017-11-03 02:08:40,415|requests.packages.urllib3.connectionpool|INFO]: Starting new HTTP connection (1): 10.0.7.21
      
      [2017-11-03 02:08:40,431|requests.packages.urllib3.connectionpool|INFO]: Starting new HTTP connection (1): 10.0.7.21
      [2017-11-03 02:08:40,522|dcos_test_utils.marathon|INFO]: Response from marathon: {'tasksRunning': 0, 'id': '/integration-test-e3defff4c39f4afc88aa5b1a70be92d3', 'mem': 32, 'executor': '', 'upgradeStrategy': {'maximumOverCapacity': 1, 'minimumHealthCapacity': 1}, 'deployments': [{'id': '846f799e-a4b4-4f44-87f7-128c6a66a484'}], 'gpus': 0, 'instances': 1, 'backoffFactor': 1.15, 'maxLaunchDelaySeconds': 3600, 'env': {'HOME': '/', 'DCOS_TEST_UUID': 'e3defff4c39f4afc88aa5b1a70be92d3'}, 'unreachableStrategy': {'expungeAfterSeconds': 0, 'inactiveAfterSeconds': 0}, 'backoffSeconds': 1, 'tasksStaged': 0, 'labels': {}, 'tasks': [], 'tasksHealthy': 0, 'tasksUnhealthy': 0, 'requirePorts': False, 'portDefinitions': [{'protocol': 'tcp', 'port': 0, 'name': 'test'}], 'networks': [{'mode': 'host'}], 'killSelection': 'YOUNGEST_FIRST', 'version': '2017-11-03T02:08:40.437Z', 'healthChecks': [{'timeoutSeconds': 10, 'delaySeconds': 15, 'gracePeriodSeconds': 5, 'ignoreHttp1xx': False, 'maxConsecutiveFailures': 120, 'protocol': 'HTTP', 'portIndex': 0, 'path': '/ping', 'intervalSeconds': 10}], 'cpus': 0.1, 'disk': 0, 'cmd': '/opt/mesosphere/bin/dcos-shell python /opt/mesosphere/active/dcos-integration-test/util/python_test_server.py $PORT0'}
      [2017-11-03 02:08:40,523|dcos_test_utils.marathon|INFO]: Waiting for application to be deployed...
      [2017-11-03 02:08:45,539|dcos_test_utils.marathon|INFO]: Waiting for application to be deployed...
      [2017-11-03 02:08:45,560|dcos_test_utils.marathon|INFO]: Application deployed!
      [2017-11-03 02:08:45,562|requests.packages.urllib3.connectionpool|INFO]: Starting new HTTP connection (1): 10.0.7.21
      

      https://teamcity.mesosphere.io/viewLog.html?buildId=844704&buildTypeId=DcOs_Open_Test_IntegrationTest_AwsCloudFormationSimple

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              skumaran Senthil Kumaran
              Team:
              Mesos Team
              Watchers:
              Adam Dangoor (Inactive), Carl Dellar, Senthil Kumaran, Vinod Kone, Yishan Lin (Inactive)
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: