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

The QueryValue annotation no longer works for micronaut version 2.2.0 apps that use the lambda runtime #754

Closed
deandelponte opened this issue Nov 24, 2020 · 4 comments · Fixed by #778
Labels
type: bug Something isn't working
Milestone

Comments

@deandelponte
Copy link

Steps to reproduce

  1. Check out the code at https://github.com/ddelponte/lambda-runtime-bug
  2. Run the app using Java 11 Amazon Corretto and the command ./gradlew run
  3. Once the app is running, in your browser go to http://localhost:8080/search?searchText=derp

Expected results

I would expect to see the parameter value pulled out of the URL and displayed in the page like Your searchText = derp

Actual results

The param value is not pulled out, instead the param key is. For example Your searchText = searchText

Interesting observations

  1. This works as expected if the runtime is switched from lambda to netty
  2. A test has been added to BookControllerSpec for this bug, but the test passes. The failure only occurs when accessing the running app through a browser. I'm using Chrome version 86.0.4240.198

Environment Information

  • Operating System: MacOs 10.15.7
  • Micronaut Version: 2.2.0
  • JDK Version: Corretto-11.0.8.10.1

Example Application

@ttzn
Copy link
Contributor

ttzn commented Nov 26, 2020

I got the same thing when using ./gradlew run. However I am unable to reproduce using SAM CLI, are you sure it also happens in AWS ?

@deandelponte
Copy link
Author

I got the same thing when using ./gradlew run. However I am unable to reproduce using SAM CLI, are you sure it also happens in AWS ?

I did not deploy to AWS because it wasn't working locally with gradle run so it wouldn't be a good experience for our developers.

How do I run it locally with SAM CLI? Thanks!

@ttzn
Copy link
Contributor

ttzn commented Dec 1, 2020

Have a look at the official installation guide. Unfortunately the process is quite involved. When you're set, unzip the attached archive somewhere and you should be able to simulate lambda execution with sam local invoke "HelloWorldFunction" -e api-event.json.

If you haven't observed this bug in AWS then I guess it's just a problem with ./gradlew run, which should be fixed with my merge request. I'd suggest you drop a little +1 so it comes to the maintainers attention.

lambda-runtime-bug-sam.zip

@deandelponte
Copy link
Author

Thanks! You rock! FYI - it looks like some checks failed on the PR

@sdelamo sdelamo added the type: bug Something isn't working label Dec 5, 2020
@sdelamo sdelamo added this to the 2.2.4 milestone Dec 5, 2020
@sdelamo sdelamo linked a pull request Dec 5, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
3 participants