Hi,
For some reason messages are now being sent with content-type 'text/plain' instead of 'application/json'. This is causing Mailer to fail with "ContentDisallowed: Refusing to deserialize untrusted content of type text/plain" error. It would seem that the change turns single quotes into double quotes, which causes Kombu producer to fail to recognize json. Or something like that (not much of a programmer myself)
body = alert.serialize:
2017-10-30 16:12:34,548 - alerta.plugins.amqp[25936]: DEBUG - EFORE: {'repeat': True, 'history': [], 'rawData': "{'Err': None, 'Series': [{'tags': {'remote': 'XXXXXXXXXXXXXXXXXXXXXX.1', 'host': 'XXXXXXXXXXXXXXXXXXXXXX', 'stratum': '1', 'server_group': 'rabbitmq', 'server_group_env': 'prod'}, 'values': [['2017-10-30T15:07:31.907705404Z', 1.166]], 'name': 'ntpq', 'columns': ['time', 'stat']}], 'Messages': None}", 'type': 'exceptionAlert', 'id': 'ec53c40f-7c44-45e7-aa31-1e14fb4e4fcc', 'environment': 'prod', 'tags': [], 'customer': None, 'lastReceiveTime': datetime.datetime(2017, 10, 30, 15, 12, 34, 539000), 'previousSeverity': 'ok', 'href': 'XXXXXXXXXXXXXXXXXXXXXX/api/alert/ec53c40f-7c44-45e7-aa31-1e14fb4e4fcc', 'correlate': [], 'severity': 'informational', 'timeout': 86400, 'origin': 'Kapacitor', 'attributes': {'ip': 'XXXXXXXXXXXXXXXXXXXXXX'}, 'service': ['XXXXXXXXXXXXXXXXXXXXXX'], 'lastReceiveId': '54d785fa-4efa-4385-8909-c41f8d1aaff7', 'createTime': datetime.datetime(2017, 10, 30, 15, 8, 34, 461000), 'status': 'open', 'receiveTime': datetime.datetime(2017, 10, 30, 15, 8, 34, 485000), 'resource': 'XXXXXXXXXXXXXXXXXXXXXX (rabbitmq)', 'event': 'OS_NTP - XXXXXXXXXXXXXXXXXXXXXX.1/STR: 1 ', 'trendIndication': 'lessSevere', 'value': '1.17ms', 'duplicateCount': 8, 'text': 'INFO: NTP offset to XXXXXXXXXXXXXXXXXXXXXX.1/STR: 1 is at 1.17ms for host XXXXXXXXXXXXXXXXXXXXXX', 'group': 'os'} [in /opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/alerta_amqp-5.4.1-py3.5.egg/alerta_amqp.py:63]
body = json.dumps(alert.serialize, cls=DateEncoder):
2017-10-30 16:12:34,549 - alerta.plugins.amqp[25936]: DEBUG - AFTER: {"repeat": true, "history": [], "rawData": "{'Err': None, 'Series': [{'tags': {'remote': 'XXXXXXXXXXXXXXXXXXXXXX.1', 'host': 'XXXXXXXXXXXXXXXXXXXXXX', 'stratum': '1', 'server_group': 'rabbitmq', 'server_group_env': 'prod'}, 'values': [['2017-10-30T15:07:31.907705404Z', 1.166]], 'name': 'ntpq', 'columns': ['time', 'stat']}], 'Messages': None}", "type": "exceptionAlert", "id": "ec53c40f-7c44-45e7-aa31-1e14fb4e4fcc", "environment": "prod", "tags": [], "customer": null, "lastReceiveTime": "2017-10-30T15:12:34.539Z", "previousSeverity": "ok", "href": "XXXXXXXXXXXXXXXXXXXXXX/api/alert/ec53c40f-7c44-45e7-aa31-1e14fb4e4fcc", "correlate": [], "severity": "informational", "timeout": 86400, "origin": "Kapacitor", "attributes": {"ip": "XXXXXXXXXXXXXXXXXXXXXX"}, "service": ["XXXXXXXXXXXXXXXXXXXXXX"], "lastReceiveId": "54d785fa-4efa-4385-8909-c41f8d1aaff7", "createTime": "2017-10-30T15:08:34.461Z", "status": "open", "receiveTime": "2017-10-30T15:08:34.485Z", "resource": "XXXXXXXXXXXXXXXXXXXXXX (rabbitmq)", "event": "OS_NTP - XXXXXXXXXXXXXXXXXXXXXX.1/STR: 1 ", "trendIndication": "lessSevere", "value": "1.17ms", "duplicateCount": 8, "text": "INFO: NTP offset to XXXXXXXXXXXXXXXXXXXXXX.1/STR: 1 is at 1.17ms for host XXXXXXXXXXXXXXXXXXXXXX", "group": "os"} [in /opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/alerta_amqp-5.4.1-py3.5.egg/alerta_amqp.py:65]
from @davtex