There are several reasons your lobby might not show up in query results or disappear after a short amount of time.
Check the following if your lobby is not showing up in your query results:
- Ensure the lobby you are creating is not set as a private lobby in the settings. Private lobbies never show up in search results and can only be joined via a join code. See Joining lobbies.
- Ensure you are properly querying for lobbies and not using additional filters that might filter out the lobby you are trying to locate. You can find more information about querying for lobbies and managing filters in the Querying for lobby documentation.
- Ensure the lobby you are trying to query has been properly created. When creating lobbies, you can catch the exception and output any errors to the console as described in the Creating a lobby documentation.
If you are not receiving any errors when creating your lobby but your queries still do not return the desired result, try joining your lobby via Join Code. If joining the lobby is successful, the issue is with how you are performing your query. You can perform additional verification by Getting joined lobbies to verify if the lobby has been joined.
If your lobby first appears after initial creation then disappears within roughly 30 seconds, the issue is likely with your lobby heartbeat. After lobby creation, hosts must send a keep-alive message known as a heartbeat within 30 seconds or the lobby will be marked as inactive and not show up in search results. For more information on how to configure heartbeats, see Heartbeating a lobby.