# Failed to join session

**URL:** <https://devforum.zoom.us/t/failed-to-join-session/51406>\
**Category:** Windows\
**Created:** [May 31, 2021, 4:10am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406 "2021-05-31T04:10:58Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [May 31, 2021, 4:10am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/1 "2021-05-31T04:10:58Z")

</div>

**Description**  
I have initialized the SDK, created sessionContext, and joinSession always return NULL.  
I looked in joinsession-always-returns-null/46977 forum post to ensure I don’t repeat those issues.

my test code is available at [GitHub - gp583101/ZTP\_C](https://github.com/gp583101/ZTP_C).

here is my [jwt.io](http://jwt.io) payload.  
{  
“app\_key”: “uJVydcNehiIWPEEHtbvsWBOQIH0Elc2hMcVr”,  
“version”: 1,  
“user\_identity”: “AAAT1876”,  
“iat”: 1622392553,  
“exp”: 1622478953,  
“tpc”: “Sessionname15081977”  
}

I see the same issue on both windows console and windows desktop application.  
**Which Desktop Video SDK version?**  
zoom-instant-sdk-windows-1.0.2

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Go to ‘…’
2. Click on ‘…’
3. Scroll down to ‘…’
4. See error

**Screenshots**  
If applicable, add screenshots to help explain your problem.

**Device (please complete the following information):**

- Device: [e.g. Apple MacBook Pro (13-inch, M1)]
- OS: [e.g. macOS Big Sur 11.2.1]  
Windows-10, Visual studio 2019, console application.  
**Additional context**  
Add any other context about the problem here.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 1, 2021, 8:36pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/2 "2021-06-01T20:36:09Z")

</div>

Hey @gp583101,

Thanks for using the dev forum!

I have written up a little tutorial about this here: [“auth sdk failed” when running zoom sdk demo - #7 by Michael\_Condon](https://devforum.zoom.us/t/auth-sdk-failed-when-running-zoom-sdk-demo/37448/7)  
This is technically about the Client SDK but the steps are the same aside from the actually payload.  
Can you take a look at this and use the Video SDK payload to see if you can successfully created a “dummy” JWT?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 1, 2021, 8:46pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/3 "2021-06-01T20:46:49Z")

</div>

@Michael_Condon I followed the tutorial that you are referring to. when I followed those steps, I was able to auth App built using client SDK. However, when I followed those instructions doesn’t work for Video SDK. I am also not sure which is the right payload structure…  
The tutorial says

“appKey”: “string”,  
“iat”: 0,  
“exp”: 0,  
“tokenExp”: 0

and the documentation says([https://marketplace.zoom.us/docs/sdk/video/auth#jwt-1](https://marketplace.zoom.us/docs/sdk/video/auth#jwt-1))

```auto
{
  "app_key": "SDK_KEY",
  "version": 1,
  "user_identity": "User ID",
  "iat": 0, //Provide the current timestamp as the value of this field.
  "exp": 0, //Timestamp expiration date (Max: 2 days) in epoch format.
  "tpc": "Session name, cannot be empty (Max: 200 characters)"
}

The error code returned is 7 ( ZoomInstantSDKErrors_Invalid_Parameter). how do I get more details on which parameters are wrong?
```

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 1, 2021, 8:54pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/4 "2021-06-01T20:54:00Z")

</div>

Hey @gp583101,

The payload contains the “tpc” field is the correct one for the Video SDK. I took a look at your code, is initializeSDK being called before JoinSession? I am guessing that there is a race condition between your joinSession call and the SDK initializing.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 1, 2021, 9:57pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/5 "2021-06-01T21:57:07Z")

</div>

The print message indicate, InitializeSDK first and then failed to join the session. Its clear that SDK is initialized and then called JoinSession.

Any other ways to debug this issue further.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 2, 2021, 6:31pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/6 "2021-06-02T18:31:41Z")

</div>

Hey @gp583101,

Hmm, can you send me your SDK logs in an email to [DeveloperSupport@zoom.us](mailto:DeveloperSupport@zoom.us)? Please provide a link to this post and I will follow up with you there.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 3, 2021, 5:11pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/7 "2021-06-03T17:11:00Z")

