You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running alerta heartbeats is showing all heartbeat records ok. When running alerta heartbeats --alert this exception is being thrown:
Traceback (most recent call last):
File "/usr/local/bin/alerta", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 33, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/alertaclient/commands/cmd_heartbeats.py", line 100, in cli
customer=b.customer
File "/usr/local/lib/python3.6/dist-packages/alertaclient/api.py", line 65, in send_alert
r = self.http.post('/alert', data)
File "/usr/local/lib/python3.6/dist-packages/alertaclient/api.py", line 519, in post
response = self.session.post(url, data=json.dumps(data, cls=CustomJsonEncoder),
File "/usr/lib/python3.6/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.6/dist-packages/alertaclient/utils.py", line 18, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python3.6/json/encoder.py", line 180, in default
o.__class__.__name__)
TypeError: Object of type 'function' is not JSON serializable
Environment
OS: Ubuntu 18.04 LTS
API version: 7.4.4
Deployment: Docker
For self-hosted: no WSGI, just the alerta/alerta_web container behind Apache proxy
{"actions":[],"alarm_model":{"colors":{"severity":{"cleared":"#00CC00","critical":"red","debug":"#9D006D","indeterminate":"lightblue","informational":"#00CC00","major":"orange","minor":"yellow","normal":"#00CC00","ok":"#00CC00","security":"blue","trace":"#7554BF","unknown":"silver","warning":"dodgerblue"},"text":"black"},"defaults":{"normal_severity":"normal","previous_severity":"indeterminate","status":"open"},"name":"Alerta 7.4.4","severity":{"cleared":7,"critical":1,"debug":8,"indeterminate":5,"informational":6,"major":2,"minor":3,"normal":7,"ok":7,"security":0,"trace":9,"unknown":10,"warning":4},"status":{"ack":"C","assign":"B","blackout":"E","closed":"F","expired":"G","open":"A","shelved":"D","unknown":"H"}},"audio":{"new":null},"auth_required":true,"aws_region":"us-east-1","azure_tenant":"common","client_id":"0e0d1f1df40e2cde0ca3989b654b102aaed761f9bf104cfef4e00bc65e059f58","cognito_domain":null,"colors":{"severity":{"cleared":"#00CC00","critical":"red","debug":"#9D006D","indeterminate":"lightblue","informational":"#00CC00","major":"orange","minor":"yellow","normal":"#00CC00","ok":"#00CC00","security":"blue","trace":"#7554BF","unknown":"silver","warning":"dodgerblue"},"text":"black"},"columns":["severity","status","lastReceiveTime","timeoutLeft","duplicateCount","customer","environment","service","resource","event","value"],"customer_views":true,"dates":{"longDate":"ddd D MMM, YYYY HH:mm:ss.SSS Z","mediumDate":"ddd D MMM HH:mm","shortTime":"HH:mm"},"debug":false,"email_verification":false,"endpoint":"https://alerta.lakedrops.com/api","filter":{"status":["open","ack"]},"github_url":"https://github.com","gitlab_url":"https://gitlab.lakedrops.com","indicators":{"queries":[{"query":[["environment","Production"]],"text":"Production"},{"query":[["environment","Development"]],"text":"Development"},{"query":{"q":"event:Heartbeat"},"text":"Heartbeats"},{"query":"group=Misc","text":"Misc."}],"severity":["critical","major","minor","warning","indeterminate","informational"]},"keycloak_realm":null,"keycloak_url":null,"oidc_auth_url":"https://gitlab.lakedrops.com/oauth/authorize","provider":"gitlab","refresh_interval":5000,"severity":{"cleared":7,"critical":1,"debug":8,"indeterminate":5,"informational":6,"major":2,"minor":3,"normal":7,"ok":7,"security":0,"trace":9,"unknown":10,"warning":4},"signup_enabled":false,"site_logo_url":"","sort_by":"lastReceiveTime","tracking_id":null}
What's interesting, inside the docker container there is a process running sh -c sleep 60 && alerta heartbeats --alert --severity major which is failing because of missing authentication. So I extended my docker-compose.yml file to provide a config file with auth key and all the other stuff so that the process inside the container can actually perform.
Inside the container the command alerta heartbeats --alert is running just fine.
The only difference I've found is that inside the container there is Python 3.7.6 and on my host there is python 3.6.9
Issue Summary
Running
alerta heartbeats
is showing all heartbeat records ok. When runningalerta heartbeats --alert
this exception is being thrown:Environment
OS: Ubuntu 18.04 LTS
API version: 7.4.4
Deployment: Docker
For self-hosted: no WSGI, just the alerta/alerta_web container behind Apache proxy
Database: Postgres
Server config:
Auth enabled? Yes
Auth provider? GitLab
Customer views? Yes
To Reproduce
Steps to reproduce the behavior:
alerta heartbeats --alert
Additional context
docker-compose.yml
config/alertad.conf
config/config.json
The text was updated successfully, but these errors were encountered: