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

Error Pages cache too much #11447

Closed
sdelamo opened this issue Dec 16, 2024 · 0 comments · Fixed by #11448
Closed

Error Pages cache too much #11447

sdelamo opened this issue Dec 16, 2024 · 0 comments · Fixed by #11448
Assignees
Labels
status: in progress type: bug Something isn't working

Comments

@sdelamo
Copy link
Contributor

sdelamo commented Dec 16, 2024

Issue description

Vytas

I just upgraded to latest micronaut version, and now 400 and 404 errors have a blue background. I am not sure why, and errors for parameters are beeing cached somehow, if I have api that requires params a and b, and I do not supply any arguments, I will get error saying "Required argument [a] not specified" but then even if I fill a, it will still say same, but it actually should complain about param [b].. is there a way to turn off this feature?

Sergio del Amo — Yesterday at 14:18

I don’t think they are cached. Do you have a reproducer.
They errors are displayed in a nice HTML page only If the response accepts HTML
Why? Because it is a best user experience when accessing in the browser than the previous default

Vytas — Yesterday at 14:20

I can do a quick test with new repo to see if I can reproduce, are there any templates to use or I just can create from micronaut launch?

Sergio del Amo — Yesterday at 14:20

This is the Pr https://github.com/micronaut-projects/micronaut-core/pull/11210/files
Yes, you can create a reproducer from stater

Vytas — Yesterday at 14:27

I just tested by creating a new app with same features as mine, created endpoint with a and b params and tryed to access it, I get error: and then if I fill inn a and refresh browser I still see same message. Something is not working.
This is url for app

curl --location --request GET 'https://launch.micronaut.io/create/default/com.error.example?lang=JAVA&build=GRADLE_KOTLIN&test=JUNIT&javaVersion=JDK_21&features=micronaut-aop&features=openapi&features=retry&features=swagger-ui&features=openapi-explorer&features=cache-caffeine&features=http-client&features=properties&features=data-jdbc&features=flyway&features=postgres&features=testcontainers&features=awaitility&features=control-panel&features=junit-params&features=micronaut-test-rest-assured&features=mockito&features=test-resources&features=langchain4j-googleai-gemini&features=management&features=micrometer-annotation&features=micrometer-prometheus&features=graalvm&features=micronaut-http-validation&features=validation&features=views-velocity&features=websocket' --output example.zip
@Get(uri="/", produces="text/plain")
    public String index(String a, String b) {
        return "Example Response";
    }

This is controller
First open this url: http://localhost:8080/example
then open this url: http://localhost:8080/example?a=a

Same error message
Something is beein cached.
Just a tip: run application with ./gradlew run

Vytas — Yesterday at 14:35

But this should be opt in feature anyways.. Most of the time even tho I develop APIs for other services to consume, when I open them in browser I want to see the same thing as another service would see it, not in pretty format, that does not help me debug issues.

Vytas — Yesterday at 14:59

I have also a finished repo with a tests that shows that its failing: https://github.com/Dalisra/exampleRepo-mnError

@sdelamo sdelamo added the type: bug Something isn't working label Dec 16, 2024
@sdelamo sdelamo self-assigned this Dec 16, 2024
@sdelamo sdelamo linked a pull request Dec 16, 2024 that will close this issue
@sdelamo sdelamo moved this to Ready for Review in 4.7.3 Release Dec 16, 2024
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in 4.7.3 Release Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in progress type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant