fission / keda-connectors

Generic connectors for Keda which can be used as worker images as part of scaleTargetRef.
Apache License 2.0
23 stars 30 forks source link

Nats-jetstream keda connector fails #121

Closed yaymarius closed 1 month ago

yaymarius commented 1 year ago

I created pull consumer but getting following error: {"level":"fatal","ts":1677184769.1167047,"caller":"app/main.go:63","msg":"error occurred while parsing metadata","error":"nats: must use pull subscribe to bind to pull based consumer","stacktrace":" │ │ main.main\n\t/app/main.go:63\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}

Fission/Kubernetes version

$ fission --version
client:
  fission/core:
    BuildDate: "2023-01-13T06:26:33Z"
    GitCommit: deb3523b
    Version: v1.18.0
server:
  fission/core:
    BuildDate: "2023-01-13T06:26:33Z"
    GitCommit: deb3523b
    Version: v1.18.0
$ kubectl version
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.6", GitCommit:"ff2c119726cc1f8926fb0585c74b25921e866a28", GitTreeState:"clean", BuildDate:"2023-01-18T19:15:26Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}

Kubernetes platform (e.g. Google Kubernetes Engine)

Describe the bug

When there is more messages in stream, and the worker tries to scale it fails. To Reproduce Create pull consumer as requested in documentation.

Expected result

Messages are processed in scallable manner. Actual result function never initializes as the nats subscription type is wrong error":"nats: must use pull subscribe to bind to pull based consumer"," Screenshots/Dump file

$ fission support dump

Additional context

If I do what error message does, then first consumer works as expected and every consumer after that returns errors {"level":"fatal","ts":1677188461.8707836,"caller":"app/main.go:63","msg":"error occurred while parsing metadata","error":"consumer is already bound to a subscription","stacktrace":"main.main\n\t/app │ │ /main.go:63\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}

soharab-ic commented 1 month ago

Please try latest version of keda-nats-jetstream-http-connector https://github.com/fission/keda-connectors/pkgs/container/keda-nats-jetstream-http-connector/279693274?tag=v0.9.