Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluded fields broken in v2.3.2 #125

Closed
Nightapes opened this issue Jun 11, 2019 · 0 comments · Fixed by #127
Closed

Excluded fields broken in v2.3.2 #125

Nightapes opened this issue Jun 11, 2019 · 0 comments · Fixed by #127
Assignees
Labels

Comments

@Nightapes
Copy link

Nightapes commented Jun 11, 2019

Prerequisites

Description

After upgrade to 2.3.2 all requests fail with HTTP 500.

Steps to Reproduce

  1. Start docker container via docker compose
  msteams-gateway:
    image: idealista/prom2teams:2.3.2
    container_name: ms_teams_gateway
    expose:
     - "8089"
    environment:
      - "PROM2TEAMS_CONNECTOR=<URL>"
  1. Send alert from prometheus

Expected behavior: See message in MSTeam

Actual behavior: No message and error in log

2019-06-11 13:19:27,996 - werkzeug - INFO - 172.19.0.9 - - [11/Jun/2019 13:19:27] "POST /v2/Connector HTTP/1.1" 500 -

2019-06-11 13:19:34,467 - flask.app - ERROR - Exception on /v2/Connector [POST]

Traceback (most recent call last):

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 2292, in wsgi_app

    response = self.full_dispatch_request()

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1815, in full_dispatch_request

    rv = self.handle_user_exception(e)

  File "/usr/local/lib/python3.5/site-packages/flask_restplus-0.12.1-py3.5.egg/flask_restplus/api.py", line 583, in error_router

    return original_handler(e)

  File "/usr/local/lib/python3.5/site-packages/flask_restplus-0.12.1-py3.5.egg/flask_restplus/api.py", line 583, in error_router

    return original_handler(e)

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1718, in handle_user_exception

    reraise(exc_type, exc_value, tb)

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/_compat.py", line 35, in reraise

    raise value

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1813, in full_dispatch_request

    rv = self.dispatch_request()

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1799, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

  File "/usr/local/lib/python3.5/site-packages/flask_restplus-0.12.1-py3.5.egg/flask_restplus/api.py", line 325, in wrapper

    resp = resource(*args, **kwargs)

  File "/usr/local/lib/python3.5/site-packages/Flask-1.0.2-py3.5.egg/flask/views.py", line 88, in view

    return self.dispatch_request(*args, **kwargs)

  File "/usr/local/lib/python3.5/site-packages/flask_restplus-0.12.1-py3.5.egg/flask_restplus/resource.py", line 44, in dispatch_request

    resp = meth(*args, **kwargs)

  File "/usr/local/lib/python3.5/site-packages/prom2teams-2.3.2-py3.5.egg/prom2teams/app/versions/v2/namespace.py", line 26, in post

    alerts = self.schema.load(request.get_json())

  File "/usr/local/lib/python3.5/site-packages/marshmallow-3.0.0rc6-py3.5.egg/marshmallow/schema.py", line 707, in load

    postprocess=True,

  File "/usr/local/lib/python3.5/site-packages/marshmallow-3.0.0rc6-py3.5.egg/marshmallow/schema.py", line 856, in _do_load

    original_data=data,

  File "/usr/local/lib/python3.5/site-packages/marshmallow-3.0.0rc6-py3.5.egg/marshmallow/schema.py", line 1039, in _invoke_load_processors

    data=data, many=many, original_data=original_data,

  File "/usr/local/lib/python3.5/site-packages/marshmallow-3.0.0rc6-py3.5.egg/marshmallow/schema.py", line 1161, in _invoke_processors

    data = processor(data)

  File "/usr/local/lib/python3.5/site-packages/prom2teams-2.3.2-py3.5.egg/prom2teams/prometheus/message_schema.py", line 29, in get_alerts

    excluded = base_labels + self.exclude_fields

TypeError: can only concatenate tuple (not "list") to tuple

Reproduces how often: 100%

Versions

v2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants