You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenShift部署OptaPlanner排班应用后访问提示Not Found求助

Troubleshooting "Not Found" Error for OptaShift Employee Rostering on OpenShift

Let’s walk through the most likely issues and fixes since your pods and services are reporting healthy status but the route isn’t serving the expected content:

  • Verify your route configuration details
    First, check how your route maps to the application service. Run oc get routes to view the route's host, path, and target service. Ensure:

    • The PATH column is either empty (mapping to the service root) or set to /roster if the app expects that context path. If the route uses / as the path but you’re accessing /roster, double-check if the app’s actual context path differs.
    • The target service and port match what your application uses. Run oc get service <your-service-name> to confirm the service exposes the correct port (usually 8080 for Spring Boot apps like this one).
  • Check the application’s context path directly in the pod
    Sometimes the app simply isn’t listening on /roster. Jump into a running pod and test locally:

    oc rsh <your-pod-name> curl localhost:8080
    

    Or if you suspect the context path is /roster:

    oc rsh <your-pod-name> curl localhost:8080/roster
    

    If you get a 404 here too, the app itself isn’t configured to serve content at that path. Check the app’s startup logs (via oc logs <your-pod-name>) for lines mentioning "context path" or "servlet mapping" to confirm where content is served.

  • Validate service-to-pod connectivity
    Even if the service shows as active, ensure it routes traffic to your pods. Run oc describe service <your-service-name> and look at the Endpoints section—you should see your pod’s IP paired with the app’s port (e.g., 10.128.0.45:8080). If this section is empty, the service isn’t linked to your pod (check that pod labels match the service’s selector labels).

  • Test routing from within the cluster
    To rule out route-specific issues, test accessing the service directly from another cluster pod:

    oc run temp-test --image=busybox --rm -it -- curl <your-service-name>:8080/roster
    

    If this works, the problem is isolated to the OpenShift route configuration. If it fails, the issue lies between the service and application pod.

  • Check for unintended redirects or TLS settings
    If your route has TLS enabled, check if it redirects HTTP traffic to HTTPS. Run oc describe route <your-route-name> and look for InsecureEdgeTerminationPolicy: Redirect. If set, try accessing https://localhost/roster instead—browsers sometimes hide redirects that lead to unexpected 404s.

By working through these steps, you’ll be able to pinpoint whether the issue stems from route mapping, application context path, or service-to-pod connectivity.

内容的提问来源于stack exchange,提问作者ajd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:03:47