Uploaded image for project: 'Aurora'
  1. Aurora
  2. AURORA-1561

Observer log browser throws exception when given a path not matching expected pattern

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • Observer
    • None

    Description

      E.g. trying to access http://192.168.33.7:1338/logs/1450144103372-vagrant-test-http_example_docker-0-aaaf5e1a-f9eb-450c-8750-4d0376a322fb/foo/bar/baz fails with the following exception:

      Traceback (most recent call last):
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 764, in _handle
          return route.call(**args)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 1575, in wrapper
          rv = callback(*a, **ka)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 3138, in wrapper
          result = func(*args, **kwargs)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 3138, in wrapper
          result = func(*args, **kwargs)
        File "apache/thermos/observer/http/file_browser.py", line 76, in handle_logs
          types = self._observer.logs(task_id, process, int(run))
      ValueError: invalid literal for int() with base 10: 'bar'
      

      It's trying to interpret 'bar' as a run id, and dying when it cannot do so. Similar failures can be generated for other parts of the path. E.g. if the first part of the path after the task id does not match a process the following exception is thrown:

      Traceback (most recent call last):
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 764, in _handle
          return route.call(**args)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 1575, in wrapper
          rv = callback(*a, **ka)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 3138, in wrapper
          result = func(*args, **kwargs)
        File "/root/.pex/install/bottle-0.11.6-py2.py3-none-any.whl.e1e7f36ef104f01896f13c85c9899f9d3d0a8813/bottle-0.11.6-py2.py3-none-any.whl/bottle.py", line 3138, in wrapper
          result = func(*args, **kwargs)
        File "apache/thermos/observer/http/file_browser.py", line 76, in handle_logs
          types = self._observer.logs(task_id, process, int(run))
        File "/root/.pex/install/twitter.common.lang-0.3.3-py2-none-any.whl.3480f0b52b6872afe1c1c2ac8f43fb78cc44a3ae/twitter.common.lang-0.3.3-py2-none-any.whl/twitter/common/lang/lockable.py", line 13, in wrapper
          return method(self, *args, **kw)
        File "apache/thermos/observer/task_observer.py", line 551, in logs
          run = self.get_run_number(runner_state, process, run)
        File "/root/.pex/install/twitter.common.lang-0.3.3-py2-none-any.whl.3480f0b52b6872afe1c1c2ac8f43fb78cc44a3ae/twitter.common.lang-0.3.3-py2-none-any.whl/twitter/common/lang/lockable.py", line 13, in wrapper
          return method(self, *args, **kw)
        File "apache/thermos/observer/task_observer.py", line 531, in get_run_number
          if run < len(runner_state.processes[process]):
      KeyError: 'xrun_server'
      

      Ideally we'd return a 404 for all of these cases.

      Attachments

        Activity

          People

            Unassigned Unassigned
            joshua.cohen Joshua Cohen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: