question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BasicErrorController#error spam on startup, no pages available and view forwarding fails.

See original GitHub issue

Please take the time to search the repository, if your question has already been asked or answered.

v3.0.0

What kind of issue is this?

My App.java is annotated with @SpringBootApplication and @EnableOpenApi

    @Bean
    Docket apiDetails() {
        return new Docket(DocumentationType.OAS_30)
            .select()
            .apis(RequestHandlerSelectors.basePackage("io.ascopes.springboot.usermgmt.controller"))
            .build()
            .apiInfo(new ApiInfo(
                "Spring Boot Microservice Example",
                "An MVC microservice example in Spring Boot",
                getClass().getPackage().getImplementationVersion(),
                null,
                new Contact("ascopes", "http://github.com/ascopes", null),
                "Unlicense",
                "http://unlicense.org/",
                Collections.emptyList()
            ))
            .enable(true);
    }

    @Bean
    UiConfiguration uiConfiguration() {
        return UiConfigurationBuilder.builder()
            .deepLinking(true)
            .displayOperationId(false)
            .showExtensions(true)
            .validatorUrl(null)
            .build();
    }

On startup, I can hit the swagger-ui endpoint (although it just constantly spam responds with Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually:, has no content in the response, and repeatedly hits a 404).

In the debug logs, I can just see errors being repeatedly hit by the SpringFox components with no additional details. This goes on forever.

2021-02-14 14:37:47.676 DEBUG 38189 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.746 DEBUG 38189 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.820 DEBUG 38189 --- [nio-8080-exec-4] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.897 DEBUG 38189 --- [nio-8080-exec-5] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.972 DEBUG 38189 --- [nio-8080-exec-6] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.048 DEBUG 38189 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.123 DEBUG 38189 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.195 DEBUG 38189 --- [nio-8080-exec-9] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.275 DEBUG 38189 --- [io-8080-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)

Within a debugger, it appears the swagger-ui endpoint itself is causing this spam:

image

image

Repo can be found at https://github.com/ascopes/spring-boot-microservice-example/tree/task/swagger

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
ThomasBltcommented, Mar 15, 2021

Same problem here

the workaround was not obvious so I’ll try to rephrase it here : Not working : basepath/swagger-ui AND basepath/swagger-ui/ Working fine : basepath/swagger-ui/index.html

1reaction
stale[bot]commented, Mar 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot Remove Whitelabel Error Page - Stack Overflow
In my design if any error occurred inside the REST endpoint it should return a JSON error response, it was working for some...
Read more >
Spring Boot: Customize Whitelabel Error Page - Baeldung
First, let's see how we can disable the white label error page entirely, by setting the server.error.whitelabel.enabled property to false:
Read more >
Guide to Spring Boot REST API Error Handling - Toptal
Implement consumer-friendly support to a Spring Boot REST API by hiding implementation details and delivering easily digestible fields.
Read more >
Exception Handling in Spring MVC
If no view-resolver mapping for /error can be found, Spring Boot defines its own fall-back error page - the so-called “Whitelabel Error ......
Read more >
Why is my support address not verified? - Zendesk help
I see the error message Forwarding check failed. Resolution steps. Verify that the forwarding rules within your email domain are set up ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found