quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.63k stars 2.64k forks source link

Images not served with quarkus-amazon-lambda-http #27080

Open faermanj opened 2 years ago

faermanj commented 2 years ago

Describe the bug

When using quarkus-amazon-lambda-http, it seems that images are not served properly, even though http requests are successful. To reproduce this issue, i copied the "multiverse" template from html5up.net to a simple quarkus app: multiverse test case

After deploying to lambda on JVM, using the documented steps (sam deploy), all requests are 200 OK and the web page is returned. However, instead of the images, present in the package, transparent squares are returned. This happens both with HTTP API and FunctionURL, any browser.

However, using curl there's an error indication ("Mark bundle as not supporting multiuse"), as follows:

curl -sv https://rkxmglva65ory7tiequfabnxkq0mbbql.lambda-url.ap-northeast-1.on.aws/images/thumbs/04.jpg --output 04.jpg
...
*  SSL certificate verify ok.
} [5 bytes data]
> GET /images/thumbs/^C.jpg HTTP/1.1
> Host: rkxmglva65ory7tiequfabnxkq0mbbql.lambda-url.ap-northeast-1.on.aws
> User-Agent: curl/7.68.0
> Accept: */*
> 
{ [5 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Date: Tue, 02 Aug 2022 08:52:36 GMT
< Content-Length: 0
< Connection: keep-alive
< 
* Connection #0 to host rkxmglva65ory7tiequfabnxkq0mbbql.lambda-url.ap-northeast-1.on.aws left intact

Expected behavior

The images and static resources were expected to be served.

Actual behavior

The connection seems to transfer only the first bytes and error

How to Reproduce?

Deploy any HTTP API with static images, or use the example: https://github.com/CaravanaCloud/aws-pod/tree/main/src/demo-multiverse

Output of uname -a or ver

Linux caravanacloud-awspod-6a3i88ckha7 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.11.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

quarkus-bot[bot] commented 2 years ago

/cc @matejvasek, @patriot1burke

tonywestonuk commented 1 year ago

I see this bug also... Its reproducible in dev mode.

When quarkus-amazon-lambda-http is added to pom, images are no longer served.

When quarkus-amazon-lambda-rest is added, images served ok.

tonywestonuk commented 1 year ago

Tagging you in again @matejvasek , @patriot1burke as this bug pretty much is a show stopper for deploying Quarkus websites to amazon lambda , using quarkus-amazon-lambda-http