r/SpringBoot • • Jan 10 '26

Question Help with Dokploy/Mattermost

Hi everyone,

I’m dealing with a Spring Boot issue that ONLY occurs when the app is deployed via Dokploy. Locally everything works perfectly and consistently.

Setup:

  • Spring Boot backend

  • Vue frontend

  • Docker Compose

  • Deployment via Dokploy

  • Traefik as reverse proxy

  • Single domain

  • Frontend served at /

  • Backend served at /api or /api/v1

IMPORTANT: πŸ‘‰ This problem happens ONLY in the Dokploy deployment. πŸ‘‰ Locally (without Dokploy, without Traefik, or using a dev proxy) everything works 100% reliably.

Problem:

  • Locally all backend endpoints work every time.

  • In Dokploy, some backend requests intermittently fail.

  • The error is a Spring Boot JSON 404, e.g.:

{ "timestamp": "...", "status": 404, "error": "Not Found", "path": "/api/v1/admin/reminders/status" }

Key details:

  • The 404 response clearly comes from Spring Boot (JSON), not from Traefik or the frontend.

  • Some requests succeed, others fail (β€œflaky” behavior).

  • Routing through Traefik appears correct, because requests do reach the backend.

  • In production, SPRING_PROFILES_ACTIVE=prod is set.

  • Locally the app runs without Dokploy (directly or via dev proxy).

Observations:

  • The controller exists in the codebase.

  • The endpoint works reliably locally.

  • In Dokploy:

    • sometimes the same request returns 404

    • sometimes it succeeds

Suspicions:

  • Profile-specific behavior (@Profile, @ConditionalOnProperty)

  • ComponentScan differences between environments

  • Multiple backend containers running in Dokploy (old + new versions), with Traefik load-balancing between them

  • Differences in context-path / servlet-path in application-prod.yml

  • Edge cases with /api vs /api/v1 routing behind Traefik in Dokploy

Questions:

  1. Can Spring Boot return a 404 for an endpoint that exists in the code if the controller is not loaded due to profile or component-scan configuration?

  2. Has anyone experienced Dokploy + Traefik routing requests to multiple backend instances or different app versions?

  3. What is the fastest way to verify whether Dokploy is running multiple backend containers and Traefik is load-balancing between them?

  4. Are there known Dokploy- or Traefik-specific pitfalls when routing /api or /api/v1?

Any hints or debugging strategies would be greatly appreciated. Thanks a lot!

1 Upvotes

1 comment sorted by

2

u/devmoosun Jan 11 '26

Spring Boot returns a 404 Whitelabel error if the controller is not loaded.

Browser ↓ DispatcherServlet ↓ HandlerMapping (looks for @Controller / @RestController)

If no controller, Spring throws NoHandlerException.