projectriff / riff

riff is for functions
https://projectriff.io
Apache License 2.0
799 stars 64 forks source link

uppercase example keeps crashlooping #1387

Closed listaction closed 4 years ago

listaction commented 4 years ago

I am trying 0.15 riff using minikube(version 1.12) and (kubernetes version 1.17.0) on a mac with docker.

After I deploy the springboot java function (uppercase) , knative spins up the container and serves the request. If I let things idle for a little bit , and fire another request, it tries to restart the process for the same container and springboot complains that the port is already in use.

How do i resolve this? Also is this project maintained - don't see any commits in a while.

default           uppercase-deployer-h6mjc-4c6sw-deployment-84dbd9fd8f-v88hk   0/2     CrashLoopBackOff   3          114s
ain] o.s.c.f.web.mvc.FunctionHandlerMapping   : FunctionCatalog: org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration$BeanFactoryFunctionCatalog@1a7d0c9f
00:24:18.737 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
00:24:18.747 [main] INFO  o.a.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read
2020-08-15 00:24:18.791  INFO 46 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2020-08-15 00:24:18.797  INFO 46 --- [           main] o.s.boot.SpringApplication               : Started application in 3.233 seconds (JVM running for 6.213)
00:24:18.801 [main] INFO  o.s.c.f.d.FunctionArchiveDeployer - Application context for archive 'file:/workspace/' is created.
00:24:18.831 [main] INFO  o.s.c.f.d.FunctionArchiveDeployer - Discovered functions in deployed application context: {uppercase=functions.UppercaseApplication$$Lambda$581/0x00000001006b6040@1a7e799e}
00:24:18.856 [main] INFO  o.s.c.f.d.FunctionArchiveDeployer - Registering function 'uppercase' of type 'java.util.function.Function<java.lang.String, java.lang.String>' in FunctionRegistry.
00:24:18.862 [main] INFO  o.s.c.f.d.FunctionDeployerConfiguration - Successfully deployed archive: /workspace
00:24:19.148 [main] INFO  i.p.invoker.main.EntryPoint - Started EntryPoint in 5.721 seconds (JVM running for 6.565)
2020/08/15 00:24:22 error running proxy listen tcp :8080: bind: address already in use
scothis commented 4 years ago

The sample functions are indeed under maintained. The java-boot-uppercase says it targets riff 0.1, yikes.

While not a sample, per se, this function does work with riff 0.5 and is conceptually the same. https://github.com/projectriff/fats/tree/main/functions/uppercase/java-boot

riff function create uppercase --git-repo https://github.com/projectriff/fats --sub-path functions/uppercase/java-boot
listaction commented 4 years ago

Thanks scott.

I did try 0.5 , packer needs an update as lifecycle 0.9.1 has issues identifying api correctly (it shows up as 0.2) ..waiting for a release this week for packer.

On Tuesday, August 18, 2020, Scott Andrews notifications@github.com wrote:

The sample functions are indeed under maintained. The java-boot-uppercase https://github.com/projectriff-samples/java-boot-uppercase says it targets riff 0.1, yikes.

While not a sample, per se, this function does work with riff 0.5 and is conceptually the same. https://github.com/projectriff/fats/tree/main/ functions/uppercase/java-boot

riff function create uppercase --git-repo https://github.com/projectriff/fats --sub-path functions/uppercase/java-boot

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/projectriff/riff/issues/1387#issuecomment-675769774, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABT2X2T7H4GRNQZ4F6V6G3SBMFVHANCNFSM4P77DB3A .

scothis commented 4 years ago

riff releases should be pinned to versions of all components to prevent incompatibilities like this. How did you install riff?

listaction commented 4 years ago

Following Getting Started of riff - 0.5 on minikube (kubernetes 0.17.0)- the java functions in 0.5 version of riff has an issue with 0.2.0 of cloud-function invoker where it is unable to map the incoming http request to the cloudfunction resulting in "mapper is null". This appears to be fixed in 0.2.1 of cloud function invoker.

In the spirit of moving forward, I want to use that. The other issue I noticed is the crashloop - mentioned in this issue (which is due to a port conflict between the streaming http adapter which listens on 8080 and the springboot app which also listens on 8080 when it's invoked via knative serving).

On Wed, Aug 19, 2020 at 6:47 AM Scott Andrews notifications@github.com wrote:

riff releases should be pinned to versions of all components to prevent incompatibilities like this. How did you install riff?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/projectriff/riff/issues/1387#issuecomment-676386768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABT2X3THAVBIHVUPUUOQTLSBPJYHANCNFSM4P77DB3A .

scothis commented 4 years ago

riff has an issue with 0.2.0 of cloud-function invoker where it is unable to map the incoming http request to the cloudfunction resulting in "mapper is null". This appears to be fixed in 0.2.1 of cloud function invoker.

Make sure you're passing an Accept header with the request. Since the 0.5 release we've done some work to provide a better default.