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

remote-dev: LiveReloadConfig is not always properly initialized #12571

Closed
aloubyansky opened this issue Oct 7, 2020 · 11 comments
Closed

remote-dev: LiveReloadConfig is not always properly initialized #12571

aloubyansky opened this issue Oct 7, 2020 · 11 comments
Assignees
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@aloubyansky
Copy link
Member

Adding and removing

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
    </dependency>

to the POM of a simple REST endpoint project running in remote-dev mode may sometimes fail with

2020-10-07 09:20:38,484 ERROR [io.qua.dep.dev.IsolatedRemoteDevModeMain] (main) Failed to generate Quarkus application: java.lang.RuntimeException: remote-dev can only be used with mutable applications generated with the fast-jar format
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.generateApplication(IsolatedRemoteDevModeMain.java:91)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:199)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:51)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)

2020-10-07 09:20:38,485 WARN  [io.qua.ver.htt.dep.dev.HttpRemoteDevClientProvider] (main) Live reload URL set but no password, remote dev requires a password, set quarkus.live-reload.password on both server and client
2020-10-07 09:20:38,486 ERROR [io.qua.dep.dev.DevModeMain] (main) Quarkus dev mode failed to start: java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: No value present
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:132)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: java.lang.RuntimeException: java.util.NoSuchElementException: No value present
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:221)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:51)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
        ... 3 more
Caused by: java.util.NoSuchElementException: No value present
        at java.base/java.util.Optional.get(Optional.java:148)
        at io.quarkus.vertx.http.deployment.devmode.HttpRemoteDevClientProvider.getClient(HttpRemoteDevClientProvider.java:34)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.createClient(IsolatedRemoteDevModeMain.java:72)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:205)
        ... 5 more

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: No value present
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:150)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: No value present
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:132)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
        ... 1 more
Caused by: java.lang.RuntimeException: java.util.NoSuchElementException: No value present
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:221)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:51)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
        ... 3 more
Caused by: java.util.NoSuchElementException: No value present
        at java.base/java.util.Optional.get(Optional.java:148)
        at io.quarkus.vertx.http.deployment.devmode.HttpRemoteDevClientProvider.getClient(HttpRemoteDevClientProvider.java:34)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.createClient(IsolatedRemoteDevModeMain.java:72)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:205)
        ... 5 more

FYI @stuartwdouglas

@aloubyansky aloubyansky added the kind/bug Something isn't working label Oct 7, 2020
@aloubyansky
Copy link
Member Author

aloubyansky commented Oct 7, 2020

Sometimes I also see

2020-10-07 10:28:06,108 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 975ms
2020-10-07 10:28:06,110 ERROR [io.qua.dep.dev.IsolatedRemoteDevModeMain] (main) Failed to generate Quarkus application: java.lang.RuntimeException: remote-dev can only be used with mutable applications generated with the fast-jar format
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.generateApplication(IsolatedRemoteDevModeMain.java:91)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:199)
        at io.quarkus.deployment.dev.IsolatedRemoteDevModeMain.accept(IsolatedRemoteDevModeMain.java:51)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)

which looks like the same lost app properties issue.

@stuartwdouglas
Copy link
Member

I have not been able to reproduce this. It looks like the config is going missing somehow.

#12931 helps with one of the reported stack traces.

@aloubyansky
Copy link
Member Author

Just curious how were you testing this? I was using minikube.

@aloubyansky
Copy link
Member Author

aloubyansky commented Oct 26, 2020

Ah, it looks like I can reproduce it only when editing the pom.xml in the IDE. Editing in a text editor doesn't seem cause this error. So it looks like it's related to the IDE copying/cleaning the resources dir.

@aloubyansky
Copy link
Member Author

Yes, if I disable automatic build in the IDE I can't reproduce it. That makes sense. Didn't think of it originally. Not sure we can do much here. I am closing it for now.

@aloubyansky
Copy link
Member Author

This IDE building issue is actually not limited to the POM, I guess. So it probably has to be a general recommendation to turn off automatic building for the remote-dev.

@stuartwdouglas
Copy link
Member

There probably is something I can do here. Do you know what exactly is broken by the automatic build?

@aloubyansky
Copy link
Member Author

All I can say atm is it looked like the application.properties was not always present.

@aloubyansky
Copy link
Member Author

I guess in the output directory. If we always looked at the source dir instead in dev mode then we probably would avoid this issue.

@aloubyansky
Copy link
Member Author

Then resource filtering wouldn't be applied. At least on the first build.

@stuartwdouglas
Copy link
Member

After thinking about it a bit I guess there is not much we can do.

@gsmet gsmet added this to the 1.10 - master milestone Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants