Websocket error when using Sendbird with Saucelabs

Issue - Error during WebSocket handshake: ‘Upgrade’ header is missing

I am trying to run my chat application in Sauce labs for e2e testing, After setting up connection with Sauce Labs when i try to open the chat in Saucelabs browser, I am getting Error during WebSocket handshake: 'Upgrade' header is missing.

1 Like

Hello @premkumar,

Welcome to the Sendbird Community. Can you expand on your implementation? What version of the SDK are you utilizing?

Thanks,
Tyler

Hi Tyler, Thanks for getting back. Currently we are using “sendbird”: “3.0.143”

Thank you @premkumar. Could you expand on your implementation? Are you able to share how you’re implementing the Sendbird SDK into your application?

If you run your application outside of SauceLabs, do you run into this issue?

-Tyler

I dont find any issue running outside the Sauce lab

Could you please provide the entire network request that fails in SauceLabs?

Thanks

Request URL: wss://ws-18c9516b-cd88-44cc-a6d7-8a4c7c85d1e0.sendbird.com/?p=JS&pv=Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2011_0_0)%20AppleWebKit%2F537.36%20(KHTML.%20like%20Gecko)%20Chrome%2F87.0.4280.66%20Safari%2F537.36&sv=3.0.143&ai=18C9516B-CD88-44CC-A6D7-8A4C7C85D1E0&user_id=8fab1c16-e6ab-4d10-ba5a-dc97340ef7a9&access_token=63103881fec91c9d7ed237bfec33f6b013d18b21&active=1&SB-User-Agent=JS%2Fc3.0.143%2F%2F&Request-Sent-Timestamp=1614968517430&include_extra_data=premium_feature_list%2Cfile_upload_size_limit%2Capplication_attributes%2Cemoji_hash

Response:
Error during WebSocket handshake: 'Upgrade' header is missing

Thank you. Could you also provide a screenshot of the following from SauceLabs?

here you go

Is this the request that fails in SauceLabs?

yes this is from Sauce lab

Could you please export the Chrome HAR file for when the request fails in SauceLabs, and DM me with it?

Thanks!

I am not able to send it
Body is limited to 32000 characters; you entered 219949.
Sorry, new users can only put 2 links in a post.

You should be able to ZIP the HAR file and DM it to me. If that does not work, let me know and we’ll figure out a different solution.

I’m having a difficult time tracking down why SauceLab would be having an issue with the Websocket. Looking at the request headers and comparing them to a successful call from my own environment, they’re nearly identical aside from the origin and key. Can you help me better understand SauceLabs? Is it its own environment? How does it differ from when you’re using the application outside of it?

Thanks,
Tyler

I am connecting to Sauce labs using Sauce connect proxy here Sauce Connect Proxy - The Sauce Labs Cookbook - Sauce Labs Documentation Wiki

which sets up a tunnel for sauce lab VM to execute my session in multiple browsers, it works fine for HTTP req, but fails only for WS req with the error shown above.

Out of curiosity, if you navigate to websocket.org Echo Test - Powered by Kaazing and connect to websocket while connected to SauceLab, does it connect?

When i try the same

And if you look at the network requests in the browser, do you see a similar error? It sounds like the tunnel that you’re using is causing issues with Websocket connections.

Hey Tyler. I was able to fix the issue using
sauceConnectOpts: { 'no-ssl-bump-domains': 'all', },

Thanks for your support.

1 Like