Heroku 错误 at=error code=H14 desc= "No web processes running" 方法=GET 路径= "/"



我正在尝试使用Heroku来部署我的春季项目,使用从Github部署。

我是Spring和Heroku的新人。

一开始它给了我成功,但是当我试图访问返回给我这个消息

at=error code=H14 desc="没有web进程正在运行"方法=得到路径="/";Dyno = connect= service= status=503 bytes= protocol=https

My pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/3.6.2 https://maven.apache.org/xsd/maven-3.6.2.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.edu.utfpr.sgcc</groupId>
<artifactId>SGCC</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<finalName>SGCC</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.3.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.2.5.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>6.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.3.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.5.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.5.3</version>
</dependency>
</dependencies>
</project>

我没有个人资料,但我不知道是否有必要。

当我运行heroku ps:scale web=1我收到一个状态127,但返回相同的错误

2021 - 08 - 06 - t00:36:36.163994 + 00:00 heroku[运行。[6184]:状态从starting变为up2021 - 08 - 06 - t00:36:36.419540 + 00:00 heroku[运行。[684]:等待客户2021 - 08 - 06 - t00:36:36.463704 + 00:00 heroku[运行。[6184]:使用命令heroku ps:scale web=1启动进程2021 - 08 - 06 - t00:36:38.857286 + 00:00 heroku[运行。[6184]:客户端连接已关闭。向所有进程发送SIGHUP2021 - 08 - 06 - t00:36:39.385263 + 00:00 heroku[运行。[6184]:进程退出,状态为1272021 - 08 - 06 - t00:36:39.479070 + 00:00 heroku[运行。[6184]:状态从up变为complete

错误H14,提示"没有web进程正在运行";基本上意味着你没有运行任何web dynos。您可以使用heroku ps:scale web=1启动一个。

请参考这个问题。

  • 我添加了下面的代码
gunicorn appn.wsgi

heroku ps:scale web=1 
web: gunicorn appn.wsgi --log-file -

Procfile仍然面临一个问题:

2022-01-19T15:35:19.020279+00:00 heroku[router]: 
at=error code=H14 desc="No web processes running" method=GET 
path="/" host=****.herokuapp.com request_id=eer2323423er32 fwd="125.16.01.197" 
dyno= connect= service= status=503 bytes= protocol=https
  • 我花了一个晚上来解决这个问题,
  • 但最后,我在另一个应用程序上部署了相同的代码。这次可以正常工作了:]