Lua Module Uuid Not Found
Introduction
When running a server on a Debian 12 VM, you may encounter an error related to the Lua module uuid
. This error can be frustrating, especially if you've installed the lua-uuid
package using luarocks
. In this article, we'll delve into the possible causes of this issue and provide step-by-step solutions to resolve it.
System Information
Before we dive into the troubleshooting process, let's take a look at the system information:
sudo luarocks install lua-uuid
lua -v
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-14)
Log of Server Run
The error message is as follows:
~/src/spaghettimod$ ./sauer_server
Trying to load the debugger...
Debugger v1.4.0
Debugger: Trying to connect to 127.0.0.1:10000 ...
Debugger: Failed to connect to 127.0.0.1:10000 (connection refused)
Sun May 4 08::19 2025 | Error running script/bootstrap.lua: ./script/std/uuid.lua:7: module 'uuid' not found:
no field package.preload['uuid']
no file './script/uuid.lua'
no file '/usr/local/share/lua/5.2/uuid.lua'
no file '/usr/local/share/lua/5.2/uuid/init.lua'
no file '/usr/local/lib/lua/5.2/uuid.lua'
no file '/usr/local/lib/lua/5.2/uuid/init.lua'
no file '/usr/share/lua/5.2/uuid.lua'
no file '/usr/share/lua/5.2/uuid/init.lua'
no file './uuid.lua'
no file '/usr/local/lib/lua/5.2/uuid.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/uuid.so'
no file '/usr/lib/lua/5.2/uuid.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './uuid.so' {
stack traceback:
[C]: in function 'require'
./script/std/uuid.lua:7: in main chunk
[C]: in function 'require'
./script/std/iterators.lua:9: in main chunk
[C]: in function 'require'
script/load.d/100-extinfo-noip.lua:7: in main chunk
[C]: in function 'dofile'
script/bootstrap.lua:87: in main chunk
[C]: in ?
}
It's unlikely that the server will function properly.
Sun May 4 08:34:19 2025 | looking up master.sauerbraten.org...
Sun May 4 08:34:19 2025 | dedicated server started, waiting for clients...
Sun May 4 08:34:19 2025 | master server connected
Troubleshooting Steps
1. Verify Lua Version
First, let's verify the Lua version installed on your system:
lua -v
In this case, the output is:
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
2. Check Lua Module Path
Next, let's check the Lua module path:
package.path = package.path .. ";./?.lua"
This will add the current directory to the module path.
3. Install Lua-UUID Package
We've already installed the lua-uuid
package using luarocks
:
sudo luarocks install lua-uuid
4. Verify UUID Module Installation
Let's verify that the uuid
module is installed correctly:
require("uuid")
If the module is installed correctly, this should not throw any errors.
5. Check for Conflicting Modules
It's possible that there are conflicting modules installed on your system. Let's check for any conflicting modules:
for _, module in pairs(package.loaded) do
if module:match("^uuid") then
print(module)
end
end
This will print out any modules that match the uuid
pattern.
6. Reinstall Lua-UUID Package
If none of the above steps resolve the issue, let's try reinstalling the lua-uuid
package:
sudo luarocks uninstall lua-uuid
sudo luarocks install lua-uuid
7. Check for System-Wide Lua Module Path
It's possible that the system-wide Lua module path is not set correctly. Let's check for this:
print(package.path)
This will print out the system-wide Lua module path.
8. Set System-Wide Lua Module Path
If the system-wide Lua module path is not set correctly, let's set it manually:
package.path = "/usr/local/share/lua/5.2/?.lua;" .. package.path
This will add the system-wide Lua module path to the module path.
9. Reinstall Lua-UUID Package (Again)
If none of the above steps resolve the issue, let's try reinstalling the lua-uuid
package again:
sudo luarocks uninstall lua-uuid
sudo luarocks install lua-uuid
Conclusion
Q: What is the Lua module UUID?
A: The Lua module UUID is a library that provides functions for generating and manipulating universally unique identifiers (UUIDs). UUIDs are 128-bit numbers that are used to identify objects in a unique and persistent way.
Q: Why am I getting the "module 'uuid' not found" error?
A: There are several reasons why you might be getting this error. Some possible causes include:
- The
lua-uuid
package is not installed correctly. - The
uuid
module is not in the Lua module path. - There are conflicting modules installed on your system.
- The system-wide Lua module path is not set correctly.
Q: How do I install the lua-uuid package?
A: You can install the lua-uuid
package using luarocks
:
sudo luarocks install lua-uuid
Q: How do I verify that the uuid module is installed correctly?
A: You can verify that the uuid
module is installed correctly by running the following code:
require("uuid")
If the module is installed correctly, this should not throw any errors.
Q: How do I check for conflicting modules?
A: You can check for conflicting modules by running the following code:
for _, module in pairs(package.loaded) do
if module:match("^uuid") then
print(module)
end
end
This will print out any modules that match the uuid
pattern.
Q: How do I set the system-wide Lua module path?
A: You can set the system-wide Lua module path by running the following code:
package.path = "/usr/local/share/lua/5.2/?.lua;" .. package.path
This will add the system-wide Lua module path to the module path.
Q: How do I reinstall the lua-uuid package?
A: You can reinstall the lua-uuid
package by running the following commands:
sudo luarocks uninstall lua-uuid
sudo luarocks install lua-uuid
Q: Why is the lua-uuid package not working on my system?
A: There are several reasons why the lua-uuid
package might not be working on your system. Some possible causes include:
- The
lua-uuid
package is not compatible with your version of Lua. - The
lua-uuid
package is not installed correctly. - There are conflicting modules installed on your system.
- The system-wide Lua module path is not set correctly.
Q: How do I troubleshoot the lua-uuid package?
A: You can troubleshoot the lua-uuid
package by following the steps outlined in this article. Some additional steps you can take include:
- Checking the Lua version installed on your system.
- Verifying that the
uuid
module is installed correctly. - Checking for conflicting modules.
- Setting the system-wide Lua module path.
- Reinstalling the
lua-uuid
package.
Conclusion
In this article, we've some common questions related to the lua-uuid
module not found error. We've covered topics such as installing the lua-uuid
package, verifying the uuid
module installation, checking for conflicting modules, setting the system-wide Lua module path, and reinstalling the lua-uuid
package. By following these steps, you should be able to resolve the lua-uuid
module not found error and get your server up and running.