Heroku Docker春季启动映像错误503 H14 [英] Heroku docker spring boot image error 503 H14

查看:113
本文介绍了Heroku Docker春季启动映像错误503 H14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我试图将spring boot应用程序的docker映像部署到heroku中。



我有以下docker文件:

 从openjdk:8-jdk-alpine 
LABEL maintenanceer = gabigarciagar@gmail.com
音量/ tmp
COPY ./target/*.jar PetApp_Auth.jar
CMD [ java,-Xmx300m,-Xss512k,-XX:CICompilerCount = 2,-Dfile.encoding = UTF- 8,-Dspring.profiles.active = heroku,-Djava.security.egd = file:/ dev /./ urandom,-jar, / PetApp_Auth.jar]

也在我的application.properties中用于heroku个人资料的我有:

  spring.profiles.active = heroku 
server.port = $ {PORT}
server.servlet.context-path = /

然后我执行以下命令,everithig看起来不错:

  $ heroku container:push petapp-authserver -a petapp-authserver 
您的映像已成功推送。您现在可以使用 container:release命令将其释放。

$ heroku容器:释放petapp-authserver -a petapp-authserver
将图像petapp-authserver释放到petapp-authserver ...完成



heroku日志还显示该应用程序已启动,而且heroku ps
数据库连接也很完美

  $ heroku ps -a petapp-authserver 
=== petapp-authserver(免费):java -Xmx300m -Xss512k -XX:CICompilerCount\ = 2 -Dfile.encoding\ = UTF-8 -Dspring.profiles.active\ = heroku -Djava.security.egd\ = file:/ dev /./ urandom -jar /PetApp_Auth.jar(1)
petapp-authserver.1:向上2020/03/06 21:09:51 +0100(〜1m以前)

然后,当我尝试查看swagger-ui o / actuator / health时,我得到以下信息:

  2020-03- 06T20:11:58.149484 + 00:00 heroku [router]:at =错误代码= H14 desc =没有正在运行的Web进程 method = GET path = / host = petapp-authserver.herokuapp.com request_id = e88c2499-b1de -4284-a649-1d8df19ae6c0 fwd = 79.147.107.220 dyno = connect = service = status = 503字节= protocol = https 
2020-03-06T20:11:59.443315 + 00:00 heroku [router]:at =错误代码= H14 desc =没有正在运行的Web进程方法=获取路径= / favicon.ico主机= petapp-authserver.herokuapp.com request_id = 9fa4951a-365c-4b9b-bf63-94f8d6792249 fwd = 79.147.107.220 dyno = connect = service = status = 503字节= protocol = https
2020-03-06T20:12:08.185495 + 00:00 heroku [router]:at =错误代码= H14 desc =没有Web进程正在运行 method = GET path = / actuator / health host = petapp-authserver.herokuapp.com request_id = c4c3382b-43b7-494c-9259-630ce24eb8a4 fwd = 79.147.107.220 dyno = connect = service = status = 503 bytes =协议= https
2020-03-0 6T20:12:08.697245 + 00:00 heroku [router]:at =错误代码= H14 desc =没有正在运行的Web进程 method = GET path = / favicon.ico host = petapp-authserver.herokuapp.com request_id = b044b6fe-ba8d-4b3d-8c7c-8e477ea7b609 fwd = 79.147.107.220 dyno = connect = service = status = 503字节= protocol = https
2020-03-06T20:12:12.943276 + 00:00 heroku [router ]:at =错误代码= H14 desc =没有Web进程正在运行 method = GET path = / actuator / health host = petapp-authserver.herokuapp.com request_id = 6ac05b16-148d-4849-a857-c3d6bed9fe01 fwd = 79.147.107.220 dyno = connect =服务=状态= 503字节=协议= http
2020-03-06T20:12:13.637589 + 00:00 heroku [router]:at =错误代码= H14 desc =否正在运行的Web进程 method = GET path = / favicon.ico host = petapp-authserver.herokuapp.com request_id = 2c01dbaa-18c5-46f8-8f43-f91ee372a5eb fwd = 79.147.107.220 dyno = connect = service = status = 503字节=协议= http
2020-03-06T20:12:23.492570 + 00:00 heroku [router]:at =错误代码= H14 desc =没有正在运行的Web进程 method = GET pat h = / swagger-ui.html host = petapp-authserver.herokuapp.com request_id = 2850eb70-1bd5-4737-9505-d59184e95946 fwd = 79.147.107.220 dyno = connect = service =状态= 503字节=协议= http
2020-03-06T20:12:23.878827 + 00:00 heroku [router]:at =错误代码= H14 desc =没有正在运行的Web进程 method = GET path = / favicon.ico host = petapp-authserver.herokuapp.com request_id = f83acdef-840a-4e2e-824c-183cfdc50273 fwd = 79.147.107.220 dyno = connect = service = status = 503 bytes = protocol = http

heroku网站说





谢谢大家


I few days ago I was trying to deploy a docker image of a spring boot app into heroku.

I have the following docker file:

FROM openjdk:8-jdk-alpine
LABEL maintainer="gabigarciagar@gmail.com"
VOLUME /tmp
COPY ./target/*.jar PetApp_Auth.jar
CMD [ "java","-Xmx300m","-Xss512k","-XX:CICompilerCount=2","-Dfile.encoding=UTF-8","-Dspring.profiles.active=heroku","-Djava.security.egd=file:/dev/./urandom","-jar","/PetApp_Auth.jar" ]

also in my application.properties for a heroku profile i have:

spring.profiles.active=heroku
server.port=${PORT}
server.servlet.context-path=/

then i execute the following commands and everithig looks nice:

$ heroku container:push petapp-authserver -a petapp-authserver
Your image has been successfully pushed. You can now release it with the 'container:release' command.

$ heroku container:release petapp-authserver -a petapp-authserver
Releasing images petapp-authserver to petapp-authserver... done

Also the heroku log show that the app is up and also heroku ps the database connection is perfect also

$ heroku ps -a petapp-authserver
=== petapp-authserver (Free): java -Xmx300m -Xss512k -XX:CICompilerCount\=2 -Dfile.encoding\=UTF-8 -Dspring.profiles.active\=heroku -Djava.security.egd\=file:/dev/./urandom -jar /PetApp_Auth.jar (1)
petapp-authserver.1: up 2020/03/06 21:09:51 +0100 (~ 1m ago)

Then when i try to see swagger-ui o /actuator/health i get the following:

2020-03-06T20:11:58.149484+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=petapp-authserver.herokuapp.com request_id=e88c2499-b1de-4284-a649-1d8df19ae6c0 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=https
2020-03-06T20:11:59.443315+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=petapp-authserver.herokuapp.com request_id=9fa4951a-365c-4b9b-bf63-94f8d6792249 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=https
2020-03-06T20:12:08.185495+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/actuator/health" host=petapp-authserver.herokuapp.com request_id=c4c3382b-43b7-494c-9259-630ce24eb8a4 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=https
2020-03-06T20:12:08.697245+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=petapp-authserver.herokuapp.com request_id=b044b6fe-ba8d-4b3d-8c7c-8e477ea7b609 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=https
2020-03-06T20:12:12.943276+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/actuator/health" host=petapp-authserver.herokuapp.com request_id=6ac05b16-148d-4849-a857-c3d6bed9fe01 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=http
2020-03-06T20:12:13.637589+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=petapp-authserver.herokuapp.com request_id=2c01dbaa-18c5-46f8-8f43-f91ee372a5eb fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=http
2020-03-06T20:12:23.492570+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/swagger-ui.html" host=petapp-authserver.herokuapp.com request_id=2850eb70-1bd5-4737-9505-d59184e95946 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=http
2020-03-06T20:12:23.878827+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=petapp-authserver.herokuapp.com request_id=f83acdef-840a-4e2e-824c-183cfdc50273 fwd="79.147.107.220" dyno= connect= service= status=503 bytes= protocol=http

as heroku web said https://devcenter.heroku.com/articles/error-codes#h14-no-web-dynos-running

i execute:

heroku ps:scale petapp-authserver=1 -a petapp-authserver
Scaling dynos... done, now running petapp-authserver at 1:Free

And same error

What I am doing wrong??

I was able to deploy the jar directly and it works

heroku deploy:jar PetApp_AuthServer-V-0.0.0.jar -a petapp-authserver
Uploading PetApp_AuthServer-V-0.0.0.jar
-----> Packaging application...
       - app: petapp-authserver
       - including: PetApp_AuthServer-V-0.0.0.jar
-----> Creating build...
       - file: slug.tgz
       - size: 46MB
-----> Uploading build...
       - success
-----> Deploying...
remote:
remote: -----> heroku-deploy app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 96.8M
remote: -----> Launching...
remote:        Released v12
remote:        https://petapp-authserver.herokuapp.com/ deployed to Heroku
remote:
-----> Done

2020-03-13T19:25:13.683982+00:00 heroku[router]: at=info method=POST path="/auth/login" host=petapp-authserver.herokuapp.com request_id=ef9a29b6-c10c-4b82-8088-711d448c3a32 fwd="88.17.74.86" dyno=web.1 connect=1ms service=362ms status=200 bytes=878 protocol=https
2020-03-13T19:25:13.780163+00:00 heroku[router]: at=info method=GET path="/webjars/springfox-swagger-ui/fonts/titillium-web-v6-latin-600.woff2" host=petapp-authserver.herokuapp.com request_id=f2f6334d-2663-49b0-bd28-b5d287e79b68 fwd="88.17.74.86" dyno=web.1 connect=1ms service=13ms status=200 bytes=12634 protocol=https

Why it perfecty works with jar deploy and not with docker??

I have also tried:

Gabi@MSI MINGW64 /d/Proyectos/PetApp/Back/PetApp_AuthServer (develop)
$ heroku container:release web petapp-authserver -a petapp-authserver
 !    Expected response to be successful, got 404

Gabi@MSI MINGW64 /d/Proyectos/PetApp/Back/PetApp_AuthServer (develop)
$ heroku container:release web petapp-authserver -a petapp-authserver
 !    Expected response to be successful, got 404

Gabi@MSI MINGW64 /d/Proyectos/PetApp/Back/PetApp_AuthServer (develop)
$ heroku container:release petapp-authserver -a petapp-authserver
Releasing images petapp-authserver to petapp-authserver... done

Thanks in advance

解决方案

Finally I solved the question. The point is that the image in heroku must be named same as the process type, in this case web!

so there are two options. Build and pushing the image by using:

heroku container:push web -a petapp-authserver

or create the image locally and the tag it as registry.heroku.com/petapp-authserver/web

docker tag petapp-authserver registry.heroku.com/petapp-authserver/web

docker push registry.heroku.com/petapp-authserver/web
The push refers to repository [registry.heroku.com/petapp-authserver/web]
eb03575d1edf: Preparing
ceaf9e1ebef5: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
eb03575d1edf: Layer already exists
9b9b7f3d56a0: Layer already exists
f1b5933fe4b5: Layer already exists
ceaf9e1ebef5: Layer already exists
latest: digest: sha256:4c0ae2bba092c07bbd89394216b0bf78f458ba3583e63c8d15e01f6b07d6933e size: 1159

heroku container:release web -a petapp-authserver
Releasing images web to petapp-authserver... done

Now my containers are perfectly running in docker!!

Thank you all

这篇关于Heroku Docker春季启动映像错误503 H14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