P
Prisma•4mo ago
langer

Pulse on ECS

Hi gang, we've recently adopted Pulse, and noticed only upon deploying to production that our ECS containers cannot either .stream() or .subscribe to any of our models. Hunch is that Pulse is driven by a websocket under the hood, and that the ELB is to blame here. Do you have any recommended configurations for this deployment environment?
4 Replies
langer
langerOP•4mo ago
Might be worth noting this is all working swimmingly in our local development environments over sst
Nurul
Nurul•4mo ago
Hey @langer 👋 You are correct, Pulse relies on Websockets internally to hold a persistent connection. Are you using Fargate? From what I have seen containers can hold websocket connections. What error do you get?
langer
langerOP•4mo ago
I've not been able to produce a meaningful error yet. I've added logging around the call to const stream = await prisma.model.stream({name: "foo"}) and cannot see evidence of it connecting (logs after that call do not print). Given that this works flawlessly in dev, are there any obvious networking settings I should be looking for, either on the container, the ELB, or VPC? - container has an auto-assigned public ip - security group allows all inbound and outbound traffic - elb has stickiness turned on Reachability analyzer says the container's ENI can connect to your IP. I do see in the insights tab that we have performed 442628 reads in the last 24 hours, yet we've not seen any evidence of those in the client.
langer
langerOP•4mo ago
Closing the loop here, appears to be a Bun issue. May be worth calling out in your docs. Running this with Bun on Linux may be a non-starter: https://github.com/oven-sh/bun/issues/5951
GitHub
ws.WebSocket 'upgrade' and 'unexpected-response' event is not imple...
What version of Bun is running? Latest What platform is your computer? linux What steps can reproduce the bug? i got this warning when run my project. And ws connection getting terminate [bun] Warn...

Did you find this page helpful?