【问题标题】:Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch错误 R10(启动超时)-> Web 进程未能在启动后 90 秒内绑定到 $PORT
【发布时间】:2018-10-16 11:27:12
【问题描述】:

我正在尝试将我的 Spring Boot 应用程序部署到 Heroku,但我不断收到:

2018-05-06T14:41:35.181889+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2018-05-06T14:41:35.182093+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-05-06T14:41:35.482221+00:00 heroku[web.1]: Process exited with status 137
2018-05-06T14:41:35.496155+00:00 heroku[web.1]: State changed from starting to crashed

我已经看到一些答案告诉我这样的地方

server.port=${PORT:8080}

在我的应用程序属性中,但它仍然无法正常工作。

我没有看到其他任何我能做的事情,也没有进一步的输出可以提示我找到问题的根源。

有什么想法吗?

【问题讨论】:

  • 您是否要指定自己的端口?你能发布你的Procfile吗?
  • @jusermar10 根据 Herokus 文档,我不需要 Procfile。因为它是一个 Spring Boot 应用程序,所以会自动检测到所有内容。据我了解,没有必要使用$PORT 设置端口,但我可能在这里忽略了一些东西..

标签: spring-boot heroku


【解决方案1】:

我知道这是一个非常古老的问题,但是收到此错误消息的人可能会在这里...所以我想分享我对这个问题的解决方案:

我一直在我的 Spring Boot 应用程序中使用 Maven Heroku 插件

                    <groupId>com.heroku.sdk</groupId>
                    <artifactId>heroku-maven-plugin</artifactId>

发生在我身上的是我的 POM 文件意外地被重新格式化,因此 -Tag 中的内容收到了一些换行符。

Heroku Maven 插件根据这些内容创建一个 Procfile。但是 Procfile 不能处理命令中的换行符。

所以,在几乎发疯之后,我发现换行导致命令被破坏,这导致了我的情况出现上述错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-16
    • 2021-04-05
    • 1970-01-01
    • 2021-08-19
    • 2019-04-20
    • 2021-01-14
    • 2019-07-04
    • 2021-04-23
    相关资源
    最近更新 更多