Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unidentified issue with ULX / Ulib (?) #117

Open
maxrr opened this issue Nov 23, 2017 · 10 comments
Open

Unidentified issue with ULX / Ulib (?) #117

maxrr opened this issue Nov 23, 2017 · 10 comments
Assignees
Labels
bug

Comments

@maxrr
Copy link

@maxrr maxrr commented Nov 23, 2017

Steps to reproduce

  1. Own a server for about two years
  2. Have everything work completely fine
  3. Leave for an hour one Wednesday afternoon
  4. Profit.

I really am not aware of any circumstances upon which this issue is presented. I am dreadfully sorry, I know that these steps can make the difference between making this issue solvable or not.

Expected behavior

Players are able to join and leave as they normally do without console errors.

Actual behavior

As players join and leave, an error message is presented in the console of all online players, as well as twice in the connecting player's console.

Error(s) in server console, if any

There are no errors printed in the server console.

Error(s) in player's console, if any

[ERROR] lua/includes/extensions/table.lua:50: bad argument #1 to 'pairs' (table expected, got nil)
  1. pairs - [C]:-1
   2. Empty - lua/includes/extensions/table.lua:50
    3. fn - addons/ulx/lua/ulx/modules/cl/xgui_client.lua:429
     4. func - addons/ulib/lua/ulib/client/cl_util.lua:22
      5. unknown - lua/includes/extensions/net.lua:32

This message is printed twice in the client's console. This message is also printed to all other connected players when another player connects or disconnects.

Version

Running "ulx version" in console resulted in the "Invalid command entered" message. This is very frustrating, because I JUST updated both ulib and ulx from their respective repositories not minutes before posting this. From the XGUI, I can tell that I'm running ULX v3.62, and ULib v2.63.

Thank you for taking your time to read this over, I'm sincerely overwhelmed with the possibilities of what this error could be. I again apologize for not presenting concrete steps, but that's because I really don't know how to reproduce the error. My list of addons is below.

  • atlaschat
  • banmsg
  • builder-x
  • cac
  • CustomCommands (ulx command extension, no prior problems)
  • libk
  • pointshop2
  • pointshop2trading
  • ps2_drops
  • ps2_permaweaps
  • reality_boards (custom, no prior problems)
  • reality_hud (custom, no prior problems)
  • reality_signature (custom, no prior problems)
  • sh_lounge_scoreboard
  • simplespawnzones
  • uclip (yay)
  • ulib
  • ulx
  • utime

If there's any other information I can provide, please let me know and I will be more than willing to answer any questions.

@maxrr
Copy link
Author

@maxrr maxrr commented Nov 23, 2017

This problem has been resolved by once again reinstalling ULX. Not sure why reinstalling it a second time would fix it, but it did. Hooray.

@maxrr maxrr closed this Nov 23, 2017
@SticklyMan
Copy link
Contributor

@SticklyMan SticklyMan commented Nov 23, 2017

Was just digging into this, line 429 of xgui_client.lua didn't have have a call to .Empty since May 2015, so you were definitely running an old version. It's likely you got the latest version now. Glad you figured it out! 👍

@maxrr
Copy link
Author

@maxrr maxrr commented Nov 23, 2017

Yep, unfortunately (and I do mean unfortunately), the problem has restarted again. This time it is on line 464 of the xgui_client.lua file.

In good news, ULX seems to run faster than ever! I don't think I had ever updated ULX, pretty embarrassing.

@maxrr maxrr reopened this Nov 23, 2017
@Nayruden
Copy link
Member

@Nayruden Nayruden commented Nov 23, 2017

When you reinstalled, did you delete all existing ulx/ulib files out of addons? Sometimes older files can stick around and cause issues.

@maxrr
Copy link
Author

@maxrr maxrr commented Nov 23, 2017

Yes, I removed the ulx and ulib files from the server's gmod/addons directory, if that's what you're asking, I then reinstalled them.

If you're wondering whether I removed all related files out of other addon folders, I did not.

@maxrr
Copy link
Author

@maxrr maxrr commented Nov 25, 2017

I just looked at line 464 and it's using the same function as before (table.Empty()), which is a basegame function. This doesn't make sense to me as to why it is still erroring. I assure you that I am up-to-date. (I still can't believe that I hadn't updated since May 2015)

@maxrr
Copy link
Author

@maxrr maxrr commented Nov 25, 2017

I tried commenting out line 464 (table.Empty()), and I was met with this completely new error. It looks like xgui.data[datatype] is not a valid table, or does not exist.

[ERROR] lua/includes/extensions/table.lua:81: attempt to index local 'dest' (a nil value)
  1. Merge - lua/includes/extensions/table.lua:81
   2. fn - addons/ulx/lua/ulx/modules/cl/xgui_client.lua:465
    3. func - addons/ulib/lua/ulib/client/cl_util.lua:22
     4. unknown - lua/includes/extensions/net.lua:32

Update: I have managed to subside the original (and subsequent second) error message after changing THIS:

table.Empty( xgui.data[datatype] )
table.Merge( xgui.data[datatype], data )
xgui.callUpdate( datatype, "clear" )
xgui.callUpdate( datatype, "process", data )
xgui.callUpdate( datatype, "done" )

to THIS:

if xgui.data[datatype] then
	table.Empty( xgui.data[datatype] )
	table.Merge( xgui.data[datatype], data )
	xgui.callUpdate( datatype, "clear" )
	xgui.callUpdate( datatype, "process", data )
	xgui.callUpdate( datatype, "done" )
end

An extremely minor change, but a welcome one. I do not know about any impact that this may have, but I will update this as it continues. For now, I will consider this problem closed.

Thank you for your help :)

@maxrr maxrr closed this Nov 25, 2017
@SticklyMan
Copy link
Contributor

@SticklyMan SticklyMan commented Nov 26, 2017

I've seen this issue pop up long ago, but I can't remember if I ever figured anything out relating to it. The most likely cause is that the server is trying to send data down to users before their XGUI client code is fully initialized, which is likely a bug on my end in any number of spots. That doesn't quite fully explain why the error will show up for everybody, though...

Your fix will definitely suppress the error, but without knowing what data might be missing (it's likely the data gets resent right away). I'm going to reopen this issue for my own tracking.

If you don't mind, you can try adding an else clause to dump some additional data for us to look at. Something like this should work:

if xgui.data[datatype] then
	table.Empty( xgui.data[datatype] )
	table.Merge( xgui.data[datatype], data )
	xgui.callUpdate( datatype, "clear" )
	xgui.callUpdate( datatype, "process", data )
	xgui.callUpdate( datatype, "done" )
else
	print("---------- ULX #117 DEBUG ----------")
	print(datatype)

	--The following two sets might dump a lot of data, but may give us more clues.
	--print("Current Data:")
	--PrintTable(data)

	--print("Existing Data:")
	--PrintTable(data)
end
@SticklyMan SticklyMan reopened this Nov 26, 2017
@SticklyMan SticklyMan self-assigned this Nov 26, 2017
@SticklyMan SticklyMan added the bug label Nov 26, 2017
@maxrr
Copy link
Author

@maxrr maxrr commented Nov 28, 2017

Got it. I'll do that soon. Thank you for looking into this :)

@SticklyMan
Copy link
Contributor

@SticklyMan SticklyMan commented Feb 11, 2018

@RealityIsnt Any further news on this issue? There's a very very small chance that I changed something that may solve this issue (latest commits on ulib/ulx master).

.. I'm also suspecting it could have been a temporary autorefresh issue- did you happen to edit any ULX-related files for any reason, and did you make sure to run a changelevel after applying updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.