question

Caner Kara avatar image
Caner Kara asked

ConnectionNotFoundForEntity error with PubSub service

Hi, we would like to use Lobby and Matchmaking services for a p2p Unity game. Since our target platforms are iOS and Android it seems we can't use Client SDK for real time notifications. I guess polling with REST API solution has limitations too. The only solution which is left is SignalR service.

Here is the overall flow:

  1. client logins
  2. initialize SignalR based on docs and an another question
    1. build hub connection
    2. subscribe to ReceiveMessage and ReceiveSubscriptionChangeMessage on hub
    3. start a session
    4. reach connection handle. (example value is used for traceParent. More clarification for trace parent would be nice.)
  3. create a mathmaking ticket
  4. poll ticket status until matched status
  5. join a arranged lobby after ticket is matched
  6. get lobby ID after joining it
  7. subscribe to LobbyResource with Type = LobbyChanged, ResourceId = [LobbyId] (failure)

Getting "PubSubConnectionNotFoundForEntity /Lobby/SubscribeToLobbyResource: Pubsub exception was thrown. NotFound: ConnectionNotFoundForEntity" API error at step 7.

Tests are done on same machine (Windows 10) with two Unity Editor 2021.3.3f1.

One more thing. We have tried the same approach for ticket status (step 4). Usually face the same error. Sometimes subscription is successful but not getting any message when ticket is matched.

unity3dMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

In my tests, this error occurs when I subscribe to the resource 10 seconds after the lobby is created. If I subscribe immediately, I never get this error. We recommend that you can subscribe to the resource once the resource is created.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Caner Kara avatar image Caner Kara commented ·

I guess you have done your tests with Create Lobby. What about Join Arranged Lobby API? Most of the time even the first member could not subscribe to lobby resource. (in 10 seconds after tickets are matched)

For both API, I think 10 seconds limit is not applicable. Say, I invite my friend to a lobby with connection string. He could not subscribe after 10 seconds?

One more thing. What kind of operations triggers "Lobby Change" message? Even all members subscribe successfully, any of them could get message with "Lobby Data" and "Member Data" updates.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Caner Kara commented ·

I will do more tests about that.

0 Likes 0 ·
Caner Kara avatar image Caner Kara Gosen Gao commented ·

Hi, any news?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.