Jump to content

Stacktrace on clear warnings 2.5.8b2

Work in Progress 2.5.8-beta2 2.5.8-beta4

Possible bug when clearing warnings

Environment: fresh Linux server force updated to the prod Rust release 2 Mar 2023, clean install. Using the GUI version of the plugin.

Plugin version: 2.5.8b2

Issue: stack trace on trying to clear one or all warnings. Warnings are not removed. Warned player does not have any warnings pop up when logging in despite multiple unacknowledged warnings. There is nothing in the console log when the player signs in indicating an issue with displaying the warnings.

Expected behavior: No stack trace and the warning or warnings are removed. Player should see all offline warnings on sign in.

Steps to reproduce: issue one or more warnings of a player. Then try to clear one or more warnings. Check either /warn info or SmartWarnings_PlayerData.json file to see they are not removed

Further details:
Removed serverfiles/oxide/data/SmartWarnings_PlayerData.json to make sure it's not a data file corruption issue.
Using unmodified serverfiles/oxide/config/SmartWarnings.json 

Can create warnings ok using in game /warn as admin player. When trying to clear either an acknowledged or unacknowledged warning with in game /warn, either by id or using all, stack trace happens. When trying by warning ID it says that the dictionary key does not exist, and when using all it says there is not an instance of the object. Attached is the copy of my player data file showing the warnings and the errors I get when running the clear commands. Also, when the offline warned player signs in, they are not getting the UI to acknowledge the warnings. The PlayerData file shows that they are not yet acknowledged despite the player logging in.

Odd additional behavior. After the failed clear attempt and signing in as the warned player, I issued a warning from the console. That did show up to the player who was online at the time. I also noticed that serverfiles/oxide/data/SmartWarnings_PlayerData.json was overwritten (attached). It no longer showed the three unacknowledged warnings, and now only showed the one issued from the console.

 

I am sure I missed some helpful detail, so please let me know what else you require. Thank you!

SmartWarnings report supplemental info 4 Mar 2023.txt

Share this comment


Link to comment

New errors on 2.5.8b3:
#Rolled server back to clean state after 2 Mar 2023 forced wipe updates were applied. Removed all traces of SmartWarnings 2.4.3 (plugin, config, data files)
 

(11:02:48) | SmartWarnings was compiled successfully in 2447ms

(11:02:48) | Loaded plugin SmartWarnings v2.5.8 by FAKENINJA

(11:02:57) | Player 'noadmin' granted permission 'smartwarnings.admin.canclear'

####issued first /warn since server rollback to clean state, the following immediately showed in console. This warning was not recorded at all. Suspicsion is that the datafile was not created and error handling was not in place for this condition

(11:03:07) | [SmartWarnings] [DisplayUnAcknowledgedWarnings] An error occurred that shouldn't happen for 'noadmin' when trying to display warnings

 

System.NullReferenceException: Object reference not set to an instance of an object

at Oxide.Plugins.SmartWarnings.DisplayUnAcknowledgedWarnings (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00018] in <d243f70d10bf413997ec89b60b865cf3>:0

(11:03:52) | [SmartWarnings] [cmdWarnGUI] An unexpected error occurred noadmin executed command warn

args: noplayer testing specific

 

System.NullReferenceException: Object reference not set to an instance of an object

at Oxide.Plugins.SmartWarnings.WarnPlayer (Oxide.Core.Libraries.Covalence.IPlayer targetPlayer, Oxide.Core.Libraries.Covalence.IPlayer adminPlayer, System.String preset) [0x0003f] in <d243f70d10bf413997ec89b60b865cf3>:0

at Oxide.Plugins.SmartWarnings.cmdWarnGUI (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00451] in <d243f70d10bf413997ec89b60b865cf3>:0

####issued another /warn, the following immediately showed in console

(11:04:14) | Player not found

(11:05:20) | Saved 53,408 ents, cache(0.10), write(0.02), disk(0.01).

(11:05:20) | Saving complete

####issued another /warn, the following immediately showed in console

(11:05:49) | Player not found

####issued another console warn, the following immediately showed in console

(11:06:20) | Player not found

####issued another console warn, the following immediately showed in console

(11:06:20) | Player not found

 

 

The player "noplayer" signed in and got only the first warning to acknowledge. The other three "silently" acknowledged:

