Samuel S. Salazar
Samuel S. Salazar

Reputation: 93

Spring boot heroku "No web processes running"

I´m currently working on a Spring Boot application that is deployed in heroku. The application has 2 main projects on the same repo (frontend and backend). I`ve managed to get running the frontend using node.js and (technically) also managed to get running the spring boot application.

    2017-03-16T08:17:14.834886+00:00 app[api.1]: 2017-03-16 08:17:14.834  INFO 4 --- [main] o.s.web.servlet.DispatcherServlet: FrameworkServlet 'dispatcherServlet': initialization completed in 35 ms
    2017-03-16T08:17:14.906139+00:00 app[api.1]: 2017-03-16 08:17:14.905  INFO 4 --- [main] com.zilicio.editor.ServerApplication: Started ServerApplication in 14.331 seconds (JVM running for 16.638)
    2017-03-16T08:17:14.881330+00:00 app[api.1]: 2017-03-16 08:17:14.881  INFO 4 --- [main] .s.b.c.e.j.JettyEmbeddedServletContainer: Jetty started on port(s) 11831 (http/1.1)

Everything seems ok according to that logs, but when I access the application it return an HTTP 500 claiming that there are no Web process running.

    2017-03-16T08:17:29.435087+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/api/projects" (...)

But when I check with heroku ps

    api.1: up 2017/03/16 03:16:56 -0500 (~ 30m ago)

This is my procfile:

    web: node Z-Editor/Frontend/server.js
    api: java -Dserver.port=$PORT $JAVA_OPTS -jar Z-Editor/Server/target/*.jar

It declares the 2 process (one for the front and one for the server). There are 2 different heroku apps running each one of the dynos. The node.js dyno is working but the one with Spring boot is not.

This is the folder structure of the repo:

    +root
      - procfile
      + frontend
         - package.json
         - ...
      + server
         - src
         - pom.xml
         + target
            - server.jar
            - ...
      - package.json

Hope someone can help me.

PD: The package.json and pom.xml in the root folder are the same as the ones in frontend and server folders.

Upvotes: 0

Views: 2117

Answers (1)

Michał Młoźniak
Michał Młoźniak

Reputation: 5556

I am sure about your exact setup, but in general you can have only one process that will receive http requests. And this process must be named web. In your case, web process is your node application. api process can run fine, but it will never get any request. You need to split those two processes in two separate Heroku apps.

Upvotes: 1

Related Questions