Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No static resource swagger-ui/index.html with springdoc 2.4.0 #2528

Closed
nvervelle opened this issue Mar 14, 2024 · 11 comments
Closed

No static resource swagger-ui/index.html with springdoc 2.4.0 #2528

nvervelle opened this issue Mar 14, 2024 · 11 comments
Labels
invalid This doesn't seem right

Comments

@nvervelle
Copy link

Describe the bug

On our project, when upgrading from springdoc 2.3.0 to 2.4.0, access to swagger becomes broken.
Using URL http://localhost:8080/swagger-ui/index.html :

  • With 2.3.0 : swagger properly displays
  • With 2.4.0 : error page
{
  detail: "Internal Server Error",
  exceptionId: "869070aa-2794-454f-9fc7-16c780defc18",
  status: 500,
  timestamp: "2024-03-14T10:05:26.326404836Z",
  title: "Internal Server Error"
}

Stack trace :

{
  "timestamp":"2024-03-14T10:05:26.32324657Z",
  "message":"No static resource swagger-ui/index.html.",
  "logger":"xxx.SpringServerErrorHandler",
  "thread":"http-nio-8080-exec-5",
  "level":"ERROR",
  "stack_trace":"
    o.s.w.s.r.NoResourceFoundException: No static resource swagger-ui/index.html.\n\tat 
    o.s.w.s.r.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:585)\n\tat 
    o.s.w.s.m.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:52)\n\tat 
    o.s.w.s.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)\n\tat 
    o.s.w.s.DispatcherServlet.doService(DispatcherServlet.java:979)\n\tat 
    o.s.w.s.FrameworkServlet.processRequest(FrameworkServlet.java:1014)\n\tat 
    o.s.w.s.FrameworkServlet.doGet(FrameworkServlet.java:903)\n\tat j.s.http.HttpServlet.service(HttpServlet.java:564)\n\tat 
    o.s.w.s.FrameworkServlet.service(FrameworkServlet.java:885)\n\tat j.s.http.HttpServlet.service(HttpServlet.java:658)\n\tat 
    o.a.c.c.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)\n\tat 
    o.a.c.c.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\n\tat o.a.t.w.s.WsFilter.doFilter(WsFilter.java:51)\n\tat 
    o.a.c.c.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\n\tat 
    o.a.c.c.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\n\tat 
    o.s.w.f.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)\n\tat 
    o.a.c.c.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\n\tat 
    o.a.c.c.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\n\tat 
    o.s.w.f.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n\tat 
    o.s.w.f.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)\n\tat 
    o.a.c.c.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\n\tat 
    o.a.c.c.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\n\tat 
    o.s.w.f.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n\tat 
    o.s.w.f.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)\n\tat 
    o.a.c.c.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\n\tat 
    o.a.c.c.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\n\tat 
    o.s.w.f.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109)\n\tat 
    o.s.w.f.OnceP...\n",
  "process.id":"869070aa-2794-454f-9fc7-16c780defc18"
}

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using : 3.2.2
  • What modules and versions of springdoc-openapi are you using : runtimeOnly("org.springdoc:springdoc-openapi-starter-webmvc-ui")
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
  • Provide with a sample code (HelloController) or Test that reproduces the problem : sorry, I didn't extract a sample

Expected behavior

  • A clear and concise description of what you expected to happen : display properly swagger-ui with the openapi specification
  • What is the expected result using OpenAPI Description (yml or json)?

Additional context
It may be related to problems on swagger-ui 5.11.8 (issue) but the description of the problem is different.

@bnasslahsen
Copy link
Contributor

@nvervelle,

Not reproducible.
Feel free to provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

This ticket will be closed, but can be reopened if your provide the reproducible sample.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Mar 14, 2024
@madduci
Copy link

madduci commented Mar 26, 2024

@bnasslahsen I'm experiencing the same Problem with SpringBoot 3.2.4 and SpringDoc 2.4.0. The /v3/api-docs endpoint works, but the /swagger-ui/ doesn't.

I've built a minimum example demonstrating the issue, here: https://github.com/madduci/springdoc-springboot-bug

The bug occurs with Java 17 and Java 21 on Windows 10 with Maven 3.9.6

@nvervelle
Copy link
Author

Hi @bnasslahsen . Can the issue be reopened as an example as been provided demonstrating the problem ?

@bnasslahsen
Copy link
Contributor

@nvervelle,

The issue is not reproducible:
image

@nvervelle
Copy link
Author

nvervelle commented Apr 2, 2024

@bnasslahsen

Argh, you mean with the provided sample, you do not reproduce ?
Can you tell me on which OS you tested ? On my side, the problem occurs on Linux (Ubuntu for my development computer, oracle java image for production). Built with gradle, JDK 20, spring boot 3.2

@madduci
Copy link

madduci commented Apr 2, 2024

@nvervelle,

The issue is not reproducible: image

interesting. What is your environment (OS / Maven / JDK version)?

I can consistently reproduce the error on my Windows 10 machine

@bnasslahsen
Copy link
Contributor

image

@nvervelle
Copy link
Author

nvervelle commented Apr 2, 2024

@bnasslahsen , given the differences depending on the OS in the posts above, we tested with our own application, running on docker compose locally, wth springdoc 2.4.0 :

  • I'm on Linux Ubuntu : the swagger ui fails to display (it was working on springdoc 2.3.0)
  • A colleague of mine is on Mac OS X (M1/ARM) : the swagger ui displays correctly

Do you have the ability to test on Linux or Windows ?

@bnasslahsen
Copy link
Contributor

@nvervelle,

It's all deployed on Linux https://springdoc.org/#demos

@nvervelle
Copy link
Author

OK 🤔

@madduci
Copy link

madduci commented Apr 3, 2024

Update: with the 2.5.0 Version, it works for me again! Thank you @bnasslahsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants