Sporadic failure to join meeting with error: FailedFromWeb, SB_ERROR_UNKNOWN, 200

Description
When I try to join meetings from the web meeting SDK on my website, about 30% of the time, I get a “Joining Meeting Timeout. Fail to join the meeting.” popup. Pressing “Retry” often makes it work, but sometimes it fails multiple times in a row.

Browser Console Error
No errors on the console, but when examining the websocket messages, I see two normal messages:
“test”: “welcome to zoom”
“status”: “ready”
and then the third message is an error saying:
“error_desc”: “FailedFromWeb, SB_ERROR_UNKNOWN ,200”

Which Web Meeting SDK version?
2.8.0

Meeting SDK Code Snippets

ZoomMtg.preLoadWasm();
			ZoomMtg.prepareWebSDK();
			ZoomMtg.i18n.load('en-US');
			ZoomMtg.i18n.reload('en-US');
			ZoomMtg.init({
			leaveUrl: 'livezoom?v=' + Date.now() + "&num=" + mtgnum + "&pw=" + mtgpw,
			success: (success) => {
				console.log(success)
				
				ajax( "data", "zoom-sig", { num: mtgnum, pw: mtgpw }, function( xml )
				{
					let config = emf.fromAttributes( $( xml ).find( "zoominfo" ) );
					config.success = function( success ){ console.log( success ) };
					config.error = function( error ){ console.log( error ) };
					console.log( config );
					ZoomMtg.join({
						sdkKey: config.sdkKey,
						signature: config.signature,
						meetingNumber: config.meetingNumber,
						passWord: config.passWord,
						userName: config.userName,
						success: (success) => {
							console.log(success);
							parent.postMessage( "joinedzoom" , "*" );
						},
						error: (error) => {
							console.log(error);
							location.reload();
						}
					});
				});
			},
			error: (error) => {
				console.log(error)
			}
			});

Troubleshooting Routes
I have not found any info on this error message online, and the issue appears to happen randomly without me doing anything differently, so it is hard to find any pattern. I do notice that it happens more frequently the first time I use the web SDK on a new browser.

Device (please complete the following information):
Happens on many devices, but the device I am currently testing with is

  • Device: RazerBlade 15
  • OS: Windows 11
  • Browser: Chrome
  • Browser Version: 108.0.5359.99 (Official Build) (64-bit)

Additional context
Aside from this issue, the webSDK is working great, and it is a great thing to have on our website, but we really need to get to the bottom of this issue because our customers will be confused if they keep having to retry joining the meetings. Thanks!

check in your code (-> creating signature), how your “iat” is defined

here is the zoom example from github

I am using the following code to create the iat. Should be equivalent to how the example is doing it:

Long ts = ( System.currentTimeMillis() - 30000 ) / 1000;
String	iat = Long.toString( ts ),
                exp = Long.toString( ts + 10800 ), //3 hours

very strange

“FailedFromWeb, SB_ERROR_UNKNOWN ,200”

nothing on google or bing - not even for “SB_ERROR”

add

ZoomMtg.init({
    debug: true,

an try again

Yes I was surprised to find nothing when searching for this error. I just tried with debug as you suggested, and it did not seem to provide any useful information.

The only difference is that when it fails, I get a console message saying --close socket-- whereas when it succeeds I get a “createAVSocket” message. Otherwise, the consoles look the same up to that point. I would attach screenshots, but the forum won’t let me :frowning:

By the way, if you’d like to reproduce my issue, you can try it at this URL where I am hosting my WebSDK app: IMACS Zoom

If you create a meeting using Zoom elsewhere, and then try to join that meeting with my WebApp, it fails 20-30% of the time. It seems to fail more frequently the first time you try to join, so if you are able to join successfully, try ending the meeting and restarting it before you join again from the webapp. Eventually you should get a failure.

Thank you so much for your help!

I think I have resolved the issue. I realized that I was not doing Base64url encoding correctly on my backend when creating the JWT. After fixing this, I haven’t seen any failures to join meetings. This was hard to debug because it only occasionally caused errors, and the zoom error was not descriptive. In case anyone else will benefit, here is how to properly implement the JWT generation for a Java Backend:

                              String sdkkey = "YourSDKKey", //Generated from Zoom SDK Website
		                            sdksecret = "YourSDKSecret"; //Generated from Zoom SDK Website

				int role = 0;

				Long ts = ( System.currentTimeMillis() - 30000 ) / 1000;

				String	iat = Long.toString( ts ),
						exp = Long.toString( ts + 10800 ), //3 hours
						header = "{\"alg\":\"HS256\",\"typ\":\"JWT\"}",
						payload = String.format( "{\"sdkKey\":\"%s\",\"mn\":\"%s\",\"role\":\"%d\",\"iat\":\"%s\",\"exp\":\"%s\",\"tokenExp\":\"%s\"}", sdkkey, mtgnum, role, iat, exp, exp ),
						headencode = "",
						payencode = "",
						msg = "",
						signature = "";

				try
				{
					Mac hasher = Mac.getInstance( "HmacSHA256" );
					hasher.init( new SecretKeySpec( sdksecret.getBytes(), "HmacSHA256") );
					headencode = java.util.Base64.getEncoder().encodeToString( header.getBytes() );
					payencode = java.util.Base64.getEncoder().encodeToString( payload.getBytes() );

					String msgtmp = headencode + "." + payencode;

					msg = msgtmp.replaceAll( "/", "_" ).replaceAll( "\\+", "-" ).replaceAll( "=", "" );

					byte[] hash = hasher.doFinal( msg.getBytes() );

					String hashencodetmp = java.util.Base64.getEncoder().encodeToString( hash );
					String hashencode = hashencodetmp.replaceAll( "/", "_" ).replaceAll( "\\+", "-" ).replaceAll( "=", "" );
					
					signature = msg + "." + hashencode;
				}
				catch ( Exception e )
				{
				}
1 Like

Thanks @zakakaufman and @j.schoenemeyer for sharing this with the community!!! :1st_place_medal:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.