3.6 KiB
3.6 KiB
Debug Session: cdn-backend-unreachable
- Status: OPEN
- Started: 2026-06-20
- Symptom:
- After enabling Alibaba Cloud CDN for
ticket.fse-media.group, ticket price calculation fails. - The ticket query page does not display ticket items.
- After enabling Alibaba Cloud CDN for
- Constraints:
- No business logic changes before runtime evidence.
- First code change in existing files must be instrumentation only.
- Hypotheses:
- CDN origin/path forwarding for API routes is incorrect.
- Frontend requests use relative URLs and now point at the CDN/static origin instead of backend.
- Backend CORS or host validation blocks requests from
ticket.fse-media.group. - HTTPS, certificate, or mixed-content policy blocks API requests.
- Next steps:
- Locate the ticket-order and ticket-query frontend request code.
- Identify backend API base URL configuration and deployment assumptions.
- Reproduce with browser/network evidence and add instrumentation only if needed.
- Runtime evidence:
- Live check on
https://ticket.fse-media.group/ordershowsGET /api/public/lines,GET /api/public/stations, andGET /api/public/configall return200. - Live check on
https://ticket.fse-media.group/searchshowsGET /api/public/tickets?q=andGET /api/public/popularsucceed, and the ticket list renders 23 rows. - Direct fetch on the live site confirms
/api/public/fares/query?from=HC-01&to=HC-02returns valid fare data. - Frontend code uses same-origin relative API paths, so CDN did not break API origin resolution itself.
- Live responses for
/ticket-order.js,/ticket-search.js, and/public-status.jsreturnCache-Control: max-age=43200, while the affected HTML pages reference them without version query parameters.
- Live check on
- Hypothesis result:
- CDN origin/path forwarding for API routes is incorrect: falsified by live
200responses. - Frontend requests use relative URLs and now point at the wrong origin: falsified by successful same-origin API responses.
- Backend CORS or host validation blocks CDN domain: falsified by successful browser fetches from the production page.
- HTTPS/certificate/mixed-content issue on API requests: not supported by runtime API evidence.
- CDN origin/path forwarding for API routes is incorrect: falsified by live
- Root cause direction:
- The codebase contained many hardcoded
http://ticket.fse-media.group/...links in public pages and JS. - In a CDN + HTTPS deployment, these hardcoded HTTP jumps can split users onto a different protocol path and create intermittent failures or stale-cache behavior.
- The affected public pages loaded critical JS assets without version parameters, while CDN/browser caching allowed 12-hour reuse of older scripts.
- The booking page had an independent selection-state bug: after both endpoints were selected, clicking a new station only replaced the destination and never restarted the origin/destination flow, which made fare/path results look "stuck".
- The codebase contained many hardcoded
- Fix applied:
- Replaced all hardcoded
http://ticket.fse-media.grouplinks inweb/*.htmlandweb/*.jswithhttps://ticket.fse-media.group. - This keeps all public navigation, ticket detail, and token detail links on the same HTTPS/CDN path as the working API requests.
- Added explicit version query parameters to the critical scripts in
ticket-order.htmlandticket-search.htmlso the CDN fetches a fresh asset URL after deployment. - Updated
ticket-order.jsso that clicking a new station after a full start/end selection restarts the selection flow and clears stale route highlights.
- Replaced all hardcoded
- Pending verification:
- User to verify ticket price calculation and ticket search list under the CDN domain after redeploy/cache refresh.