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

Unable to create alerts - Input has too many columns #1927

Open
hd40910 opened this issue Feb 29, 2024 · 1 comment
Open

Unable to create alerts - Input has too many columns #1927

hd40910 opened this issue Feb 29, 2024 · 1 comment

Comments

@hd40910
Copy link

hd40910 commented Feb 29, 2024

Issue Summary
While trying to create alerts in Alerta we are getting this error
alerta.exceptions.ApiError: cannot cast type record to history
LINE 10: ...ULL, NULL, NULL, NULL, 31536000, NULL, NULL, 'no')::history]...

Environment

  • OS: Docker

  • API version: alerta/alerta-web:8.5.0

  • Deployment: Docker

  • Database: Docker --> Postgres:14-alpine

  • web UI version: alerta/alerta-web:8.5.0

To Reproduce
Steps to reproduce the behavior:
curl --location --request POST 'https://:/api/alert'
--header 'Content-Type: application/json'
--data-raw '{
"attributes": {
"region": "EU"
},
"correlate": [
"HttpServerError",
"HttpServerOK"
],
"environment": "Production",
"event": "HttpServerError",
"group": "Web",
"origin": "curl",
"resource": "web01",
"service": [
"example.com"
],
"severity": "critical",
"tags": [
"dc1"
],
"text": "Site is down.",
"type": "exceptionAlert",
"value": "Bad Gateway (501)"
}'

Expected behavior
Alert Gets Created

Actual behavior

DETAIL: Input has too many columns.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/venv/lib/python3.7/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/venv/lib/python3.7/site-packages/alerta/auth/decorators.py", line 128, in wrapped
return f(*args, **kwargs)
File "/venv/lib/python3.7/site-packages/alerta/models/metrics.py", line 258, in wrapped
response = f(*args, **kwargs)
File "/venv/lib/python3.7/site-packages/alerta/utils/response.py", line 18, in decorated
return func(*args, **kwargs)
File "/venv/lib/python3.7/site-packages/alerta/views/alerts.py", line 71, in receive
raise ApiError(str(e), 500)
alerta.exceptions.ApiError: cannot cast type record to history
LINE 10: ...ULL, NULL, NULL, NULL, 31536000, NULL, NULL, 'no')::history]...
^
DETAIL: Input has too many columns.
2024-02-29 18:18:14,235 DEBG 'uwsgi' stdout output:
[pid: 65|app: 0|req: 4/31] 10.249.144.180 () {48 vars in 626 bytes} [Thu Feb 29 18:18:14 2024] POST /api/alert => generated 324 bytes in 46 msecs (HTTP/1.1 500) 5 headers in 204 bytes (2 switches on core 0)

@hd40910
Copy link
Author

hd40910 commented Feb 29, 2024

Just a note, its works fine with Postgres:11.2-alpine but gives this error for Postgres:14-alpine

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

No branches or pull requests

1 participant