LibK icon indicating copy to clipboard operation
LibK copied to clipboard

A couple of issues.

Open inthenightsky opened this issue 5 years ago • 7 comments

I have the latest version of LibK, downloaded from GitHub. I have the latest version of Pointshop2, downloaded from GmodStore. I have the latest version of PAC3, downloaded from GitHub as well.

I've configured my database settings in libk/lua/libk/server/sv_libk_config.lua, and they're valid.

I'm using the mysqloo module if it makes any difference.

Client "Night" connected (xx.xx.xx.xx:xx). Odd Error in DB, invalid database LibK [ERROR] addons/libk/lua/libk/server/sv_libk_model.lua:20: attempt to index a nil value

  1. prepareForSQL - addons/libk/lua/libk/server/sv_libk_model.lua:20
  2. findAllDbByField - addons/libk/lua/libk/server/sv_libk_model.lua:241
  3. findByPlayer - addons/libk/lua/libk/server/sv_libk_model.lua:554
  4. fn - addons/libk/lua/libk/server/sv_libk_player.lua:3
  5. unknown - addons/ulib/lua/ulib/shared/hook.lua:109 GLib.Resources : Compressing resource LuaPack/GLib took 197.06 ms (827.73 KiB to 110.94 KiB). WARNIG: uncaught error in Promise: Disconnected 1: (_ = GLib.PlayerMonitor, ply = Entity (1) --[[ x, Night ]], userId = "x") [addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_shop.lua: 18] 2: xpcall (GLib.Error) [[C]: -1] 3: DispatchEvent (self = { GLib.EventProvider: 0xf164af18 }, eventName = "PlayerDisconnected", GLib.PlayerMonitor, Entity (1) --[[ x, Night ]], "x") [addons/libk/lua/libk/3rdparty/glib/events/eventprovider.lua: 86] 4: fn (data = { table: 0xea51ae38 }) [addons/libk/lua/libk/3rdparty/glib/garrysmod/servers/playermonitor.lua: 60] 5: (name = "player_disconnect", gm = _R._LOADED.team:GAMEMODE, { table: 0xea51ae38 }) [addons/ulib/lua/ulib/shared/hook.lua: 109] Dropped Night from server (Disconnect by user.)

If you need further information feel free to ask, very confused on what I need to do to fix it.

inthenightsky avatar May 08 '19 16:05 inthenightsky

If I install the folder as LibK-master, it'll throw this to the client console (notably nothing serverside):

[ERROR] addons/pointshop2/lua/autorun/pointshop2_init.lua:21: attempt to index global 'LibK' (a nil value)

  1. unknown - addons/pointshop2/lua/autorun/pointshop2_init.lua:21

[ERROR] addons/pointshop2/lua/autorun/ps2_kinv_init.lua:1: attempt to index global 'LibK' (a nil value)

  1. unknown - addons/pointshop2/lua/autorun/ps2_kinv_init.lua:1

Renaming the folder to libk will throw this to the server, but nothing clientside and the gamemode will seem to break:

Odd Error in DB, invalid database LibK [ERROR] addons/libk/lua/libk/server/sv_libk_model.lua:20: attempt to index a nil value

  1. prepareForSQL - addons/libk/lua/libk/server/sv_libk_model.lua:20
  2. findAllDbByField - addons/libk/lua/libk/server/sv_libk_model.lua:241
  3. findByPlayer - addons/libk/lua/libk/server/sv_libk_model.lua:554
  4. fn - addons/libk/lua/libk/server/sv_libk_player.lua:3
  5. unknown - addons/ulib/lua/ulib/shared/hook.lua:109

inthenightsky avatar May 11 '19 23:05 inthenightsky

I'm getting the same error. Any fix?

professormoretzsohn avatar Jul 03 '19 19:07 professormoretzsohn

I was amazed. I thought this project was down cuz the author passed away but seems like the author r still updating ? I dont understand wat happened..

takaqiao avatar Jul 05 '19 03:07 takaqiao

Oh btw after I tried used old libk and found out I cant install default items I tried new one with a new clean mysql db and didnt found the errors u guys said so I guess maybe u guys r not using mysql or not using the clean db :)

takaqiao avatar Jul 05 '19 03:07 takaqiao

Would love to help here but the init code was written 5 years ago and I have no idea what this could be. Unfortunately I haven't been able to work on gmod at all for quite some time now. Will happily accept MRs

ValentinFunk avatar Jul 05 '19 06:07 ValentinFunk

Would love to help here but the init code was written 5 years ago and I have no idea what this could be. Unfortunately I haven't been able to work on gmod at all for quite some time now. Will happily accept MRs

Good job. It still work fine in my server :D

takaqiao avatar Jul 17 '19 16:07 takaqiao

For people coming here through google or something, a few things to try if you run into this issues like this:

  1. Turn on LibK Debug and check your logs (especially early logs) for ANY lua errors (even unrelated addons) since in Gmod if there is an error in one init function no others are run. If there is code that errors before LibK is fully initialized, there is a chance that it kills it
  2. Try removing a really large (in terms of number of lua files) addon from your server. Sounds stupid but sometimes issues are caused because GMOD refuses to load random lua files if you have too many.
  3. Reupload everything related to LibK and PS2. If you use FileZilla check the failed transfers tab (it's hard to miss and this has been an issue lots of times). If you're upgrading fully remove the folders before uploading again.
  4. Check and recheck your database settings. This is not usually going to be the problem (LibK will check for correct setup and should provide much more user friendly errors)
  5. Make sure to rename all folders in your addons folder to lowercase (yes, really)

ValentinFunk avatar Jul 17 '19 16:07 ValentinFunk