General > Developers Corner

Lua Error - log.lua

(1/3) > >>

sabo:
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.


--- Code: ---19:34:37 Lua Error: addons/ulx/lua/ulx/log.lua:440: attempt to index local 'format' (a nil value)
--- End code ---

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 ;)

Megiddo:
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.

sabo:

--- Quote from: Megiddo on September 20, 2013, 05:13:54 PM ---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.

--- End quote ---

What do you mean by "full stack trace" ?

I checked FAQ but didnt see anything in the titles :o

MrPresident:
In this example the ERROR would be:

--- Code: ---[ERROR] gamemodes/sgstranded/gamemode/sv_exp.lua:10: attempt to index field 'exp' (a nil value)
--- End code ---

The full stack trace for that error would be:

--- Code: ---[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

--- End code ---

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.

sabo:
Ohh okay!

Well there is nothing additional to that 1 error but I found this one here:

--- Code: ---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
--- End code ---

This is line 459 - 466

--- Code: ---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 )

--- End code ---

And this is the hook.lua:

--- Code: ---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
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version