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

Deploy goal fails (hangs) when using non-default output directory (e.g. with MicroProfile starter config), e.g. running dev mode after server is killed. #1536

Closed
scottkurz opened this issue May 26, 2022 · 7 comments
Labels

Comments

@scottkurz
Copy link
Member

scottkurz commented May 26, 2022

On v3.5.1, with config like that generated by the MP starter:

          <plugin>
            <groupId>io.openliberty.tools</groupId>
            <artifactId>liberty-maven-plugin</artifactId>
            <version>${openliberty.maven.version}</version>
            <executions>
              <execution>
                <id>package-server</id>
                <phase>package</phase>
                <goals>
                  <goal>create</goal>
                  <goal>install-feature</goal>
                  <goal>deploy</goal>
                  <goal>package</goal>
                </goals>
                <configuration>
                  <outputDirectory>target/wlp-package</outputDirectory>
                </configuration>
              </execution>
            </executions>

the app deploy fails. It hangs with repeated messages:

[INFO] CWWKM2013I: The file ....\target\wlp-package\demo\logs\messages.log being validated does not exist.

In trying to recreate I was confused why it wasn't happening more consistently.

As it turns out, in DeployMojoSupport.java we do a check

    protected void verifyAppStarted(String appFile) throws MojoExecutionException {
        if (shouldValidateAppStart()) {

and we only bother validating the app started message if the server is already up and running, which it won't be typically when running dev mode (unless it was brought down abruptly).

RECREATE

So to sum it up, to recreate:

  1. gen from MP starter using above config
  2. mvn liberty:dev
  3. Add some dummy LMP config to force a redeploy, e.g.
             <configuration>
                  <outputDirectory>target/wlp-package</outputDirectory>
                  <dummy>dummy</dummy>
                </configuration> 

As a separate issue I wonder why the MicroProfile starter is using non-default output dir. Will look into that separately.

@Emily-Jiang
Copy link
Member

@scottkurz what is the default output dir?

@cherylking
Copy link
Member

cherylking commented May 26, 2022

@Emily-Jiang According to this Liberty doc, it is the server dir. And according to LMP doc, for the package goal and install-feature goal, it is the ${project.build.directory}/liberty-alt-output-dir dir. The rest of the LMP goals would default to the WLP_OUTPUT_DIR.

@cherylking
Copy link
Member

See this Liberty doc for details on the WLP_OUTPUT_DIR default.

@Emily-Jiang
Copy link
Member

@Emily-Jiang According to this Liberty doc, it is the server dir. And according to LMP doc, for the package goal and install-feature goal, it is the ${project.build.directory}/liberty-alt-output-dir dir. The rest of the LMP goals would default to the WLP_OUTPUT_DIR.

Thanks @cherylking for the explanation! It is allowed not to use the default dir, right? My point is that the MP starter configuration should work though. By the way, I created the pom.xml in MP Starter and I specified it so that I know where to find the output.

@cherylking
Copy link
Member

@Emily-Jiang Right, it should work to specify it, but Scott was just questioning why the default was not used by the starter.

@scottkurz scottkurz changed the title Deploy goal fails (hangs) when using non-default output directory (e.g. with MicroProfile starter config) Deploy goal fails (hangs) when using non-default output directory (e.g. with MicroProfile starter config), e.g. running dev mode after server is killed. Dec 9, 2022
@scottkurz
Copy link
Member Author

Just tacked on the "after server is killed" to the issue title... in dev mode we'd rarely need to deploy against a started server, so the most likely way to hit this in dev mode is if the server wasn't stopped cleanly.

@scottkurz
Copy link
Member Author

I'm going to close this issue. Now that we understand it better, it's clearer to view the breakdown we get in the other, separate issues:

  1. Logging to non-default outputDirectory doesn't work in dev mode - In dev mode, non-dflt <outputDirectory> config doesn't result in logs/workarea in this location, and also breaks hot code replace #1684
  2. Problem w/ deploy after server killed - Failure to deploy (CWWKM2011E, CWWKM2187E) when executing 'run' or 'dev', after server is killed without app starting successfully #1696
  3. Desire to fix the MP starter to avoid the first problem here: Remove outputDirectory from liberty-maven-plugin config eclipse/microprofile-starter#484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants