Приложение Spring Boot аварийно завершает работу с кодом Heroku = H10 - PullRequest
2 голосов
/ 03 ноября 2019

Я развернул приложение Springboot в приложении heroku. Приложение работало нормально довольно долго. Но теперь внезапно я получаю ошибку Code = "H10" и приложение вылетает. Сборка прошла успешно при развертывании на heroku, а также приложение работает локально.

Приложение находится в репозитории git: https://github.com/hmanoharan-12/saloncityservice

Я получаю сообщение об ошибке при отправке запроса наAPI. Например: - https://saloncityservice.herokuapp.com/getuser

Ошибка в журналах:

2019-11-03T05:56:00.133635+00:00 app[web.1]: at com.webservice.restfulservice.ServiceApplication.main(ServiceApplication.java:10) ~[classes!/:0.0.1-SNAPSHOT]
2019-11-03T05:56:00.133637+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133638+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.13364+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133641+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133642+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2019-11-03T05:56:00.133643+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2019-11-03T05:56:00.133645+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2019-11-03T05:56:00.133646+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2019-11-03T05:56:00.133651+00:00 app[web.1]: Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
2019-11-03T05:56:00.133653+00:00 app[web.1]:
2019-11-03T05:56:00.133654+00:00 app[web.1]: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
2019-11-03T05:56:00.133656+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133657+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133658+00:00 app[web.1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.13366+00:00 app[web.1]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133661+00:00 app[web.1]: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133663+00:00 app[web.1]: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133664+00:00 app[web.1]: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133666+00:00 app[web.1]: at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133667+00:00 app[web.1]: at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133668+00:00 app[web.1]: at com.mysql.cj.NativeSession.connect(NativeSession.java:150) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.13367+00:00 app[web.1]: at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:947) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133671+00:00 app[web.1]: at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:817) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133673+00:00 app[web.1]: ... 61 common frames omitted
2019-11-03T05:56:00.133675+00:00 app[web.1]: Caused by: java.net.SocketTimeoutException: connect timed out
2019-11-03T05:56:00.133676+00:00 app[web.1]: at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133678+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133679+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.13368+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133682+00:00 app[web.1]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133683+00:00 app[web.1]: at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_222-heroku]
2019-11-03T05:56:00.133684+00:00 app[web.1]: at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.13369+00:00 app[web.1]: at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
2019-11-03T05:56:00.133694+00:00 app[web.1]: ... 64 common frames omitted
2019-11-03T05:56:00.133695+00:00 app[web.1]:
2019-11-03T05:56:00.213001+00:00 app[web.1]: 2019-11-03 05:56:00.212  INFO 4 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
2019-11-03T05:56:00.213005+00:00 app[web.1]: name: default
2019-11-03T05:56:00.213006+00:00 app[web.1]: ...]
2019-11-03T05:56:00.327049+00:00 app[web.1]: 2019-11-03 05:56:00.326  INFO 4 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.11.Final}
2019-11-03T05:56:00.329135+00:00 app[web.1]: 2019-11-03 05:56:00.328  INFO 4 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2019-11-03T05:56:00.586215+00:00 app[web.1]: 2019-11-03 05:56:00.585  INFO 4 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-11-03T05:56:00.990198+00:00 app[web.1]: 2019-11-03 05:56:00.989  INFO 4 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-11-03T05:56:18.877745+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2019-11-03T05:56:18.910371+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-11-03T05:56:19.00654+00:00 heroku[web.1]: Process exited with status 137
2019-11-03T05:56:19.052964+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-03T05:56:47.774128+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/getuser" host=saloncityservice.herokuapp.com request_id=d15a28c2-0725-45de-a2e9-b41f9e3469d0 fwd="123.231.87.83" dyno= connect= service= status=503 bytes= protocol=https```

1 Ответ

0 голосов
/ 10 ноября 2019

Убедитесь, что вы передаете --server.port=$PORT, как описано в документации Heroku на Настройка порта HTTP для приложений Java

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...