{
  "adminSteamID": {
    "Name": "noadmin",
    "Count": 0,
    "Points": 0,
    "WarnData": {}
  },
  "765xxxxxxxxxxxx62": {
    "Name": "noplayer",
    "Count": 4,
    "Points": 0,
    "WarnData": {
      "1": {
    "Category": "Specific",
        "Reason": "test",
        "Acknowledged": true,
        "ExpDate": "03/12/2023 11:04:04",
        "WarnDate": "03/05/2023 11:04:04",
        "WarnedBy": "noadmin"
      },
      "2": {
    "Category": "Specific",
        "Reason": "testing specific",
        "Acknowledged": true,
        "ExpDate": "03/12/2023 11:04:14",
        "WarnDate": "03/05/2023 11:04:14",
        "WarnedBy": "noadmin"
      },
      "3": {
    "Category": "Specific",
        "Reason": "test-console",
        "Acknowledged": true,
        "ExpDate": "03/12/2023 11:05:49",
        "WarnDate": "03/05/2023 11:05:49",
        "WarnedBy": "Server Console"
      },
      "4": {
    "Category": "sign",
        "Reason": "§3 - Inappropriate signage",
        "Acknowledged": true,
        "ExpDate": "03/12/2023 11:06:21",
        "WarnDate": "03/05/2023 11:06:21",
        "WarnedBy": "Server Console"
      }
    }
  }
}

Share this comment


Link to comment

Hi @tschetschpi1,

Really appreciate the detailed bug report, it really saves a lot of time debugging.

What can happen if you test things is that you will de-sync the data file with the plugin since the plugin holds some of it in memory. So if you clean the datafile make sure the plugin is fully unloaded first and then remove the datafile, after that load the plugin. This is good to keep in mind. Despite this, problems should not appear so they will be thoroughly investigated.

I'm investigating the issues and will come back to you soon.

 

Edited by FakeNinja

Share this comment


Link to comment

No problem. I’m a server admin irl so I’ve done some before and know the benefits of getting detailed reports with steps to reproduce. 
 

the beta3 issues were after loading of the plugin post rollback. I did not write/edit the json this time while the plugin was loaded. Makes sense though what you said. 

Share this comment


Link to comment

Hello again,

I am still getting errors. I don't think I'm doing something wrong. 

 

Testing process:
1-Rollback server to clean state, wiped and updated to 2 Mar 2023 forced wipe

2-Remove all old SmartWarnings plugin, config, and data files

3-Copy 2.5.8b4 to plugins folder (attached)

4-Start server (attached)

5-Signin as noadmin. Issue 2 warnings against noplayer from /warn  (attached)
++"Player not found" in console with each command

6-Try to clear one specific warning (#2) with /warn clear steamID 2 (attached)
+++ Error is as follows in console
[SmartWarnings] [ClearPlayerWarnings] An unexpected error occurred while clearing 765xxxxxxxxxxxx62 warnings

System.NullReferenceException: Object reference not set to an instance of an object
  at Oxide.Game.Rust.Libraries.Player.Message (BasePlayer player, System.String message, System.String prefix, System.UInt64 userId, System.Object[] args) [0x0004e] in <395e4326ed58434196c2d9228e1e144c>:0 
  at Oxide.Game.Rust.Libraries.Covalence.RustPlayer.Message (System.String message, System.String prefix, System.Object[] args) [0x00000] in <395e4326ed58434196c2d9228e1e144c>:0 
  at Oxide.Game.Rust.Libraries.Covalence.RustPlayer.Reply (System.String message, System.String prefix, System.Object[] args) [0x0000f] in <395e4326ed58434196c2d9228e1e144c>:0 
  at Oxide.Game.Rust.Libraries.Covalence.RustPlayer.Reply (System.String message) [0x00008] in <395e4326ed58434196c2d9228e1e144c>:0 
  at Oxide.Plugins.SmartWarnings.ClearPlayerWarnings (Oxide.Core.Libraries.Covalence.IPlayer player, System.String adminName, System.String warnId) [0x00124] in <fd34bdf94d2c41eb9bb406d08051e131>:0 
+++

7-Issue 2 more warnings from console (attached)
+++"Player not found" in console with each command

8-Sign in as noplayer. Acknowledge any presented warnings (attached)
+++
Expected warnings to ack: 3 (warnIDs 1, 3, and 4)
Warnings presented: 1 (warnID 3)

Only the first console warning (warnID 3). The first /warn and second console (warnID 1 and 4) either did not show or were "silently" acknowledged
+++

 

I have attached further details with their associated test process number to help you correlate them. 

2.5.8b4 details.txt

Share this comment


Link to comment

I think I may have found an issue with my testing process. I was issuing a warn against a player that had not yet connected since wipe. Maybe if that happens, instead of "Player not found" in console, you can work on a chat notice back to the admin that the player can't be found? Could help prevent lost warnings due to typos

Share this comment


Link to comment

Hi @tschetschpi1, once again appreciate the fantastic event log.

Yes as you have observed and pointed out, warning a player that haven't been on a server causes this. It should be error handled and I will make a fix.

You would usually not warn a player before they came on to the server, which might explain why this error wasn't seen frequently until now.

Thanks again and i'll come back with an update when I have one ready.

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.6k

Customers

Total customers served.

81.5k

Files Sold

Total number of files sold.

1.6m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.