提问者:小点点

Spring Boot PostgreSQL应用程序heroku http 503 H10错误


我用postgreql数据库构建了一个Spring启动Rest服务,它在本地工作正常。我正在尝试将我的项目部署到Heroku。我将我的数据库恢复到Heroku postgres并进行连接配置,在本地测试,数据库连接正常。我成功地将其部署到heroku,但应用程序不工作。

HTML错误:

获取https://earthinfotr.herokuapp.com/503(服务不可用)

获取https://earthinfotr.herokuapp.com/favicon.ico503(服务不可用)

希罗库日志:

2022-08-20T21:58:10.213261 00:00 heroku[路由器]: at=错误代码=H10 desc="应用程序崩溃"方法=GET路径="/"主机=earthinfotr.herokuapp.comrequest_id=9531b542-93c4-4ecf-a741-e757409e522e fwd="78.190.148.67"dyno=连接=服务=状态=503字节=协议=https

2022-08-20T21:58:10.402172 00:00 heroku[router]: at=error code=H10 desc=“App crashed” 方法=GET 路径=“/favicon.ico” host=earthinfotr.herokuapp.com request_id=338bd6ac-7c14-4827-a928-880db0c12f09 fwd=“78.190.148.67” dyno= 连接= 服务= 状态=503 字节= 协议=https

程序:

web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/spring-boot-info-earth-0.0.1-SNAPSHOT.jar

system.properties:

java.runtime.version=17.0.4
PORT=process.env.port || 8080

共1个答案

匿名用户

我没有找到确切的解决办法,但不知何故我成功了。Heroku postgres的免费计划允许您对一个数据库使用最多10,000行,我有150,000行,有趣的是Heroku并没有给出相应的错误。我删除了大量数据,使其低于10k行,然后我创建了一个新的spring boot项目,将我的所有代码转移到那里,它工作得很好。下面是应用程序:

https://earthinfo.herokuapp.com/

PS:我只删除了城市(很多城市),你可以在土耳其的城市进行测试。