-
Notifications
You must be signed in to change notification settings - Fork 88
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
marshmallow.exceptions.ValidationError #105
Comments
Hi Team, Could you please advise on this ? |
Hi Prom2teams, |
Hi @shabeermm, sorry for the late response. Could you please provide your |
i've got the same (unknown field) error
i'm running the docker container (inside kubernetes cluster) idealista/prom2teams:2.2.3 |
Ok, I'll check it out |
Mmm, are you guys getting the JSONs from Prometheus? I used the ones in |
|
I am getting the same error, any idea on this? |
Hi @ekarlso, Could you provide more details? Thanks in advance, |
marshmallow.exceptions.ValidationError: {'groupKey': ['Unknown field.'], 'commonLabels': ['Unknown field.'], 'alerts': {0: {'labels': {'prometheus': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}, 1: {'labels': {'prometheus': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}, 2: {'labels': {'namespace': ['Unknown field.'], 'prometheus': ['Unknown field.'], 'pod_name': ['Unknown field.'], 'container_name': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}, 3: {'labels': {'namespace': ['Unknown field.'], 'prometheus': ['Unknown field.'], 'pod_name': ['Unknown field.'], 'container_name': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}, 4: {'labels': {'namespace': ['Unknown field.'], 'prometheus': ['Unknown field.'], 'pod_name': ['Unknown field.'], 'container_name': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}, 5: {'labels': {'namespace': ['Unknown field.'], 'prometheus': ['Unknown field.'], 'pod_name': ['Unknown field.'], 'container_name': ['Unknown field.']}, 'annotations': {'message': ['Unknown field.'], 'runbook_url': ['Unknown field.']}}}, 'commonAnnotations': ['Unknown field.'], 'groupLabels': ['Unknown field.']} apiVersion: v1
|
@dortegau any idea on this? |
I've got a local change to fix this. Have added unit test for the example from @NiasSt90. |
Sure, @gjermy |
Hi @jnogol - PR submitted. (But go gently - first github PR) |
Fixes #105 marshmallow.exceptions.ValidationError
Hi @gjermy, Your PR has been merged. Thanks for your contribution 🙂 |
Version 2.3.0 is now available in Pypi: https://pypi.org/project/prom2teams/2.3.0/ |
Hello guys. I hope you're doing well in these times.
Furthermore, I configured a ms teams webhook :
Finally, please find below values.yaml file from prom2teams:
Logs from prom2teams pod show:
So I was wondering if you could help me on this. |
Prerequisites
Description
Getting marshmallow.exceptions.ValidationError when trying to post to the prom2teams V2 api on
curl http://localhost:8089/
Steps to Reproduce
curl http://localhost:8089/v2/prometheus-tool-dev -H "Content-Type: application/json" -v --data '
< HTTP/1.0 500 INTERNAL SERVER ERROR
< Content-Type: text/html
< Content-Length: 291
< Server: Werkzeug/0.14.1 Python/3.5.2
< Date: Mon, 14 Jan 2019 08:39:10 GMT
<
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
* Closing connection 0 -------------------------2019-01-14 08:39:10,688 - flask.app - ERROR - Exception on /v2/prometheus-tool-dev [POST]
Traceback (most recent call last):
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.5/dist-packages/flask_restplus/api.py", line 558, in error_router
return original_handler(e)
File "/usr/local/lib/python3.5/dist-packages/flask_restplus/api.py", line 558, in error_router
return original_handler(e)
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python3.5/dist-packages/flask_restplus/api.py", line 314, in wrapper
resp = resource(*args, **kwargs)
File "/home/azureuser/.local/lib/python3.5/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/flask_restplus/resource.py", line 44, in dispatch_request
resp = meth(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/prom2teams/app/versions/v2/namespace.py", line 26, in post
alerts = self.schema.load(request.get_json())
File "/usr/local/lib/python3.5/dist-packages/marshmallow/schema.py", line 529, in load
postprocess=True,
File "/usr/local/lib/python3.5/dist-packages/marshmallow/schema.py", line 682, in _do_load
raise exc
marshmallow.exceptions.ValidationError: {'title': ['Unknown field.'], 'summary': ['Unknown field.'], '@type': ['Unknown field.']}
2019-01-14 08:39:10,689 - werkzeug - INFO - 172.18.37.14 - - [14/Jan/2019 08:39:10] "POST /v2/prometheus-tool-dev HTTP/1.1" 500 -
Expected behavior: I should be able to get 200 response
Actual behavior: Getting error response as 500
Reproduces how often: Everytime. New imolementation
Versions
Latest
Additional Information
Please see the above logs which i pasted for more information
The text was updated successfully, but these errors were encountered: