nwesterhausen / valheim-discordconnector

A plugin to connect a Valheim server to a discord webhook.
https://discord-connector.valheim.games.nwest.one/
MIT License
27 stars 13 forks source link

2.1.9 Server Error #172

Closed heykiditsaaron closed 1 year ago

heykiditsaaron commented 1 year ago

For whatever reason the 2.1.9 version just floods my server console with this message:

[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: (wrapper dynamic-method) Menu.DMD(Menu)

[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: (wrapper dynamic-method) Hud.DMD(Hud,Player,single) Hud.LateUpdate () (at <524740f531b840a39041d99d3009a46c>:0)

At first I didn't think it could be this mod, but it's the only mod I have to remove to make the errors go away.

nwesterhausen commented 1 year ago

I can't reproduce this on a dedicated server or running on the client. What server version are you running?

I'm not sure what Hud.DMDHud is from but DiscordConnector does nothing with the UI so it is odd that this error would come up from updating to 2.1.9

If you could let me know some more information about how you are running the game that would help me assist here. From your initial issue, I can't glean any information like are you running Discord Connector on your client or the server; are you running the server on windows or linux or via a hosting site; etc.

heykiditsaaron commented 1 year ago

So here's what happened: I installed the new version to my server, but it doesn't overwrite the folder because it has a different name. So I deleted the old folder. But only in plugins. I went back and removed the old folder under configs and now there are no errors. I just have to redo al my configs lol. But thank you, this mod is absolutely amazing and I thoroughly enjoy it

nwesterhausen commented 1 year ago

Cool. Thanks for the follow-up. There was only a small change to the configuration so hopefully that doesn't indicate that the error will happen for everyone (in my testing there was no error going from 2.1.8 to 2.1.9). More data points help.

Glad you really like the mod!

tgstyle commented 1 year ago

I am getting the same issue here. I deleted the config folder and restarted, it worked great until another server restart, then the problem started again. Rolled back to 2.1.8 and issue is gone.

heykiditsaaron commented 1 year ago

Also ended up rolling back to 2.1.8. On 2.1.9 it would break the second I put in any web hook url

nwesterhausen commented 1 year ago

Okay I'm trying to duplicate this. Can you give me any information about the platform you are running on @tgstyle ? Here's how I've tested it:

Dedicated Server on Windows w/ 2.1.9: both webhooks, 1 webhook, no webhooks never gives any error messages with same config from 2.1.8 (besides where the main config has changed w/ 2nd webhook). Survives a restart.

Dedicated Server on Linux w/ 2.1.9: same configs from 2.1.8 (basically inplace upgrade) no error. Added 2nd webhook don't get errors. Restarting the server doesn't produce anything different.

If you can provide some more info that may help us figure out whats going on:

Edit: Just took a look at CronJob's source and the method they hook into still exists. So that shouldn't be causing a NullReferenceException.

heykiditsaaron commented 1 year ago

Dedicated server on Windows 10 system. No provider per se, but running it through CubeCoders AMP application management program. I don't think I'm running cronjob plugin. How do I check that?

nwesterhausen commented 1 year ago

cronjob is a plugin/mod just like Discord Connector.

I will set up AMP on my machine here after work/next bit of free time (probably Friday) and try duplicating the error.

nwesterhausen commented 1 year ago

If possible, if you guys could post what list of mods you are using that would be helpful. I am fairly sure this is because of a mod hooking into discord connector to send to the webhook but I don't have a list of everything that uses it.

StellarwhimsRepo commented 1 year ago

just reproduced this specific issue on my test server. going to verify all mods are updated, provide that list... and then try again with only discordconnector, cronjob and dependencies, and then again with only discordconnector.

StellarwhimsRepo commented 1 year ago

reproduced with only discord connector installed. the issue went away when i copied over my discordconnector-toggles.cfg attaching those settings. attached as txt since github doesn't like .cfg discordconnector-toggles.txt

nwesterhausen commented 1 year ago

Thanks. Issue happened with default configs on 2.1.9 and your toggles cfg made the error stop?

StellarwhimsRepo commented 1 year ago

Thanks. Issue happened with default configs on 2.1.9 and your toggles cfg made the error stop?

yes, first webhook is setup on default settings. second is blank.

nwesterhausen commented 1 year ago

the toggles config doesn't have the webhook in it. so seems like there is something in the defaults there which cause the error to show up too

StellarwhimsRepo commented 1 year ago

the toggles config doesn't have the webhook in it. so seems like there is something in the defaults there which cause the error to show up too

yes. so order of reproduction -

install only discordconnector mod. start server once, shutdown server. setup first webhook in discordconnector.cfg, no other changes. start server. get the null reference spam after server is done start up. shutdown server. copy discordconnector-toggles.cfg from live server to test server. start test server. server starts with no null reference errors.

nwesterhausen commented 1 year ago

Is it possible for you to try using DiscordConnecter from this build artifact?

https://github.com/nwesterhausen/valheim-discordconnector/actions/runs/4196015332

I made the edits on a machine which I cannot test from, but the build succeeded so there's not any trivial errors. If you cannot, no worries. I will test it later today when I get home.

heykiditsaaron commented 1 year ago

I'm not quite sure what you're asking me to do. Sorry. I'll help but I don't understand the instruction

StellarwhimsRepo commented 1 year ago

Is it possible for you to try using DiscordConnecter from this build artifact?

https://github.com/nwesterhausen/valheim-discordconnector/actions/runs/4196015332

I made the edits on a machine which I cannot test from, but the build succeeded so there's not any trivial errors. If you cannot, no worries. I will test it later today when I get home.

I downloaded this and reverted the toggles file back to default. tested 2.1.9 once more to verify error is present. error is present. copied the build artifact to the test server and tested. error is still present.

nwesterhausen commented 1 year ago

Thanks a lot for your help with this. Went home on my lunch and was able to test. Your steps worked perfect for reproducing the error. Watching the logs go by it was obvious what was happening: the default for the 2nd webhook is 'ALL' but the URL is empty and it tries to make a web request against that (oops).

I made changes to handle this gracefully (interpreting an empty event list when webhook is empty) and am able to perform your steps to reproduce without an error.

These changes are in pr #175 and will be published as 2.1.10 soon.

nwesterhausen commented 1 year ago

Fixed in release 2.1.10 should be published shortly on Thunderstore or from release here https://github.com/nwesterhausen/valheim-discordconnector/releases/tag/v2.1.10