Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala应用程序在Heroku上启动时崩溃,包括基本的hello world_Scala_Heroku_Deployment_Akka Http - Fatal编程技术网

Scala应用程序在Heroku上启动时崩溃,包括基本的hello world

Scala应用程序在Heroku上启动时崩溃,包括基本的hello world,scala,heroku,deployment,akka-http,Scala,Heroku,Deployment,Akka Http,tldr:在最简单的Akka服务器上获取以下错误: 2020-11-23T00:24:52.212270+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2020-11-23T00:24:52.239873+00:00 heroku[web.1]: Stopping process with SIGKILL 202

tldr:在最简单的Akka服务器上获取以下错误:

2020-11-23T00:24:52.212270+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-11-23T00:24:52.239873+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-11-23T00:24:52.339576+00:00 heroku[web.1]: Process exited with status 137
正在尝试部署到Heroku,但不确定要做什么

我有一个在Akka HTTP上运行的Scala应用程序,我想将其部署到Heroku。它不起作用,所以我制作了一个超级基本的示例,它只有一个端点(“/”),并返回一个HTML字符串。它只有三个依赖项,都是阿克卡

我在plugins.sbt中定义了sbt本机启动器,在build.sbt中启用了JavaAppPackaging。它在本地运行良好(
heroku local web
),但当我投入生产时,我会得到以下日志:

2020-11-22T23:57:21.620869+00:00 app[api]: Release v7 created by user <myuser>
2020-11-22T23:57:22.201143+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-22T23:57:25.502636+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/hello-world -Dhttp.port=12828`
2020-11-22T23:57:27.881143+00:00 app[web.1]: Create a Procfile to customize the command used to 
run this process: https://devcenter.heroku.com/articles/procfile
2020-11-22T23:57:28.043747+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
2020-11-22T23:57:29.231879+00:00 app[web.1]: SLF4J: Failed to load class 
"org.slf4j.impl.StaticLoggerBinder".
2020-11-22T23:57:29.231937+00:00 app[web.1]: SLF4J: Defaulting to no-operation (NOP) logger 
implementation
2020-11-22T23:57:29.232029+00:00 app[web.1]: SLF4J: See 
http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2020-11-22T23:57:30.667572+00:00 app[web.1]: Server online at http://localhost:12828/
2020-11-22T23:57:30.667588+00:00 app[web.1]: Press RETURN to stop...
2020-11-22T23:57:30.957876+00:00 heroku[web.1]: Process exited with status 0
2020-11-22T23:57:31.007237+00:00 heroku[web.1]: State changed from starting to crashed
所以我对它进行了修改,这样就没有办法从shell终止,这对部署来说毫无用处,于是我在程序中添加了一个端口解除绑定钩子。现在我得到以下信息:

2020-11-23T00:23:48.274903+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-23T00:23:51.899150+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/hello-world -Dhttp.port=53789`
2020-11-23T00:23:54.456208+00:00 app[web.1]: Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
2020-11-23T00:23:54.664379+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-11-23T00:23:56.447805+00:00 app[web.1]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2020-11-23T00:23:56.447951+00:00 app[web.1]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2020-11-23T00:23:56.448056+00:00 app[web.1]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2020-11-23T00:23:59.188735+00:00 app[web.1]: Server online at http://localhost:53789/
2020-11-23T00:24:52.212270+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-11-23T00:24:52.239873+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-11-23T00:24:52.339576+00:00 heroku[web.1]: Process exited with status 137
2020-11-23T00:24:52.391175+00:00 heroku[web.1]: State changed from starting to crashed

在这一点上,我只是不知道该怎么办。似乎无论我尝试什么,程序都无法连接到端口。帮助?

你说的生产是什么意思?马钱斯?在上一次体验中,您似乎将端口从12828更改为53789。您在计算机上打开端口了吗?可能您正试图绑定到heroku上无法访问的某个端口。您可以共享您的主要应用程序代码吗?应用程序配置应注意使用环境变量
PORT
绑定HTTP服务您所说的生产是什么意思?马钱斯?在上一次体验中,您似乎将端口从12828更改为53789。您在计算机上打开端口了吗?可能您正试图绑定到heroku上无法访问的某个端口。您可以共享您的主应用程序代码吗?应用程序配置应注意使用环境变量
PORT
绑定HTTP服务
2020-11-23T00:23:48.274903+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-23T00:23:51.899150+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/hello-world -Dhttp.port=53789`
2020-11-23T00:23:54.456208+00:00 app[web.1]: Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
2020-11-23T00:23:54.664379+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-11-23T00:23:56.447805+00:00 app[web.1]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2020-11-23T00:23:56.447951+00:00 app[web.1]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2020-11-23T00:23:56.448056+00:00 app[web.1]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2020-11-23T00:23:59.188735+00:00 app[web.1]: Server online at http://localhost:53789/
2020-11-23T00:24:52.212270+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-11-23T00:24:52.239873+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-11-23T00:24:52.339576+00:00 heroku[web.1]: Process exited with status 137
2020-11-23T00:24:52.391175+00:00 heroku[web.1]: State changed from starting to crashed