[Lobby]: NoOpenLobbies, (16006). Message: failed to find any open lobbies matching the search criter

Hello I have the following code:

private async void LookingForLobby()
    {
        try
        {
            QuickJoinLobbyOptions options = new QuickJoinLobbyOptions();
           
            // options.Filter = new List<QueryFilter>()
            // {
            //     new QueryFilter(
            //         field: QueryFilter.FieldOptions.MaxPlayers,
            //         op: QueryFilter.OpOptions.EQ,
            //         value: "2")
            // };
           
            Lobby lobby = await LobbyService.Instance.QuickJoinLobbyAsync(options);


        }
        catch (LobbyServiceException e)
        {
            Debug.Log(e);
            if (e.Reason == LobbyExceptionReason.LobbyConflict)
            {
               
            }
        }
    }

The problem is that it throws an error even if is inside the try-catch:
[Lobby]: NoOpenLobbies, (16006). Message: failed to find any open lobbies matching the search criteria

The “reason” inside the LobbyServiceException is that there is no lobby, but I should be able to get into the Catch and not throw any error.

Maybe Lobby lobby = await Lobbies.Instance.QuickJoinLobbyAsync(options); instead of
Lobby lobby = await LobbyService.Instance.QuickJoinLobbyAsync(options);

Nope, same error, and btw the official documentation says to use the
LobbyService.Instance.QuickJoinLobbyAsync(options) method.

I am using Lobbies and It also doesn’t get into the catch. Why does it matter if it logs an error or no?

In my game, it does what is in the catch and also throws an exception

You seamply should have errors your code, and since I’m using the official API this shouldn’t happen. I wanted to know if the API is broken or if I’m doing something wrong

I have the same problem. I follow this tutorial;

I use parrelsync. Both project copies create a new lobby. Sometimes they find the best region different.

Even QueryLobbiesAsyncfind a lobby, QuickJoinLobbyAsync can not find a lobby.

List<Lobby> lobbies = (await LobbyService.Instance.QueryLobbiesAsync()).Results;
                foreach (Lobby lobby2 in lobbies)
                {
                    Debug.Log(lobby2.LobbyCode);
                }

Authenticating anonymously generates the same Player Id on 2 unity projects. Can this cause that problem?

I don’t know what parralel sync is, but QuickJoinLobby works for me on different devices.

ParrelSync clones your unity project. You can run 2 instances of your project to test multiplayer without building it.

https://github.com/VeriorPies/ParrelSync

1 Like

@Max_power1965_1 - Correct me if I’m wrong, I think that you’re just referring to the fact that an error message gets logged in the console even though you’re catching the exception, right? If so, this is a know issue. The Lobby SDK is a little aggressive with logging errors in ADDITION to throwing exception for you to catch. We’re making some adjustments to prevent it from logging theses errors automatically. For now, as long as you’re catching the exception, you can just ignore that additional (but annoying) error log.

@atmuc - You can’t QuickJoin a lobby if you’re the “host” of the lobby (e.g. if the HostId property of the Lobby is the same as the logged in Player ID). The Lobby service will filter out all lobbies that you’re the host of so you’ll see the error “can not find a lobby” even though QueryLobbiesAsync will still return that lobby.

I believe that by default ParrelSync will log you in with the same user. There’s an extra flag, or some property you need to set in one of the instances to force it to use a different Anonymous user, and then QuickJoin should work properly.

1 Like

I’ve created a branch in the Lobby sample project that shows how you can use the ClonesManager in ParrelSync to automatically switch profiles when using a parrelsync clone: GitHub - Unity-Technologies/com.unity.services.samples.game-lobby at feat/parrelsync

The most important part is this bit here: Comparing main...feat/parrelsync · Unity-Technologies/com.unity.services.samples.game-lobby · GitHub

Let me know if this sample is helpful for you and we’ll consider merging it into the main branch.

3 Likes