</div>

OK, I sent you email to [DeveloperSupport@zoom.us](mailto:DeveloperSupport@zoom.us).  
please let me know if you need further details to address this issue.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 3, 2021, 6:28pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/8 "2021-06-03T18:28:38Z")

</div>

Hey @gp583101,

Thanks! I will follow up with you there.

Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 4, 2021, 12:11am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/9 "2021-06-04T00:11:52Z")

</div>

I sent you the log files, let me know if you received them or not. some times attachments go in to spam or filtered.

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 4, 2021, 8:09pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/10 "2021-06-04T20:09:56Z")

</div>

Any update on this issue? I am blocked and unfortunately not able to proceed further with out resolving this issue.

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 4, 2021, 8:22pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/11 "2021-06-04T20:22:11Z")

</div>

Hey @gp583101,

Yes we have received the logs and the engineers are investigating.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 4, 2021, 8:23pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/12 "2021-06-04T20:23:18Z")

</div>

@Michael_Condon Thanks for the update

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 7, 2021, 5:55pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/13 "2021-06-07T17:55:02Z")

</div>

Any update please? I am blocked on this issue and unable to make progress. Any thing else I should try or you need additional info ?

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 8, 2021, 7:36pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/14 "2021-06-08T19:36:18Z")

</div>

Hey @gp583101,

I looked at your code and there is a race condition between initializing the SDK and calling joinSession(). Your application is initializing the SDK successfully, however it isn’t waiting to attempt to join the session. In your main function your are initializing the exampleListener and then immediately attempting to join the session. Try moving your call to joinSession into the success part of your initialization.

To see what I am talking about, set a breakpoint on the line in your main function that calls join session and then run. The output will only show “Hello world” meaning that join session is called before the SDK has finished initializing.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 10, 2021, 4:49am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/15 "2021-06-10T04:49:41Z")

</div>

Thanks Michael.

I did try as you suggested and I am still running in the same issue. here is the code at a high level.  
// InitializeSDK()  
ZoomInstantSDKInitParams initParams  
m\_pInstantSDK = CreateZoomInstantSDKObj();  
int returnVal = m\_pInstantSDK-\>initialize(initParams);

In side the success part, JoinSession function called.  
The JoinSession code includes  
ZoomInstantSDKSessionContext sessionContext  
// initialized the sessionContext elements.  
IZoomInstantSDKSession\* pSession = m\_pInstantSDK-\>joinSession(sessionContext);

Every step of the code I have printfs to make sure the code is executed as expected. The print out is

- CreateZoomInstantSDKObj done
- m\_pInstantSDK initialzie is success
- sessonContext elements are initialized
- JoinSession failed
- Error code returned - 7.

I also tried by adding 1 to 5 seconds delay in the code after initialize.

Every time, I run in to the same problem. I hope this helps. Happy to share more details to help root cause the issue.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 10, 2021, 6:13pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/16 "2021-06-10T18:13:22Z")

</div>

Hey @gp583101,

Ok, keep the joinSession call there and try removing the line that sets the password for the session.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![gp583101](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gp583101](https://devforum.zoom.us/u/gp583101)\
**Post date:** [June 13, 2021, 2:39am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/17 "2021-06-13T02:39:07Z")

</div>

Thanks. Finally it worked. JoinSession call is successful after removing the line ```  
“sessionContext.sessionPassword = L"Session password”.

I have added it in the first place as per the documentation.

> **[Create, join, and leave a session - Essential - Windows - Video SDKs - Zoom...](https://marketplace.zoom.us/docs/sdk/video/windows/essential/create-join-session)**
>
> Create, join, and leave a session
> 
> Sessions are the fundamental building blocks of the Video SDK. A session connects two or more users to communicate wi...

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 14, 2021, 10:32pm UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/18 "2021-06-14T22:32:59Z")

</div>

Hey @gp583101,

Awesome! I am happy to hear it is working now. However, that is strange that setting the password broke this. We will investigate what is wrong there.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 15, 2021, 8:33am UTC](https://devforum.zoom.us/t/failed-to-join-session/51406/19 "2021-07-15T08:33:37Z")

</div>

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