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

swagger-ui endpoint not accessible in AWS Lambda #8226

Closed
pateni24 opened this issue Mar 27, 2020 · 5 comments · Fixed by #9717
Closed

swagger-ui endpoint not accessible in AWS Lambda #8226

pateni24 opened this issue Mar 27, 2020 · 5 comments · Fixed by #9717
Labels
area/amazon-lambda kind/bug Something isn't working
Milestone

Comments

@pateni24
Copy link

Describe the bug
Making a http call to /swagger-ui/ , the app fails to serve the swagger-ui files. Local Dev mode works fine.

Expected behavior
Opening /swagger-ui/ should load swagger-ui/index.html page

Actual behavior
ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-2) HTTP Request to /swagger-ui/index.html failed, error id: bea62c51-a11f-4cb4-8aba-86217c872b1d-1: io.vertx.core.file.FileSystemException: java.nio.file.NoSuchFileException: META-INF/swagger-ui-files/index.html
at io.vertx.core.file.impl.FileSystemImpl$7.perform(FileSystemImpl.java:625)
at io.vertx.core.file.impl.FileSystemImpl$7.perform(FileSystemImpl.java:613)
at io.vertx.core.file.impl.FileSystemImpl.propsBlocking(FileSystemImpl.java:162)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$getFileProps$4(StaticHandlerImpl.java:295)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.wrapInTCCLSwitch(StaticHandlerImpl.java:266)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.getFileProps(StaticHandlerImpl.java:295)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:208)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:330)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.NoSuchFileException: META-INF/swagger-ui-files/index.html
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at io.vertx.core.file.impl.FileSystemImpl$7.perform(FileSystemImpl.java:619)

To Reproduce
Steps to reproduce the behavior:

  1. Create a sample Quarkus project with Quarkus 1.3.0.final
  2. Maven Dependencies - quarkus-resteasy, resteasy-jackson, quarkus-smallrye-openapi and quarkus-amazon-lambda-http
  3. SAM template - Lambda to API gateway proxy integration
  4. Set quarkus.swagger-ui.always-include=true in application.properities
  5. Deploy the app to lambda
    6.) Try to accessing /swagger-ui/ endpoint

Configuration

# Add your application.properties here, if applicable.
quarkus.swagger-ui.always-include=true

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Output of uname -a or ver:
  • Output of java -version: java8
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.3.0.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): maven 3.6.2+

Additional context
(Add any other context about the problem here.)

@pateni24 pateni24 added the kind/bug Something isn't working label Mar 27, 2020
@quarkusbot
Copy link

/cc @patriot1burke

@geoand
Copy link
Contributor

geoand commented Mar 28, 2020

Hi,

does the same happen with a non lambda application?

@pateni24
Copy link
Author

Hi,

does the same happen with a non lambda application?

Haven't tired deploying to any actual server. But looks like lambda-http extension is somehow blocking /openapi endpoint which is being called in SwaggerBundleUI in index.html. If quarkus generates the openapi.json file in root folder during the build phase, can it just use specs instead of url ?

@patriot1burke
Copy link
Contributor

I think this is a matter that the root path is /api. Is there a way to change swagger to look at a different root path? I'll have time to look at this next week.

@pateni24
Copy link
Author

pateni24 commented May 13, 2020

I think this is a matter that the root path is /api. Is there a way to change swagger to look at a different root path? I'll have time to look at this next week.

Hello @patriot1burke , Just checking to see if you got a chance to look into this ? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/amazon-lambda kind/bug Something isn't working
Projects
None yet
5 participants