mozilla / active-data-recipes

A repository of various activedata queries and recipes
Mozilla Public License 2.0
9 stars 24 forks source link

Unexpected behavior on "adr test_durations" #67

Closed MadinaB closed 6 years ago

MadinaB commented 6 years ago

Hi, I found some recipe which shows some unexpected behavior on the endpoints. If you run adr test_durations, it will show an error with following message: 'list' object has no attribute 'min',/ As I understand, it appears from this file: https://github.com/mozilla/ActiveData/blob/dev/vendor/jx_elasticsearch/es52/decoders.py#L250

ahal commented 6 years ago

Good investigating! Do you believe this is an issue with the upstream ActiveData repo?

Btw, we know many of the recipes aren't working at the moment (ActiveData recently migrated to newer infrastructure and we're sorting through a bunch of issues that arose from that). But thanks for filing the issue, it'll be easier to track everything we need to do.

MadinaB commented 6 years ago

I am getting following, so it looks like being a reason:

{
  "cause": {
    "context": "ERROR",
    "template": "'list' object has no attribute 'min'",
    "trace": [
      {
        "file": "/home/ec2-user/ActiveData/vendor/jx_elasticsearch/es52/decoders.py",
        "line": 245,
        "method": "_range_composer"
      },
      {
        "file": "/home/ec2-user/ActiveData/vendor/jx_elasticsearch/es52/decoders.py",
        "line": 441,
        "method": "append_query"
      },
      {
        "file": "/home/ec2-user/ActiveData/vendor/jx_elasticsearch/es52/aggs.py",
        "line": 466,
        "method": "es_aggsop"
      },
      {
        "file": "/home/ec2-user/ActiveData/vendor/jx_elasticsearch/es52/__init__.py",
        "line": 152,
        "method": "query"
      },
      {
        "file": "/home/ec2-user/ActiveData/vendor/jx_python/jx.py",
        "line": 77,
        "method": "run"
      },
      {
        "file": "/home/ec2-user/ActiveData/active_data/actions/query.py",
        "line": 63,
        "method": "jx_query"
      },
      {
        "file": "/home/ec2-user/ActiveData/vendor/pyLibrary/env/flask_wrappers.py",
        "line": 55,
        "method": "output"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
        "line": 1461,
        "method": "dispatch_request"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
        "line": 1475,
        "method": "full_dispatch_request"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
        "line": 1817,
        "method": "wsgi_app"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
        "line": 1836,
        "method": "__call__"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
        "line": 176,
        "method": "handle_request"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
        "line": 135,
        "method": "handle"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
        "line": 30,
        "method": "accept"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
        "line": 68,
        "method": "run_for_one"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
        "line": 124,
        "method": "run"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py",
        "line": 131,
        "method": "init_process"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
        "line": 578,
        "method": "spawn_worker"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
        "line": 611,
        "method": "spawn_workers"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
        "line": 544,
        "method": "manage_workers"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
        "line": 211,
        "method": "run"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py",
        "line": 72,
        "method": "run"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py",
        "line": 203,
        "method": "run"
      },
      {
        "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py",
        "line": 74,
        "method": "run"
      },
      {
        "file": "/usr/local/bin/gunicorn",
        "line": 11,
        "method": "<module>"
      }
    ]
  },
  "context": "ERROR",
  "meta": {
    "timing": {
      "total": 0.4489319324493408
    }
  },
  "params": {},
  "template": "problem",
  "trace": [
    {
      "file": "/home/ec2-user/ActiveData/vendor/jx_elasticsearch/es52/__init__.py",
      "line": 161,
      "method": "query"
    },
    {
      "file": "/home/ec2-user/ActiveData/vendor/jx_python/jx.py",
      "line": 77,
      "method": "run"
    },
    {
      "file": "/home/ec2-user/ActiveData/active_data/actions/query.py",
      "line": 63,
      "method": "jx_query"
    },
    {
      "file": "/home/ec2-user/ActiveData/vendor/pyLibrary/env/flask_wrappers.py",
      "line": 55,
      "method": "output"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
      "line": 1461,
      "method": "dispatch_request"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
      "line": 1475,
      "method": "full_dispatch_request"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
      "line": 1817,
      "method": "wsgi_app"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/flask/app.py",
      "line": 1836,
      "method": "__call__"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
      "line": 176,
      "method": "handle_request"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
      "line": 135,
      "method": "handle"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
      "line": 30,
      "method": "accept"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
      "line": 68,
      "method": "run_for_one"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py",
      "line": 124,
      "method": "run"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py",
      "line": 131,
      "method": "init_process"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
      "line": 578,
      "method": "spawn_worker"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
      "line": 611,
      "method": "spawn_workers"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
      "line": 544,
      "method": "manage_workers"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py",
      "line": 211,
      "method": "run"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py",
      "line": 72,
      "method": "run"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py",
      "line": 203,
      "method": "run"
    },
    {
      "file": "/usr/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py",
      "line": 74,
      "method": "run"
    },
    {
      "file": "/usr/local/bin/gunicorn",
      "line": 11,
      "method": "<module>"
    }
  ]
}
Traceback (most recent call last):
  File "/usr/local/bin/adr", line 11, in <module>
    load_entry_point('active-data-recipes', 'console_scripts', 'adr')()
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/cli.py", line 201, in main
    parsed_args.func(parsed_args, remainder, config)
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/cli.py", line 79, in recipe_handler
    print(run_recipe(recipe, remainder, config))
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/recipe.py", line 105, in run_recipe
    output = mod.run(args, config)
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/recipes/test_durations.py", line 21, in run
    data = next(run_query('test_durations', config, **query_args))['data']['result.test']
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/query.py", line 109, in run_query
    yield query_activedata(query_str, config.url)
  File "/Users/madinabektayeva/Documents/Programming/Mozilla-OpenSource/test_formatter/active-data-recipes-run/adr/query.py", line 52, in query_activedata
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: https://activedata.allizom.org/query
klahnakoski commented 6 years ago

The query has stopped throwing errors. Please check if this is fixed, or failing in another way.

The cluster is also crazy slow, so if you get a 500 error, just try again

MadinaB commented 6 years ago

Hello! Thanks for fixing that! Now it works perfectly:

screen shot 2018-11-07 at 9 56 13 am

but slow :(

screen shot 2018-11-07 at 10 11 27 am