Custom domain returns intermittent 404 after Static Web App recreation with the same domain name
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- azure, terraform
- Lĩnh vực
- cloud, infrastructure, networking
Hướng nghiên cứu
Bắt đầu với việc tái hiện curl đã được báo cáo trên các hostname custom và azurestaticapps.net, sau đó xem xét trạng thái Ready của custom-domain, dòng thời gian tạo lại và bối cảnh xóa do Terraform điều khiển. Được xem là hoàn tất khi xác định được liệu edge mappings hoặc propagation có còn không nhất quán sau khi tạo lại hay không, đồng thời ghi lại một quy trình refresh hoặc đăng ký lại được hỗ trợ; không đề cập đến tệp repository hoặc các bài kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
After two Static Web Apps were destroyed and recreated with the same custom domain names, requests to those custom domains return HTTP 404 for roughly half of all requests, while the auto-generated *.azurestaticapps.net hostnames serve correctly 100% of the time.
The custom domains report status: Ready in the control plane and DNS resolves correctly, so this looks like stale or partially-applied hostname mappings on the edge fleet rather than a configuration problem on our side.
Environment
- Region: West Europe
- Two apps in the same resource group, Free tier, each with one custom domain:
swa-A→lemon-hill-030e51403.7.azurestaticapps.net→ custom domaincrm.bricktech.esswa-B→ashy-sea-037a18303.7.azurestaticapps.net→ custom domainportal.bricktech.es
- Both custom domains are CNAMEs proxied through Cloudflare; validation via
dns-txt-token. - Subscription ID available on request (omitted here since this issue is public).
Timeline
| Time (UTC, 2026-08-01) | Event |
|---|---|
| 09:20 | Both Static Web Apps accidentally deleted (Terraform run against the wrong state) |
| ~11:00 | Both apps recreated with new auto-generated hostnames; custom domains re-added |
| 11:04 | crm.bricktech.es reaches Ready on the recreated app |
| ~12:00 | Intermittent 404s observed on both custom domains |
| 20:08 | crm.bricktech.es deleted and re-registered, hoping to clear the state; validation completes, Ready again |
| 22:10 | Still ~50% HTTP 404 on crm.bricktech.es; portal.bricktech.es (never re-registered) fluctuates between ~65% and 100% success |
To Reproduce
for i in $(seq 1 20); do
curl -s -o /dev/null -w "%{http_code} " "https://crm.bricktech.es/?cachebust=$RANDOM"
done
# → e.g. 404 200 404 200 200 200 404 200 404 200 200 404 200 200 404 200 200 200 404 200
The auto-generated hostname, by contrast, is consistently healthy:
for i in $(seq 1 20); do
curl -s -o /dev/null -w "%{http_code} " "https://lemon-hill-030e51403.7.azurestaticapps.net/?cachebust=$RANDOM"
done
# → 200 200 200 200 200 ... (20/20)
Expected behavior
Once a custom domain reports Ready, all edge nodes should serve it consistently.
Additional context
1. The mixed responses come from a single IP. The app resolves through Traffic Manager to one address, and that same address alternates 404/200 across requests — so the inconsistency is between backend instances behind it, not between DNS answers.
2. Transient canonical-redirect inconsistency. For a period, the auto-generated hostname of swa-A responded 301 redirecting to the custom domain on some nodes, while other nodes served content for that same hostname normally. This made a common workaround (reverse-proxying to the auto-generated hostname) produce a redirect loop for end users. The 301s later stopped appearing without any change on our side. Meanwhile swa-B's auto-generated hostname never redirected, despite having an equivalent single-custom-domain configuration.
3. Re-registering the custom domain did not help. Deleting and re-adding crm.bricktech.es completed validation normally but did not resolve the intermittent 404s.
Questions
- Is there a known issue when a Static Web App is deleted and a new one is created that re-uses the same custom domain name — can stale mappings from the deleted app persist on part of the edge fleet?
- Is there a supported way to force a refresh of custom-domain mappings across the fleet?
- What is the expected propagation window after a custom domain reaches
Ready? The documentation does not state one, which makes it hard to tell "still propagating" apart from "stuck". - Is there a recommended procedure when recreating a Static Web App that must keep the same custom domain (for example, a required waiting period before re-adding it)?
We currently mitigate by routing traffic through a Cloudflare Worker that addresses the origin by its auto-generated hostname, but that is a workaround and it conflicts with the canonical redirect described in point 2.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 347
- Fork
- 68
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/static-web-apps
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Azure/static-web-apps#1764 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Azure/static-web-apps#1827 ·
-
Managed Functions Not RestartingĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Azure/static-web-apps#1826 · 5 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Azure/static-web-apps#1825 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Azure/static-web-apps#1824 ·
Tất cả issue của Azure/static-web-apps
Issue tương tự
-
Language: Terraform :globe_with_meridians: Needs: Triage :mag: Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/terraform-azurerm-avm-res-storage-storageaccount#450 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A quote or backslash in private registry credentials renders invalid JSONCó thể đã có người làm @blacksoxx đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kubescape/helm-charts#1057 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws-amplify/amplify-backend#3385 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
data-mermaid/mermaid-segmentation#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
mieweb/ozwell-computer#84 ·
Maintainer thường phản hồi trong vòng 1 ngày