Closed pnivanov closed 1 year ago
@pnivanov are you deploying it as a Knative service? If so, my guess is that after some time without active HTTP request the service is scaled down to zero and that causes the Websocket to fail. To prevent that behaviour you can set the minimum size to 1
.
https://knative.dev/docs/serving/autoscaling/scale-bounds/#lower-bound
Let me know if this is not the case.
Also make sure you're using the latest version of the player.
quay.io/ruben/cloudevents-player:v1.3
or quay.io/ruben/cloudevents-player:latest
I've been running it for ~30 minutes without any problem.
In the example deployment the minScale is set to 1
so if you're using it that shouldn't be the problem.
@ruromero Yes, I am deploying it as Knative service. But the service is configured with minScale=1:
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/min-scale: "1"
It starts failing after more than a day. I will update the issue when it gets reproduced again.
Here is my entire yaml:
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: cloudevents-player
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/min-scale: "1"
spec:
containers:
- image: ruromero/cloudevents-player:latest
env:
- name: BROKER_URL
value: http://broker-ingress.knative-eventing.svc.cluster.local/default/default
I can see that in your example there is an extra environment variable, that I don't have:
- name: PLAYER_MODE
value: KNATIVE
Would it help if I set it? If it is necessary, the Knative tutorial should be updated: https://knative.dev/docs/getting-started/first-source/
I will send a PR to that documentation as it is very outdated. It is using docker images which are very old. Try to use quay.io/ruben/cloudevents-player instead
Thank you, Ruben! Will redeploy from quay.io and use your example deployment yaml instead.
Unfortunately I cannot deploy quay.io/ruben/cloudevents-player:latest The deployment fails with:
Message: Container failed with: qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
I suspect the reason is that I am using Apple M1 arm processor and qemu emulation... Do you have native arm build?
I tried to build multi-arch images but apparently it didn't work. I will revisit this part when I find some time, thanks for letting me know. You can however build the image yourself if you want.
@pnivanov try now, I have tested the arm64 image it on my Raspberry 4 and it works. See #60
I have created https://github.com/knative/docs/pull/5486
After running for some time, cludevents-player UI stops working. The error that is visible in the browser console is the following:
When I check the pod logs, I can see it is full of the following errors:
I am attaching the full log here: cloudevents-player.log