Can't start a session due to 'invalid session key'

Each day, numerous sessions are initiated using a token created using the ‘topic’ and ‘session_key’ parameters. The ‘tpc’ value remains constant, serving as an identifier for a virtual table. The ‘session_key’ value, on the other hand, determines the specific day of the session linked to the tpc. This process functioned smoothly until an issue arose where a session could not be initiated due to an ‘invalid session key’ error. This suggests that the tpc might still be linked to an older session key.

example:
DAY 1
SESSION 1 =>
{
“app_key”: “XXXX”,
“tpc”: “6537e1fe611e3ffae5dbc54d@t0”, → this value does not change over time
“role_type”: 0,
“session_key”: “A#65688f2dcacb8c9f3f80cfc6”, → this value changes at least once per day
“user_identity”: “654b7fac33ebabae2224bcca”,
“version”: 1,
“iat”: 1701351947,
“exp”: 1701359147
}

DAY N

SESSION 1 =>
{
“app_key”: “XXXX”,
“tpc”: “6537e1fe611e3ffae5dbc54d@t0”, → this value does not change over time
“role_type”: 0,
“session_key”: “A#65688f2dcacb8c9f3f80cfc6”, → this value changes at least once per day
“user_identity”: “654b7fac33ebabae2224bcca”,
“version”: 1,
“iat”: 1701351947,
“exp”: 1701359147
}
SESSION 2
{
“app_key”: “XXXX”,
“tpc”: “6537e1fe611e3ffae5dbc54d@t1”,
“role_type”: 0,
“session_key”: “A#65688f2dcacb8c9f3f80cfc6”,
“user_identity”: “654b7faaasdsafe2224bc12g”,
“version”: 1,
“iat”: 1701351947,
“exp”: 1701359147
}

Share the same session key. Session 2 works, Session 1 fails. It doesn’t matters if it session 2 starts after or before attempting the initialization of session 1. The error associated indicate that you can’t join a on going session, however the session never started.

ObjecterrorCode: 200
reason: “invalid session key”
type: “JOIN_MEETING_FAILED”
[[Prototype]]: Object

SDK Version 1.8.10

Note:
Is not the same o similar issue found in => "invalid session key" error on client.join()
we have a unique topic associated to a session key. Then another topic might have the same session key, not the inverse, that is addressed as an error in that post.

Hey @danilo.babaglio

Thanks for your feedback.

Let me understand your process, please correct me if something is wrong.

  • Your intention is to use the same topic for each day’s session, for example: “6537e1fe611e3ffae5dbc54d@t0”, but different session keys for different dates.
  • This process has been running smoothly for some time, but suddenly the ‘invalid session key’ error started occurring.

My suggestion is to check the dashboard and see if the session from the previous day hasn’t ended, causing a conflict with the session key for the current day.

As you mentioned, a topic in progress can only have one session key, so if the previous session with the same topic hasn’t ended, using a new session key will result in an error.

Or could you share the value of x-zm-trackingid field in the wc/lsdk response headers when the issue occurs again?

Thanks
Vic

Hi Vic, Thank you for your response!
My first guess was that there was an ongoing session with that topic, I looked using the dashboard and via API , and there was no session opened. All of the sudden the given topic begun to work , so i can’t recreate the error and check for the values you asked for! Nothing has changed, either way the issue seems to be solved. The worst scenario

It seems like you are encountering an issue with the session key when initiating sessions, and the error is indicating that the session key is invalid. Let’s try to troubleshoot the issue:

  1. Session Key Generation: Ensure that the session key is being generated correctly for each new session. It’s crucial that the session key is unique for each session and changes at least once per day.
  2. Expiration and Timing: Check the expiration time (exp) in your session objects. It seems to be the same across different sessions. Make sure that the expiration time is set appropriately, and the sessions are not expiring before they are supposed to.
  3. Token Validation: Verify that the token you are using to initiate the sessions is valid and not expired. Ensure that the token is generated with the correct parameters, including the updated session key.
  4. Topic and Session Key Association: Confirm that each session key is associated with the correct topic. It seems like you are using the same session key for different topics, which might be causing conflicts. Each session key should be unique to a specific topic.
  5. SDK Version: Check if there are any known issues or updates related to the SDK version (1.8.10) you are using. It’s possible that there might be a bug or a fix in a later version.
  6. Server-Side Validation: Double-check the server-side validation logic for session keys. Ensure that it is correctly checking for the uniqueness of session keys and not erroneously flagging them as invalid.
  7. Error Handling: Ensure that your error-handling mechanism is providing detailed information when the “invalid session key” error occurs. This can help pinpoint the exact issue.
  8. Concurrency Issues: Check for any concurrency issues in your system. Make sure that there are no race conditions or conflicts when generating and validating session keys.

If the issue persists after checking these aspects, you may want to consider reaching out to the SDK’s support or community forums for more specific assistance. Additionally, updating to the latest version of the SDK might resolve any known issues.

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