When attempting to deploy a stack via the UCP UI, if websockets are blocked on your UCP load balancer or by a browser plugin/extension, you will receive the following error:
websocket error, cannot get logs. stack may have still been created
A websocket is established during the stack deployment to stream deployment logs from UCP to the browser. If websockets are blocked on a load balancer between the client's browser and the UCP manager(s), the websocket will fail to be established and result in the error above. This behaviour will also occur if websockets are blocked or failing in the client's browser as the result of a browser plugin or extension.
- If websockets are being blocked by a load balancer, this indicates that HTTPS termination is occurring on the load balancer, permitting the HTTPS traffic inspection and filtering. Per the Docker documentation on load balancing on UCP, since Docker UCP uses mutual TLS, you should make sure to configure your load balancer not to terminate HTTPS connections.
As a result, the resolution is to reconfigure your load balancer not to terminate HTTPS connections for UCP and not to simply update the load balancer to permit websockets. Having reconfigured this, it should be possible to successfully establish a websocket, and this error during stack deployments should be resolved.
- Check if the same stack deployment works in different browsers, as well checking with any browser plugins and extensions disabled. Certain browser plugins and extensions can block or otherwise disrupt websocket connectivity.