Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random 403 error establishing WebSocket handshake #69

Open
longwa opened this issue Oct 9, 2020 · 0 comments
Open

Random 403 error establishing WebSocket handshake #69

longwa opened this issue Oct 9, 2020 · 0 comments

Comments

@longwa
Copy link

longwa commented Oct 9, 2020

We are getting a random error sometimes opening a WebSocket connection. When the error occurs, we can usually just restart the pod without any changes and it will work the next time.

The error is:

tf.events-f9669d9aeb6c81c8cfffeaf375400b6e.js:formatted:1127 WebSocket connection to 'wss://dw-dev.test.triu.com/trifleet/stomp/236/2cbqrh2h/websocket' failed: Error during WebSocket handshake: Unexpected response code: 403
SockJS.websocket @ tf.events-f9669d9aeb6c81c8cfffeaf375400b6e.js:formatted:1127
/trifleet/stomp/236/s6d7dvpb/xhr_streaming:1 Failed to load resource: the server responded with a status of 403 ()
/trifleet/stomp/236/ub5z7a3w/xhr:1 Failed to load resource: the server responded with a status of 403 ()
tf.events-f9669d9aeb6c81c8cfffeaf375400b6e.js:formatted:2055 Whoops! Lost connection to undefined

It occurs when we try to create the Stomp client: Stomp.over(new SockJS(stompURL));

At first I thought it was a CORS issue, but I have confirmed that we have CORS enabled and I've set allowed origins to *:

    @Override
    protected void configureStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/stomp").setAllowedOrigins("*").withSockJS()
    }

We are using the NGINX Ingress controller for Kubernetes and I have confirmed that it is configured for WebSockets out of the box. We have increased the proxy read/write timeout to ensure they don't timeout.

Like I said, sometimes it works, and sometimes it doesn't. I can't figure out what would cause it to randomly fail with the same configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant