Closed PowerSurj closed 1 year ago
Github issues is not the best place to resolve problems like this. Issues should be raised for bugs or feature requests, not configuration problems. Please use Slack from now on. Thanks.
Yet, when someone opens a GitHub issue like this, other folks who have faced similar trouble end up here seeking similar ideas or even solutions. But when the discussion is sequestered away to a space requiring authentication, any outcome(s) get locked away.
I'm also attempting to get Alerta running as a container, and also face this ERROR: Failed to retrieve client config from Alerta API endpoint /api/config.
message on an otherwise blank page loading, starting only with example env vars from the project's own documentation.
I have not (yet) been running it in k8s, but I have been running it a while in docker where each feature has its own container (api, ui, db, housekeeping)..
for it to work for me I had to set the BASE_URL to the full url, not relative.
eg: BASE_URL='https://alerta.domain.tld:8443/api'
my config.json then looks like this:
{"endpoint": "/api"}
currently I use nginx (in docker) as the frontend. here is my config template using envsubst '$$HTTP_PORT $$HTTPS_PORT $$SERVER_NAME' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
to generate the config..
worker_processes 1;
pid /tmp/nginx.pid;
daemon off;
events {
worker_connections 1024;
}
http {
client_body_temp_path /tmp/client_body;
fastcgi_temp_path /tmp/fastcgi_temp;
proxy_temp_path /tmp/proxy_temp;
scgi_temp_path /tmp/scgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
include /etc/nginx/mime.types;
server_tokens off;
error_log /dev/stdout 'warn';
access_log /dev/stdout;
gzip on;
gzip_disable "msie6";
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" - $request_time '
'x_forwarded_for=$http_x_forwarded_for host=$host '
'$request_id $sent_http_x_request_id';
default_type application/octet-stream;
server {
listen ${HTTP_PORT} default_server;
server_name ${SERVER_NAME};
return 301 https://$host:${HTTPS_PORT}$request_uri;
}
server {
listen ${HTTPS_PORT} ssl default_server;
server_name ${SERVER_NAME};
ssl_certificate /etc/nginx/certs/public.cer;
ssl_certificate_key /etc/nginx/certs/private.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# listen 80 default_server;
access_log /dev/stdout main;
client_max_body_size 10M;
location /api {
# include /etc/nginx/uwsgi_params;
proxy_pass http://alerta-api:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
root /web;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}
hope that helps.
Issue Summary Users get a pop-up error during login This issue has always been present ever since implementation
Checking alerta nginx logs, i can see GET requests to /api/config return with code 200 https://alerta.mydomain.com/api/config i can access the config file via WEB UI with no errors
Environment
OS: Ubuntu host
API version: Alerta Web UI 8.7.0
Deployment: Container on Kubernetes
For self-hosted, WSGI environment: nginx/uwsgi
Database: Postgres
Server config: Auth enabled? Yes Auth provider? Azure Customer views? Yes (or provide the
/config
endpoint output)Helm values.yaml
and the /web/config files
content of the /web directory
To Reproduce Logging into Alerta WEB UI with Azure AD authentication enabled.
Expected behavior No error pops-up