diff --git a/README.md b/README.md index 8a285ce..f3b46ba 100644 --- a/README.md +++ b/README.md @@ -354,6 +354,27 @@ When you switch from Mode A (self-signed cert) to Mode B (Let's Encrypt) using t - **Firefox**: use a new browser profile or delete `SiteSecurityServiceState.txt` from your profile folder +### Web Console 504 on long infra operations (nginx read timeout) + +Some infra operations are synchronous in mc-infra-manager (CB-Tumblebug): the response comes back only after the CSP finishes. Measured on stage: GCP node delete 62 seconds, AWS EKS NodeGroup create 99 seconds. If that is longer than the nginx `proxy_read_timeout` of the Web Console location, the browser gets **504** (and a failure toast) even though the operation completes successfully afterwards. + +The Web Console location (`:3001`) in `conf/docker/conf/mc-iam-manager/nginx.template.conf` (and `nginx.template.local.conf`) uses `proxy_read_timeout 120s` (default was 60s). + +**If 504 still occurs**, raise it further. Keep it as short as practical — a longer value only makes the browser wait longer. + +```bash +# 1. Edit the Web Console location in the template +# proxy_read_timeout 120s; → e.g. proxy_read_timeout 180s; +vi conf/docker/conf/mc-iam-manager/nginx.template.conf + +# 2. Apply to a running installation (generated file) +sed -i '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ + conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +docker exec mc-iam-manager-nginx nginx -t && docker exec mc-iam-manager-nginx nginx -s reload +``` + +To confirm the cause, look for `upstream timed out ... while reading response header from upstream` in `docker logs mc-iam-manager-nginx` at the time of the 504. + ## TLS Certificate Auto-Renewal (Mode B) Let's Encrypt certificates are valid for 90 days. The certificate is stored in the container volume `conf/docker/container-volume/mc-iam-manager/certs` (mounted into `mc-iam-manager-nginx`), **not** in the host's `/etc/letsencrypt`, so a host certbot or `certbot.timer` does not renew it. diff --git a/README_kr.md b/README_kr.md index 56bdf0c..36fbf4a 100644 --- a/README_kr.md +++ b/README_kr.md @@ -265,6 +265,27 @@ Mode A(자체 서명 인증서) → Mode B(Let's Encrypt)로 같은 도메인을 - **Firefox**: 새 브라우저 프로파일 사용 또는 프로파일 폴더의 `SiteSecurityServiceState.txt` 삭제 +### Web Console 장시간 Infra 작업 504 (nginx 응답 대기 시간) + +일부 Infra 작업은 mc-infra-manager(CB-Tumblebug)에서 동기로 처리되어, CSP 작업이 끝난 뒤에야 응답합니다. stage 실측: GCP 노드 삭제 62초, AWS EKS NodeGroup 생성 99초. 이 시간이 Web Console location 의 nginx `proxy_read_timeout` 보다 길면, 작업은 이후 정상 완료되는데도 브라우저는 **504**(와 실패 토스트)를 받습니다. + +`conf/docker/conf/mc-iam-manager/nginx.template.conf`(및 `nginx.template.local.conf`)의 Web Console location(`:3001`)은 `proxy_read_timeout 120s` 를 사용합니다(기존 기본값 60s). + +**504 가 계속 발생하면** 값을 더 늘립니다. 값을 늘리면 브라우저가 그만큼 오래 기다리게 되므로 필요한 만큼만 늘립니다. + +```bash +# 1. 템플릿의 Web Console location 수정 +# proxy_read_timeout 120s; → 예: proxy_read_timeout 180s; +vi conf/docker/conf/mc-iam-manager/nginx.template.conf + +# 2. 기동 중인 설치에 반영(생성된 파일) +sed -i '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ + conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +docker exec mc-iam-manager-nginx nginx -t && docker exec mc-iam-manager-nginx nginx -s reload +``` + +원인 확인: 504 발생 시각의 `docker logs mc-iam-manager-nginx` 에 `upstream timed out ... while reading response header from upstream` 이 있는지 봅니다. + ## TLS 인증서 자동갱신 (Mode B) Let's Encrypt 인증서의 유효기간은 90일입니다. 인증서는 호스트의 `/etc/letsencrypt`가 **아니라** 컨테이너 볼륨 `conf/docker/container-volume/mc-iam-manager/certs`(`mc-iam-manager-nginx`에 마운트)에 저장되므로, 호스트 certbot이나 `certbot.timer`로는 갱신되지 않습니다. diff --git a/conf/api.yaml b/conf/api.yaml index 4301a28..1a5cd05 100644 --- a/conf/api.yaml +++ b/conf/api.yaml @@ -25,7 +25,7 @@ services: password: spider mc-web-console: - version: 0.7.3 + version: 0.7.4 baseurl: http://mc-web-console:3000 auth: type: bearer diff --git a/conf/docker/api.yaml b/conf/docker/api.yaml index 4301a28..1a5cd05 100644 --- a/conf/docker/api.yaml +++ b/conf/docker/api.yaml @@ -25,7 +25,7 @@ services: password: spider mc-web-console: - version: 0.7.3 + version: 0.7.4 baseurl: http://mc-web-console:3000 auth: type: bearer diff --git a/conf/docker/conf/mc-iam-manager/nginx.template.conf b/conf/docker/conf/mc-iam-manager/nginx.template.conf index f7dc69d..4501ea5 100644 --- a/conf/docker/conf/mc-iam-manager/nginx.template.conf +++ b/conf/docker/conf/mc-iam-manager/nginx.template.conf @@ -181,7 +181,9 @@ http { proxy_connect_timeout 60s; proxy_send_timeout 60s; - proxy_read_timeout 60s; + # Infra/K8s calls such as node delete and NodeGroup create wait for the CSP + # (measured 62s / 99s). Raise further if 504 still occurs (see README Known Issues). + proxy_read_timeout 120s; } } diff --git a/conf/docker/conf/mc-iam-manager/nginx.template.local.conf b/conf/docker/conf/mc-iam-manager/nginx.template.local.conf index 401872a..2703127 100644 --- a/conf/docker/conf/mc-iam-manager/nginx.template.local.conf +++ b/conf/docker/conf/mc-iam-manager/nginx.template.local.conf @@ -113,7 +113,9 @@ http { proxy_connect_timeout 60s; proxy_send_timeout 60s; - proxy_read_timeout 60s; + # Infra/K8s calls such as node delete and NodeGroup create wait for the CSP + # (measured 62s / 99s). Raise further if 504 still occurs (see README Known Issues). + proxy_read_timeout 120s; } } diff --git a/conf/docker/conf/mc-web-console/api/conf/api.yaml b/conf/docker/conf/mc-web-console/api/conf/api.yaml index 32bece1..31dd75d 100644 --- a/conf/docker/conf/mc-web-console/api/conf/api.yaml +++ b/conf/docker/conf/mc-web-console/api/conf/api.yaml @@ -25,7 +25,7 @@ services: password: default mc-web-console: - version: 0.7.3 + version: 0.7.4 baseurl: http://mc-web-console-api:3000 auth: type: bearer diff --git a/conf/docker/docker-compose.mini.yaml b/conf/docker/docker-compose.mini.yaml index d60eead..b7eb93b 100644 --- a/conf/docker/docker-compose.mini.yaml +++ b/conf/docker/docker-compose.mini.yaml @@ -389,7 +389,7 @@ services: exec docker-entrypoint.sh postgres" mc-web-console-api: - image: cloudbaristaorg/mc-web-console-api:0.7.3 + image: cloudbaristaorg/mc-web-console-api:0.7.4 pull_policy: always container_name: mc-web-console-api platform: linux/amd64 @@ -438,7 +438,7 @@ services: <<: *default-health-check mc-web-console-front: - image: cloudbaristaorg/mc-web-console-front:0.7.3 + image: cloudbaristaorg/mc-web-console-front:0.7.4 pull_policy: always container_name: mc-web-console-front platform: linux/amd64 diff --git a/conf/docker/docker-compose.yaml b/conf/docker/docker-compose.yaml index fd9e4b1..9a62f8c 100644 --- a/conf/docker/docker-compose.yaml +++ b/conf/docker/docker-compose.yaml @@ -1187,7 +1187,7 @@ services: exec docker-entrypoint.sh postgres" mc-web-console-api: - image: cloudbaristaorg/mc-web-console-api:0.7.3 + image: cloudbaristaorg/mc-web-console-api:0.7.4 pull_policy: always container_name: mc-web-console-api platform: linux/amd64 @@ -1231,7 +1231,7 @@ services: <<: *default-health-check mc-web-console-front: - image: cloudbaristaorg/mc-web-console-front:0.7.3 + image: cloudbaristaorg/mc-web-console-front:0.7.4 pull_policy: always container_name: mc-web-console-front platform: linux/amd64