I am trying to deploy a long running Springboot service on OpenFaas and facing Upstream HTTP request error: Post http://127.0.0.1:8082/: EOF

I have a springboot service which exposes API's. To deploy this service on openfaas the following steps were performed.

  1. the service depends on external dependencies which are placed in a folder in root project.
  2. Updated build.gradle with implementation fileTree("$folderPath") to include external dependencies.
  3. Started the Springboot Application run process in Handler class, but getting Upstream HTTP request error: Post http://127.0.0.1:8082/: EOF while we try to invoke the Handler.
  4. Tried increasing the exec_time, but it dint help.
  • How do we run a long running springboot process in OpenFaas?
  • If the dependencies are loaded while building, how are they resolved at runtime inside docker container ?
1

There are 1 best solutions below

0
On

Go http clients usually return EOF in case of request timeouts. OpenFaas watchdog, gateway, queue workers, all use GO http clients internally. Most probably your OpenFaas installation is not configured properly for long running functions.

You can double check this by making your Springboot API return immediately and see if that works.

You can refer to this to configure your OpenFaas to run long running functions. This is an excellent sample function for long running functions.

For your second question, if your faas build is succeeding (and i am assuming you are working with standard OpenFaas Java template), it packages the complete output of gradle build inside the docker container, which should carry all your dependency files as well.