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

Corrupt image assets after adding AWS Lambda extension #702

Open
rrowlands opened this issue Jun 20, 2024 · 6 comments
Open

Corrupt image assets after adding AWS Lambda extension #702

rrowlands opened this issue Jun 20, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rrowlands
Copy link

rrowlands commented Jun 20, 2024

Hi all,

Apologies in advance, I realize this will be a weird question. At the moment I'm having issues with quarkus builds in my Angular Quinoa project where I'm able to serve up images just fine if I do an 'ng serve', but once the images get included into the quarkus build (with either 'quarkus dev' or 'quarkus build') they come out jumbled and are not able to be viewed. I've experimented a little bit with looking at the files coming from the dev server and it appears as if the binary is getting corrupted. It almost looks to me like quote characters in the binary file are being replaced with something else, since vim renders the binary as quotes in the original source image, but it renders only that binary as a question mark in the image served from quarkus dev, so the file quarkus is serving differs in its binary content but only very slightly and only very specific sections of the binary output are being slightly changed.

Just as a random shot in the dark, does this make any sort of sense to any experienced quarkus devs out there? Maybe I have turned on some sort of character escape filter for quarkus assets or something that I don't know about?

The weird thing is that whatever is happening I am able to render text assets (html, css, etc.) with zero issues. It just seems to be something specific to how images are being processed. Oh it also seems to garble up fonts as well.

I'm using the latest versions of angular (18) and quarkus/quinoa (3.11.3 / 2.3.10) and I don't have any sort of weird custom pre / post processors set up or anything weird like that (other than Lombok, but that's on the Java side).

Thanks

@melloware
Copy link
Contributor

weird nothing that i am aware of. Can you put together a minimal reproducer?

@melloware melloware added the needs triage Issue needs triaging label Jun 20, 2024
@rrowlands
Copy link
Author

The error starts happening once you add the quarkus lambda http support to the project. I reproduced it pretty easily with the following:

quarkus create app quinoa-app -x=io.quarkiverse.quinoa:quarkus-quinoa && cd quinoa-app

quarkus ext add io.quarkus:quarkus-amazon-lambda-http

wget https://assets.bonappetit.com/photos/58dbf6c8a6614f6f50816994/16:9/w_2560%2Cc_limit/20170323%2520MOB6231_FINAL_crop.jpg -O src/main/webui/public/strawberry.jpg

quarkus dev

From a web browser hit:
http://localhost:8080/strawberry.jpg

Firefox returns:
The image “http://localhost:8080/strawberry.jpg” cannot be displayed because it contains errors.

Chrome displays a blank page

If you perform the exact same steps but you don't import the lambda extension it works just fine.

@melloware
Copy link
Contributor

Excellent debugging and thanks for the reproducer.

@melloware melloware added bug Something isn't working and removed needs triage Issue needs triaging labels Jun 21, 2024
@melloware
Copy link
Contributor

@rrowlands it looks like AWS Lambda extensions the way it is designed wreaks havoc with serving other resources see this ticket: quarkusio/quarkus#34285

I have a feeling that issue is similar to what we are seeing.

@melloware melloware changed the title Issue with image assets Issue with image assets after adding AWS Lambda extension Jun 21, 2024
@melloware melloware changed the title Issue with image assets after adding AWS Lambda extension Corrupt image assets after adding AWS Lambda extension Jun 21, 2024
@rrowlands
Copy link
Author

rrowlands commented Jun 21, 2024

I don't think it's related to the dev ui since I deployed this onto lambda (from a quarkus build) and it scrambles images just the same.

@melloware
Copy link
Contributor

@rrowlands no i mean something with Lamdba is intercepting HTTP requests and breaking things like it does for the Dev UI. Quinoa is similar in that its "forwarding" HTTP requests etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants