Nakama not finding any modules

Hey there! I just set up Nakama yesterday and followed a tutorial for setting up authoritative multiplayer in Lua, but Nakama isn’t finding modules. I’m not using docker compose and just using the docker run commands in the docker quickstart. Here is the command that I am running:

docker run --link=db -p 7350:7350 -p 7351:7351 heroiclabs/nakama --database.address root@db:26257 --socket.server_key “my server key” --runtime.path “.\data\modules”

here is when I run tree in my Nakama folder:

C:.
└───data
└───modules

here is Nakama loading the modules folder:

{“level”:“info”,“ts”:“2020-11-17T16:22:28.035Z”,“caller”:“server/runtime.go:503”,“msg”:“Found runtime modules”,“count”:0,“modules”:}

I am not sure why my Lua modules are not being loaded. Thanks in advance.

@FerretCode You’ll probably need to make sure that the Docker volume (virtual filesystem) is able to “see” the filesystem from inside the container. Have you followed the Docker quickstart which shows how to set up the environment with Docker compose and mount the filesystem into the container?

https://heroiclabs.com/docs/install-docker-quickstart/#data

1 Like

Hey, thanks for answering.

I’ll get back to you if it works. :slightly_smiling_face:

It’s still not showing any modules.

@FerretCode Perhaps you could share the updated command you’re running, and what your directory structure looks like - where you’re running your docker command, where the Lua modules are etc? Are you running it from your C:\ path as in your initial post? It’s a little hard to help otherwise.

2 Likes

Sure.

From my root directory here is what the structure looks like.

image

I’m running my command from inside the nakama folder and I switched from the command to docker compose. Here is the volume from my docker-compose.yml.

volumes:
- /c/Users/username/projects/docker:/data

My Lua files are in my modules folder.

So your modules are in C:\nakama\data\modules, but the volume you’re mounting is binding from C:\Users\username\projects\docker to /data inside the container. In that case I would expect your Lua modules to be in C:\Users\username\projects\docker\modules at which point in your container your modules would be in /data/modules. Your runtime path should also be /data/modules and not ./data/modules (absolute, not relative path).

My modules are not actually in C:\nakama\data\modules. The tree module puts my C drive and a dot which I assume means realtive path. They are actually in C:\Users\username\Documents\nakama-project\nakama\data\modules. I updated my volume path to /c/Users/username/Documents/nakama-project/nakama:/data but it still isn’t finding any modules.

Based on your volume mount of /c/Users/username/Documents/nakama-project/nakama:/data and what you say your contents of C:\Users\username\Documents\nakama-project\nakama\data\modules are then inside your container it’ll look like /data/data/modules if I’m not mistaken.

Your C:\Users\username\Documents\nakama-project\nakama becomes /data inside the container. You probably want to mount /c/Users/username/Documents/nakama-project/nakama/data:/data instead and use a runtime path of /data/modules.

1 Like

Thanks so much!