# Unable to matchmake

**URL:** <https://forum.heroiclabs.com/t/unable-to-matchmake/2357>\
**Category:** Local Setup\
**Tags:** getting-started, sdk-unity\
**Created:** [February 12, 2022, 5:16am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357 "2022-02-12T05:16:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProgramPlotam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/programplotam/32/999_2.png) [@ProgramPlotam](https://forum.heroiclabs.com/u/ProgramPlotam)\
**Post date:** [February 12, 2022, 5:16am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/1 "2022-02-12T05:16:02Z")

</div>

Hey everyone,

I’m new to Nakama and have been following the “Nakama in Unity” [playlist](https://www.youtube.com/watch?v=c-5nmkXXWQ8&list=PLOAExZcDNj9tut2gSUlw46OKK4iB--uW1). I managed to get the Nakama server running with Docker and I’m now stuck at the Matchmaking tutorial.

I pressed the “Find Match” button on both instances of the game but I do not get the printed message that happens at 8:22 of the [eighth](https://youtu.be/-ZpmZo6ZvIo?t=502) tutorial. I checked the server console and it did register 2 matchmaking tickets. Below is my script so far:

```auto
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Nakama;

public class NakamaConnection : MonoBehaviour
{
    string scheme = "http";
    string host = "localhost";
    int port = 7350;
    string serverKey = "defaultkey";

    IClient client;
    ISession session;
    ISocket socket;
    string ticket;

    async void Start()
    {
        client = new Client(scheme, host, port, serverKey, UnityWebRequestAdapter.Instance);
        session = await client.AuthenticateDeviceAsync(SystemInfo.deviceUniqueIdentifier);
        Debug.LogFormat("New user: {0}, {1}", session.Created, session);
        socket = client.NewSocket(true);
        socket.ReceivedMatchmakerMatched += OnReceivedMatchkamerMatched;
        await socket.ConnectAsync(session, true);
        
        Debug.Log(socket);
    }

    public async void FindMatch()
    {
        Debug.Log("Finding match");
        var matchmakingTicket = await socket.AddMatchmakerAsync("*", 2, 2);
        ticket = matchmakingTicket.Ticket;
    }

    async void OnReceivedMatchkamerMatched(IMatchmakerMatched MatchmakerMatched)
    {
        Debug.Log("Joining match....");
        var match = await socket.JoinMatchAsync(MatchmakerMatched);
        Debug.Log("Our sessions ID: " + match.Self.SessionId);

        foreach(var user in match.Presences)
        {
            Debug.Log("Connected User Session ID: " + user.SessionId);
        }

    }
}

```

The only other thing I noticed that was different from the video was when it printed my session, the Created property was false instead of true like the video.

```auto
New user: False, Session(AuthToken='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJlZjIyNTVmZS1iZGVjLTRhZWQtOWMwNC0zY2U4MmZhMmNkM2UiLCJ1c24iOiJ4Y0dLU3BYUG9UIiwiZXhwIjoxNjQ0NjUwMDMwfQ.cGBSI8aeUTJv5WLsc9cPXYK0AtNyFQTXT87wvybr81k', 
Created=False, 
CreateTime=50, 
ExpireTime=1644650030, RefreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJlZjIyNTVmZS1iZGVjLTRhZWQtOWMwNC0zY2U4MmZhMmNkM2UiLCJ1c24iOiJ4Y0dLU3BYUG9UIiwiZXhwIjoxNjQ0NjQ2NDMwfQ.Ke-kWDZYp1eSfw2Q2saLK77YbwJyQWQWQUYWR311NKM, 
RefreshExpireTime=1644646430, 
Variables={}, Username='xcGKSpXPoT', UserId='ef2255fe-bdec-4aed-9c04-3ce82fa2cd3e')

```

---

<div class="post-metadata">

**Author:** ![ProgramPlotam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/programplotam/32/999_2.png) [@ProgramPlotam](https://forum.heroiclabs.com/u/ProgramPlotam)\
**Post date:** [February 14, 2022, 3:09am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/2 "2022-02-14T03:09:33Z")

</div>

So I tried testing the matchmaking with the fish-game project and it works! I am also able to do the matchmaking on my own game now using the server that was created from the fish-game project. So there must be something off about my docker-compose.yml. This is mine:

```auto
version: '3'
services:
  cockroachdb:
    image: cockroachdb/cockroach:latest-v20.2
    command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
    restart: "no"
    volumes:
      - data:/var/lib/cockroach
    expose:
      - "8080"
      - "26257"
    ports:
      - "26257:26257"
      - "8080:8080"
  nakama:
    image: heroiclabs/nakama:3.9.0
    entrypoint:
      - "/bin/sh"
      - "-ecx"
      - >
        /nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
        exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --logger.level DEBUG --session.token_expiry_sec 7200 --metrics.prometheus_port 9100
    restart: "no"
    links:
      - "cockroachdb:db"
    depends_on:
      - cockroachdb
      - prometheus
    volumes:
      - /c/Users/Tym/projects/docker:/nakama/data
    expose:
      - "7349"
      - "7350"
      - "7351"
      - "9100"
    ports:
      - "7349:7349"
      - "7350:7350"
      - "7351:7351"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7350/"]
      interval: 10s
      timeout: 5s
      retries: 5
  prometheus:
    image: prom/prometheus
    entrypoint: /bin/sh -c
    command: |
      'sh -s <<EOF
        cat > ./prometheus.yml <<EON
      global:
        scrape_interval: 15s
        evaluation_interval: 15s
      scrape_configs:
        - job_name: prometheus
          static_configs:
          - targets: ['localhost:9090']
        - job_name: nakama
          metrics_path: /
          static_configs:
          - targets: ['nakama:9100']
      EON
      prometheus --config.file=./prometheus.yml
      EOF'
    ports:
      - '9090:9090'
volumes:
  data:

```

This is the one from fish-project:

```auto
version: '3'
services:
  cockroachdb:
    container_name: cockroachdb
    image: cockroachdb/cockroach:v19.2.5
    command: start --insecure --store=attrs=ssd,path=/var/lib/cockroach/
    restart: always
    volumes:
      - data:/var/lib/cockroach
    expose:
      - "8080"
      - "26257"
    ports:
      - "26257:26257"
      - "8080:8080"
  nakama:
    container_name: nakama
    image: heroiclabs/nakama:2.12.0
    entrypoint:
      - "/bin/sh"
      - "-ecx"
      - >
          /nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
          exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257
    restart: always
    links:
      - "cockroachdb:db"
    depends_on:
      - cockroachdb
    volumes:
      - ./nakama/data:/nakama/data
    expose:
      - "7349"
      - "7350"
      - "7351"
    ports:
      - "7349:7349"
      - "7350:7350"
      - "7351:7351"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7350/"]
      interval: 10s
      timeout: 5s
      retries: 5
volumes:
  data:

```

I’ll work using the fish-game’s server in the meantime.

---

<div class="post-metadata">

**Author:** ![mikeful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mikeful/32/978_2.png) [@mikeful](https://forum.heroiclabs.com/u/mikeful)\
**Post date:** [February 14, 2022, 8:46pm UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/3 "2022-02-14T20:46:54Z")

</div>

Containers seem to use different configuration files from different file locations. Can you try to find out if there is some major difference between them?

---

<div class="post-metadata">

**Author:** ![ProgramPlotam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/programplotam/32/999_2.png) [@ProgramPlotam](https://forum.heroiclabs.com/u/ProgramPlotam)\
**Post date:** [February 15, 2022, 8:26am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/4 "2022-02-15T08:26:21Z")

</div>

Are you referring to the nakama:volumes: path?

---

<div class="post-metadata">

**Author:** ![mikeful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mikeful/32/978_2.png) [@mikeful](https://forum.heroiclabs.com/u/mikeful)\
**Post date:** [February 15, 2022, 12:04pm UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/5 "2022-02-15T12:04:42Z")

</div>

Yes. Server will probably try to look for `config.yml` or something similar in mapped directory. You can see which config file is used on first log row after server start.

---

<div class="post-metadata">

**Author:** ![ProgramPlotam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/programplotam/32/999_2.png) [@ProgramPlotam](https://forum.heroiclabs.com/u/ProgramPlotam)\
**Post date:** [February 16, 2022, 8:26am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/6 "2022-02-16T08:26:10Z")

</div>

```auto
{"level":"info","ts":"2022-02-16T08:20:09.956Z","caller":"main.go:104","msg":"Data directory","path":"/nakama/data"}

```

Is this it?

If so, both of the server logs has the same path. However, the folder where I have the `docker-compose.yml` file doesn’t have a nakama folder, it only has a modules folder. Could that be the cause of the problem?

---

<div class="post-metadata">

**Author:** ![zyro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/zyro/32/14_2.png) [@zyro](https://forum.heroiclabs.com/u/zyro)\
**Post date:** [February 17, 2022, 2:38pm UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/7 "2022-02-17T14:38:15Z")

</div>

@ProgramPlotam Can you please update to Nakama 3.10.0 and test again? If I recall correctly there was a matchmaker issue specific to the 3.9.0 release that was fixed in the very next release.

---

<div class="post-metadata">

**Author:** ![ProgramPlotam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/programplotam/32/999_2.png) [@ProgramPlotam](https://forum.heroiclabs.com/u/ProgramPlotam)\
**Post date:** [February 21, 2022, 2:32am UTC](https://forum.heroiclabs.com/t/unable-to-matchmake/2357/8 "2022-02-21T02:32:25Z")

</div>

@zyro Hey thanks for the suggestion. I can finally connect using my own `docker-compose`. Everything looks to be working fine and I’ll be continuing the tutorial. Thank you very much!
