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

Accessing DevConsole fails with InternalServerError in the current snapshot #18413

Closed
sberyozkin opened this issue Jul 5, 2021 · 8 comments · Fixed by #18416
Closed

Accessing DevConsole fails with InternalServerError in the current snapshot #18413

sberyozkin opened this issue Jul 5, 2021 · 8 comments · Fixed by #18416
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@sberyozkin
Copy link
Member

sberyozkin commented Jul 5, 2021

Describe the bug

Starting the quickstarts (I've tried security-openid-connect-quickstart followed by getting-started) with mvn quarkus:dev and then accessing the console from the browser at localhost:8080/q/dev fails with:

io.quarkus.qute.TemplateException: Property "currentExtensionName" not found in expression {currentExtensionName} in template main on line 25
	at io.quarkus.qute.EvaluatorImpl.propertyNotFound(EvaluatorImpl.java:207)
        ...
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderAsync(TemplateImpl.java:90)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.renderTemplate(DevConsole.java:134)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.sendMainPage(DevConsole.java:178)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:97)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:34)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1127)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:151)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:201)
	at io.quarkus.vertx.http.deployment.devmode.console.FlashScopeHandler.handle(FlashScopeHandler.java:12)
	at io.quarkus.vertx.http.deployment.devmode.console.FlashScopeHandler.handle(FlashScopeHandler.java:7)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1127)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:151)
	...
	at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:195)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:192)
	at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:49)
	at io.vertx.core.impl.EventLoopContext.lambda$emit$1(EventLoopContext.java:56)

CC @stuartwdouglas @phillip-kruger

@sberyozkin sberyozkin added the kind/bug Something isn't working label Jul 5, 2021
@sberyozkin sberyozkin changed the title Accessing DevConsole fails with InternalserverError in the current snapshot Accessing DevConsole fails with InternalServerError in the current snapshot Jul 5, 2021
@gastaldi
Copy link
Contributor

gastaldi commented Jul 5, 2021

This may be caused by #18227, I think the quickstarts need to be updated accordingly? /cc @mkouba

@sberyozkin
Copy link
Member Author

sberyozkin commented Jul 5, 2021

It is probably the DevServices console code in Quarkus which should pass io.quarkus.qute.strict-rendering=false to Qute;

Or maybe the fact it is rendered async is what causes the problem ?

@phillip-kruger
Copy link
Member

If no-one else is looking at this, I can have a look.

@phillip-kruger
Copy link
Member

Adding strictRendering(false) fix it. Not sure if that is the correct fix. I'll do a PR and we can discuss there ?

@mkouba
Copy link
Contributor

mkouba commented Jul 7, 2021

Ok, so the problem is that the data map has no key of value currentExtensionName. We only add this to the data for non-main templates: https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsole.java#L111. Like I mentioned in #18416 (comment) it wouldn't be a problem if it was null.

So there are several ways how to fix this:

  1. add .data("currentExtensionName", null) even for the main page,
  2. disable strict rendering,
  3. modify the {#if currentExtensionName} to something like:
    a. {#if containsKey('currentExtensionName')} -> this would work because the root data object is a map
    b. {#if currentExtensionName.or(false)} -> this would return false for "not found" and null values

@phillip-kruger
Copy link
Member

@mkouba what do you suggest ?

@mkouba
Copy link
Contributor

mkouba commented Jul 7, 2021

Well, the option 1 is quick but fixes only the problem with the main template. Option 2 is a safe one because we don't have tests for all DEV UI pages and more of them could be broken. On the other hand, option 2 is a bit short-sighted. Option 3 is a bit cumbersome. I think that for now we should go with option 2.

I will create a separate issue to verify all DEV UI templates and possibly switch to strict rendering afterwards.

BTW I think that we should definitely improve the error message for this particular case (i.e. data map is missig a binding) and provide something less cumbersome to check the "not found" value in the {#if} section.

@phillip-kruger
Copy link
Member

So we should merge #18416 (option 2) for now ?

@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants