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

Production: Deployment to Heroku failed #126

Closed
oopsaleem opened this issue Jul 22, 2020 · 19 comments · Fixed by #128
Closed

Production: Deployment to Heroku failed #126

oopsaleem opened this issue Jul 22, 2020 · 19 comments · Fixed by #128
Assignees
Labels
bug 🐞 Something isn't working Generator Issues related to generator

Comments

@oopsaleem
Copy link

Deployment to Heroku failed

[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar (480 kB at 3.9 MB/s) [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message: You are running an incompatible version of Java. JHipster supports JDK 8 to 12. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:05 min [INFO] Finished at: 2020-07-22T14:56:01Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) on project handled: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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 ! ERROR: Failed to build app with Maven We're sorry this build is failing! If you can't find the issue in application code, please submit a ticket so we can help: https://help.heroku.com/ ! Push rejected, failed to compile Java app. ! Push failed

Reproduce the error

create app with default options, database postgresql.

@atomfrede
Copy link
Member

Which version are you using? How do you call the heroku command? I did it yesterday multiple times.

@oopsaleem
Copy link
Author

Jhipster v 6.10.1
Created the app using the command:
jhipster --blueprints micronaut
Deployment command:
jhipster heroku

@atomfrede
Copy link
Member

Can you try mhipster heroku please?

@oopsaleem
Copy link
Author

I tried using the mhipster heroku dosn't work.
Even created new project from scratch using mhipster but got system crashed.

2020-07-22T17:42:04.395686+00:00 heroku[web.1]: State changed from starting to crashed 2020-07-22T17:42:04.397759+00:00 heroku[web.1]: State changed from crashed to starting 2020-07-22T17:42:10.523144+00:00 heroku[web.1]: Starting process with command java $JAVA_OPTS -Xmx128m -Dmicronaut.env.deduction=false -Dmicronaut.environments=prod,cloud,no-liquibase,heroku -Dmicronaut.server.port=$port -jar target/*.jar 2020-07-22T17:42:13.070807+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them. 2020-07-22T17:42:13.075293+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 2020-07-22T17:42:13.249900+00:00 app[web.1]: no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar 2020-07-22T17:42:13.301939+00:00 heroku[web.1]: Process exited with status 1 2020-07-22T17:42:13.346831+00:00 heroku[web.1]: State changed from starting to crashed

@atomfrede
Copy link
Member

I will try to reproduce it. So you have some more logs why it crashed?

@atomfrede atomfrede added bug 🐞 Something isn't working Generator Issues related to generator labels Jul 22, 2020
@oopsaleem
Copy link
Author

-----> Java app detected
-----> Installing JDK 14... done
-----> Executing Maven
$ ./mvnw -Pprod,heroku -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.gelowb:revertback:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-checkstyle-plugin is missing. @ line 514, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------------< com.gelowb:revertback >------------------------
[INFO] Building Revertback 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ revertback ---
[INFO]
[INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ revertback ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (default-resources) @ revertback ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 21 resources
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ revertback ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 21 resources
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ revertback ---
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
You are running an incompatible version of Java. JHipster supports JDK 8 to 12.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.896 s
[INFO] Finished at: 2020-07-22T17:48:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) on project revertback: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed

@oopsaleem
Copy link
Author

2020-07-22T18:09:20.636926+00:00 app[web.1]: no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar
2020-07-22T18:09:20.698015+00:00 heroku[web.1]: Process exited with status 1
2020-07-22T18:09:20.743819+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-22T19:17:28.538138+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-22T19:17:36.079683+00:00 heroku[web.1]: Starting process with command java $JAVA_OPTS -Xmx128m -Dmicronaut.env.deduction=false -Dmicronaut.environments=prod,cloud,no-liquibase,heroku -Dmicronaut.server.port=$port -jar target/*.jar
2020-07-22T19:17:38.522970+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-07-22T19:17:38.528756+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-07-22T19:17:38.748879+00:00 app[web.1]: no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar
2020-07-22T19:17:39.358612+00:00 heroku[web.1]: Process exited with status 1
2020-07-22T19:17:39.411453+00:00 heroku[web.1]: State changed from starting to crashed
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2020-07-22T18:09:20.636926+00:00 app[web.1]: no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar
2020-07-22T18:09:20.698015+00:00 heroku[web.1]: Process exited with status 1
2020-07-22T18:09:20.743819+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-22T19:17:28.538138+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-22T19:17:36.079683+00:00 heroku[web.1]: Starting process with command java $JAVA_OPTS -Xmx128m -Dmicronaut.env.deduction=false -Dmicronaut.environments=prod,cloud,no-liquibase,heroku -Dmicronaut.server.port=$port -jar target/*.jar
2020-07-22T19:17:38.522970+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-07-22T19:17:38.528756+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-07-22T19:17:38.748879+00:00 app[web.1]: no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar
2020-07-22T19:17:39.358612+00:00 heroku[web.1]: Process exited with status 1
2020-07-22T19:17:39.411453+00:00 heroku[web.1]: State changed from starting to crashed

@atomfrede
Copy link
Member

I see its Installing JDK 14... done. Did you select it? Maybe the micronaut check does not yet take jdk >12 into account.

@atomfrede
Copy link
Member

Yes, I see. In the main generator we have

 <requireJavaVersion>
   <message>You are running an incompatible version of Java. JHipster supports JDK 8 to 14.</message>
    <version>[1.8,15)</version>
</requireJavaVersion>

in micronaut only

<requireJavaVersion>
     <message>You are running an incompatible version of Java. JHipster supports JDK 8 to 12.</message>
     <version>[1.8,13)</version>
</requireJavaVersion>

And the heroku sub gen does not overwrite the jdk selection. I guess micronaut supports jdk 14 too, so I would suggest to adapt the pom accordingly. @oopsaleem Can you try changing the pom with [1.8,15)?

@atomfrede
Copy link
Member

I will open a new issue for that.

@oopsaleem
Copy link
Author

oopsaleem commented Jul 23, 2020

I see its Installing JDK 14... done. Did you select it? Maybe the micronaut check does not yet take jdk >12 into account.

HI @atomfrede , No I didn't select it, as mentioned i went with the default choices.
Moreover, I have another attempt to changing the system.properties & .yo-rc.json to use java 11. but in vain.

@atomfrede
Copy link
Member

That is strange. The default for the heroku java version should still be 11.

@oopsaleem
Copy link
Author

Yes, I see. In the main generator we have

 <requireJavaVersion>
   <message>You are running an incompatible version of Java. JHipster supports JDK 8 to 14.</message>
    <version>[1.8,15)</version>
</requireJavaVersion>

in micronaut only

<requireJavaVersion>
     <message>You are running an incompatible version of Java. JHipster supports JDK 8 to 12.</message>
     <version>[1.8,13)</version>
</requireJavaVersion>

And the heroku sub gen does not overwrite the jdk selection. I guess micronaut supports jdk 14 too, so I would suggest to adapt the pom accordingly. @oopsaleem Can you try changing the pom with [1.8,15)?

I changed the <requireJavaVersion> and gave it a go, yet issue persist.
image

@atomfrede
Copy link
Member

atomfrede commented Jul 23, 2020

But it now builds, so the build failure is gone. Can you provide an example application? Does heroku logs --tail give you some more logs why the app crashed?

@oopsaleem
Copy link
Author

But it now builds, so the build failure is gone. Can you provide an example application? Does heroku logs --tail give you some more logs why the app crashed?

Actually, build failure was gone when i used mhipster instead of jhipster

below is the heroku logs --tail
heroku-logs-tail.txt

you can find the example app here

@atomfrede
Copy link
Member

Thanks.

@atomfrede
Copy link
Member

atomfrede commented Jul 23, 2020

I think I can see the issue, but I have no idea why its happening. no main manifest attribute, in target/original-revertback-0.0.1-SNAPSHOT.jar. Need to check when back on my machine. It is not suppose to select the original- jar I think

As a workaround you can try setting target/revertback-0.0.1-SNAPSHOT.jar in your procfile instead of *.jar

@atomfrede
Copy link
Member

🤦 I think we have the same problem with the main generator as soon as the application name comes after o. I usually test with something link jhxy or mhipsterxy which are both before o. Will provide a fix such that is uses the application name in the procfile if possible.

@learnwithparth
Copy link

Comment out following.

You are running an incompatible version of Java. JHipster supports JDK 8 to 15. [1.8,16)

It worked for me ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working Generator Issues related to generator
Projects
None yet
3 participants