Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Quarkus CLI version 999-SNAPSHOT fails to update applications on Windows #46639

Open
michalvavrik opened this issue Mar 5, 2025 · 10 comments
Open
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) env/windows Impacts Windows machines kind/bug Something isn't working

Comments

@michalvavrik
Copy link
Member

Describe the bug

I use Quarkus CLI to update my applications, on Windows, my applications can't be updated with Quarkus CLI v999-SNAPSHOT, but it works with other Quarkus CLI versions like 3.19.1. Applications seems to be updated, but whole process fails anyway. See also #46308.

Expected behavior

No failures, no errors, same as with older Quarkus CLI versions.

Actual behavior

Update results in following failure:

PS C:\cygwin\home\hudson\app> C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat update
[INFO] Error stacktraces are turned on. 
[INFO] Scanning for projects... 
[INFO]  
[INFO] ----------------------------< org.acme:app >----------------------------
[INFO] Building app 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus:999-SNAPSHOT:update (default-cli) @ app ---
[WARNING] quarkus:update goal is experimental, its options and output might change in future versions 
[INFO] Looking for the newly published extensions in registry.quarkus.io 
[INFO] Detected project Java version: 21 
[INFO]  
[INFO] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO]
[INFO] Suggested Quarkus platform BOM updates:
[INFO]  ~       io.quarkus.platform:quarkus-bom:pom:[3.15.3.1 -> 3.19.1]
[INFO]
[INFO] Suggested extensions updates for 'io.quarkus.platform:quarkus-bom':
[INFO]  v       io.quarkus:quarkus-arc (synced with BOM)
[INFO]  v       io.quarkus:quarkus-rest (synced with BOM)
[INFO]
[INFO]
[INFO] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO]
[INFO]
[INFO] Resolving recipes from 'io.quarkus:quarkus-update-recipes':
[INFO] * matching recipes directory 'core' found: 
[INFO]     - '3.18.alpha1.yaml' (3.15.3.1 -> 3.19.1)
[INFO]     - '3.19.alpha1.yaml' (3.15.3.1 -> 3.19.1)
[INFO] => 2 specific recipe(s) found
[INFO]  
[INFO] We have generated a recipe file to update your project (versions updates + specific recipes):
[INFO] target\rewrite\rewrite.yaml
[INFO] 

Do you want run the generated update recipe with OpenRewrite ? ([y]es, [n]o, [d]ry-run)

y 
[INFO] Running recipe with OpenRewrite 6.2.0... 
[INFO]
[INFO]  
[INFO]
[INFO]
[INFO]  ------------------------------------------------------------------------
[INFO] Executing (this may take a while):
C:\cygwin\home\hudson\app\mvnw.cmd -B -e org.openrewrite.maven:rewrite-maven-plugin:6.2.0:run -Drewrite.plainTextMasks=**/*.adoc,**/src/test/resources/__snapshots__/**/*.java,**/*.kt,*
*/*.md,**/src/main/codestarts/**/*.java,**/*.txt,**/META-INF/services/** -Drewrite.configLocation=C:\cygwin\home\hudson\app\target\rewrite\rewrite.yaml -Drewrite.recipeArtifactCoordina
tes=io.quarkus:quarkus-update-recipes:1.2.0 -Drewrite.activeRecipes=io.quarkus.openrewrite.Quarkus -Drewrite.pomCacheEnabled=false
[INFO]
[INFO] Rewrite process completed. Logs can be found at: target\rewrite\rewrite.log 
[INFO]  
[INFO]  
[INFO]
[INFO]
[INFO]  ------------------------------------------------------------------------
[INFO] Executing (this may take a while):
C:\cygwin\home\hudson\app\mvnw.cmd -B clean process-sources
[INFO]
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  59.790 s
[INFO] Finished at: 2025-03-05T17:59:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:update (default-cli) on project app: The command to update the project exited with an errorLogs can be found
 at: target\rewrite\rewrite.log -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:update (default-cli) on project app: The command to update t
he project exited with an errorLogs can be found at: target\rewrite\rewrite.log
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101) 
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
PS C:\cygwin\home\hudson\app>

How to Reproduce?

Steps to reproduce the behavior:

# use PowerShell to prepare Quarkus CLI v 999-SNAPSHOT
$quarkusCliFileContent = @"
@ECHO OFF
java -jar c:\\users\\hudson\\.m2\\repository\\io\\quarkus\\quarkus-cli\\999-SNAPSHOT\\quarkus-cli-999-SNAPSHOT-runner.jar %*
"@
New-Item -Path "$(pwd)\quarkus-dev-cli.bat" -ItemType File
Set-Content -Path "$(pwd)\quarkus-dev-cli.bat" -Value $quarkusCliFileContent
./quarkus-dev-cli.bat version

# now run tests

# attempt 1 - fails
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat create app app --stream=3.2
cd app
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat update -y --stream=3.15

# attempt 2 - fails
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat create app app --stream=3.15
cd app
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat update -y

# attempt 3 - fails
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat create app app --stream=3.15
cd app
C:\cygwin\home\hudson\quarkus-test-suite\quarkus-dev-cli.bat update

# Quarkus CLI 3.19.1 -> pass
quarkus create app app --stream=3.2
cd app
quarkus update --stream=3.15

Or you can see failures if you use the jar directly:

java -jar c:\\users\\hudson\\.m2\\repository\\io\\quarkus\\quarkus-cli\\999-SNAPSHOT\\quarkus-cli-999-SNAPSHOT-runner.jar create app app --stream=3.15

java -jar c:\\users\\hudson\\.m2\\repository\\io\\quarkus\\quarkus-cli\\999-SNAPSHOT\\quarkus-cli-999-SNAPSHOT-runner.jar update

Output of uname -a or ver

Windows Server 2019, Microsoft Windows Server 2022

Output of java -version

Temurin 21

Quarkus version or git rev

999-SNAPSHOT

Build tool (ie. output of mvnw --version or gradlew --version)

Maven 3.9.9

Additional information

cc @ia3andy

@michalvavrik michalvavrik added area/cli Related to quarkus cli (not maven/gradle/etc.) kind/bug Something isn't working labels Mar 5, 2025
@quarkus-bot quarkus-bot bot added the env/windows Impacts Windows machines label Mar 5, 2025
Copy link

quarkus-bot bot commented Mar 5, 2025

/cc @ebullient (cli), @maxandersen (cli)

@gsmet
Copy link
Member

gsmet commented Mar 5, 2025

Do you have something useful in target\rewrite\rewrite.log?

@michalvavrik
Copy link
Member Author

Do you have something useful in target\rewrite\rewrite.log?

I have already deleted OpenStack instance before I realized that I should add that. But no, IMHO it wasn't useful at all, it was Maven log that run mvnw.cmd -B clean process-sources and said that execution failed and if you want more info add -v or -X (I think, maybe not remembering these options right), but how can I add these options when it is run by OpenRewrite?

@michalvavrik
Copy link
Member Author

I can create a new instance tomorrow and re-run it, but IMO you will just see it when you try it and it can't be fixed without trying it so... anyway, if you want it, let me know.

@gsmet
Copy link
Member

gsmet commented Mar 6, 2025

Your best bet is to adjust:

private static List<String> getMavenProcessSourcesCommand(String mvnBinary) {
List<String> command = new ArrayList<>();
command.add(mvnBinary);
command.add("-B");
command.add("clean");
command.add("process-sources");
final String mavenSettings = getMavenSettingsArg();
if (mavenSettings != null) {
command.add("-s");
command.add(mavenSettings);
}
return command;
}
.

From what I can see, the only way to get this error is to have the command failing so I think we need to get more information to undestand why it's suddenly failing.

@ia3andy
Copy link
Contributor

ia3andy commented Mar 6, 2025

I am preping a PR to:

  • fix the typo missing a space
  • fix the logging for process-resources which should be different
  • add the -X option to the commands

Then you can give it another try.

@michalvavrik
Copy link
Member Author

Sounds good @gsmet @ia3andy , I'll wait until the PR gets in and give it another try. For anyone with a red hat, I can also provide a way to reproduce it yourself :-) (use slack)

@ia3andy
Copy link
Contributor

ia3andy commented Mar 6, 2025

Ok: #46653

@rsvoboda
Copy link
Member

rsvoboda commented Mar 6, 2025

add the -X option to the commands

Isn't -X too much? Or it's just a PR for Michal to experiment with?

@rsvoboda
Copy link
Member

rsvoboda commented Mar 6, 2025

It would be also very good to have a Windows machine(s) for upstream experiments :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants