Ulysses
General => Developers Corner => Topic started by: sabo on September 20, 2013, 04:30:10 PM
-
Hey guys.
Recently I have been getting this error in my server web console. It does not spamm like , but it pops up rather often and it annoys me to be honest.
19:34:37 Lua Error: addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
I do not know why or how this error gets created so I can only give you the information above for now.
I am really tired and it is 2 am here lol, so good night for now ;)
-
We would need the full stack trace to be of any help to you. I suspect this is caused by one of your third-party addons to ULX, though.
-
We would need the full stack trace to be of any help to you. I suspect this is caused by one of your third-party addons to ULX, though.
What do you mean by "full stack trace" ?
I checked FAQ but didnt see anything in the titles :o
-
In this example the ERROR would be:
[ERROR] gamemodes/sgstranded/gamemode/sv_exp.lua:10: attempt to index field 'exp' (a nil value)
The full stack trace for that error would be:
[ERROR] gamemodes/sgstranded/gamemode/sv_exp.lua:10: attempt to index field 'exp' (a nil value)
1. GetTotalXP - gamemodes/sgstranded/gamemode/sv_exp.lua:10
2. unknown - gamemodes/sgstranded/gamemode/sv_savesystem.lua:248
It allows us to see what is causing the error and where it is coming from.
For example: In my stack trace above we can see that line 248 in sv_savesystem.lua is calling GetTotalXP which is calling exp on line 10 of sv_exp.lua. This makes detecting/replicating/and debugging the error much easier than just having the error alone.
-
Ohh okay!
Well there is nothing additional to that 1 error but I found this one here:
17:10:08 Lua Error: [ERROR] addons/pointshopmaster/lua/sv_player_extension.lua:460: attempt to index global 'g_Player' (a nil value)
1. fn - addons/pointshopmaster/lua/sv_player_extension.lua:460
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
This is line 459 - 466
function PS_ServerChangeMap()
for k, v in pairs( g_Player.GetAll() ) do
-- Save the player's data so that it doesn't reset next map.
v:PS_Save()
end;
end
hook.Add( "ShutDown", "PS_ServerChangeMap", PS_ServerChangeMap )
And this is the hook.lua:
function Call( name, gm, ... )
for i = 1, #resort do
sortHooks( resort[ i ] )
end
resort = {}
-- If called from hook.Run then gm will be nil.
if gm == nil and gmod ~= nil then
gm = gmod.GetGamemode()
end
local HookTable = Hooks[ name ]
if HookTable then
local a, b, c, d, e, f
for k=1, #HookTable do
v = HookTable[ k ]
if not v then
-- Nothing
else
-- Call hook function
if isstring( v.name ) then
a, b, c, d, e, f = v.fn( ... ) -- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::This is line 183
else
-- Assume it is an entity
if IsValid( v.name ) then
a, b, c, d, e, f = v.fn( v.name, ... )
else
table.insert( resort, name )
end
end
if a ~= nil then
-- Allow hooks to override return values if it's within the limits (-20 and 20 are read only)
if v.priority > -20 and v.priority < 20 then
return a, b, c, d, e, f
end
end
end
end
end
if not gm then return end
local GamemodeFunction = gm[ name ]
if not GamemodeFunction then
return
end
-- This calls the actual gamemode function - after all the hooks have had chance to override
return GamemodeFunction( gm, ... )
end
-
We modify hook.lua, but the error is really due to sv_player_extension in this case.
-
We modify hook.lua, but the error is really due to sv_player_extension in this case.
Youre right, I just had to replace the "g_player" with "player" ^^ thx
-
10:03:41 Lua Error: [ERROR] addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
1. fancyLogAdmin - addons/ulx/lua/ulx/log.lua:440
2. fancyLog - addons/ulx/lua/ulx/log.lua:504
3. call - addons/ulx/lua/ulx/modules/sh/chat.lua:35
4. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
5. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
6. Run - lua/includes/modules/concommand.lua:69
7. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
8. unknown - lua/includes/modules/concommand.lua:69
10:04:17 Lua Error: [ERROR] addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
1. fancyLogAdmin - addons/ulx/lua/ulx/log.lua:440
2. fancyLog - addons/ulx/lua/ulx/log.lua:504
3. call - addons/ulx/lua/ulx/modules/sh/chat.lua:35
4. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
5. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
6. Run - lua/includes/modules/concommand.lua:69
7. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
8. unknown - lua/includes/modules/concommand.lua:69
10:04:25 Lua Error: addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
10:04:40 Lua Error: addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
I think I was getting excited too early O.o
I feel like it has alot to do with this, please compare my version I used and the version of Mr. President:
http://forums.ulyssesmod.net/index.php/topic,6657.msg32322.html#msg32322
thanks!
-
You're not defining format anywhere.
-
18:14:27 Lua Error: addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
I have been searching through my console/logs to find anything but that is the only that gets spammed like crazy :(
Should I try using the normal ULX version instead of the SVN?
-
No... this error is coming from the code you modified, not any of the default ULX code.
-
I just got this little sweetie here:
[ERROR] addons/ulx/lua/ulx/modules/sh/chat.lua:25: attempt to call method 'Team' (a nil value)
1. call - addons/ulx/lua/ulx/modules/sh/chat.lua:25
2. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
4. unknown - lua/includes/modules/concommand.lua:69
It is 100% the admin chat tho.
-
Sabo, this is not coming from our chat.lua. Line 25 is [[format = "#P to admins: #s"]]. I suggest reverting back to default code.
-
This is from the modified ulx.asay code I posted in another thread.
I never intended for the code to be run by console and since the isn't a player and has no team, it's throwing this error.
I'm working with him to fix it.
-
So far Mr. President made this:
------------------------------ Asay ------------------------------
local seeasayAccess = "ulx seeasay"
if SERVER then ULib.ucl.registerAccess( seeasayAccess, ULib.ACCESS_OPERATOR, "Ability to see 'ulx asay'", "Other" ) end -- Give operators access to see asays echoes by default
function ulx.asay( calling_ply, message )
print(calling_ply)
local players = player.GetAll()
if calling_ply then
for i=#players, 1, -1 do
local v = players[ i ]
if ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then
if ULib.ucl.query( calling_ply, seeasayAccess ) then
ULib.tsayColor(v, 1, Color(65,105,225), "::Admin:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(112,138,144), ": ", message ) ----------- This is line 30
else
ULib.tsayColor(v, 1, Color(0,0,0), "::User:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(119,136,153), ": ", message )
end
end
if v == calling_ply then
ULib.tsayColor(v, 1, Color(49,79,79), "::To Admins:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(112,138,144), ": ", message )
end
end
local logFile = ulx.convar( "logFile", "1", "Log to file (Can still echo if off). This is a global setting, nothing will be logged to file with this off.", ULib.ACCESS_SUPERADMIN )
if logFile:GetBool() then
ulx.logString( calling_ply:Nick() .. " to admins: " .. message, true )
end
else
for i=#players, 1, -1 do
local v = players[ i ]
ULib.tsayColor(v, 1, Color(80,80,80), "::Console to admins:: ", Color(112,138,144), ": ", message )
end
local logFile = ulx.convar( "logFile", "1", "Log to file (Can still echo if off). This is a global setting, nothing will be logged to file with this off.", ULib.ACCESS_SUPERADMIN )
if logFile:GetBool() then
ulx.logString( "Console to admins: " .. message, true )
end
end
end
local asay = ulx.command( CATEGORY_NAME, "ulx asay", ulx.asay, "@", true, true )
asay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
asay:defaultAccess( ULib.ACCESS_ALL )
asay:help( "Send a message to currently connected admins." )
And this is the error I am getting:
[NULL Entity]
L 10/08/2013 - 14:16:38: Lua Error:
[ERROR] addons/ulx/lua/ulx/modules/sh/chat.lua:30: attempt to call method 'Team' (a nil value)
1. call - addons/ulx/lua/ulx/modules/sh/chat.lua:30
2. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
4. unknown - lua/includes/modules/concommand.lua:69