WheteThunger / MonumentAddons

Add entities, spawn points and more to monuments
https://umod.org/plugins/monument-addons
MIT License
5 stars 9 forks source link

[Installation issue] NullReferenceException when installing prebuilt profiles #42

Closed Lolispo closed 2 years ago

Lolispo commented 2 years ago

I run into an issue trying to install the prebuilt profiles available. Example command: mainstall OutpostExtended


Web request callback raised an exception (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.MonumentAddons.FindMonumentsByAlias (System.String alias) [0x00000] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons.GetMonumentsByAliasOrShortName (System.String aliasOrShortName) [0x0007e] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons+ProfileController.EnqueueAll (Oxide.Plugins.MonumentAddons+ProfileCounts profileCounts) [0x00044] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons+ProfileController.Load (Oxide.Plugins.MonumentAddons+ProfileCounts profileCounts) [0x0001e] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons+ProfileController.Enable (Oxide.Plugins.MonumentAddons+Profile newProfileData) [0x00029] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons+<SharedCommandInstallProfile>c__AnonStorey5.<>m__0 (Oxide.Plugins.MonumentAddons+Profile profile) [0x001af] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Plugins.MonumentAddons+<DownloadProfile>c__AnonStorey7.<>m__0 (System.Int32 statusCode, System.String responseBody) [0x000a6] in <289deaec3b6c431787532f125b806eae>:0 
  at Oxide.Core.Libraries.WebRequests+WebRequest.<OnComplete>b__42_0 () [0x00034] in <99d545163fdd4d57a562df7989f2ca0a>:0

Running server on Ubuntu 22, not sure if it's anything basic / obvious that I'm missing.

WheteThunger commented 2 years ago

Glancing at the code, it appears that this error would only happen if the Monument Finder plugin is not installed. That plugin is a required dependency. Have you installed it?

Lolispo commented 2 years ago

Ah I missed that, I'll try with that, so sorry my bad!

Lolispo commented 2 years ago

What is the recommended way to try to reinstall the profiles if the install got corrupt due to lack of dependencies during initial install?

(16:35:01) | <size=18>Monument Addons Profiles</size>
<color=#fd4>Default</color> - <color=#6e6>ENABLED</color>
<color=#fd4>OutpostAirwolf</color> - <color=#ccc>DISABLED</color>
<color=#fd4>OutpostExtended</color> - <color=#ccc>DISABLED</color>
<color=#fd4>TrainStationCCTV</color> - <color=#ccc>DISABLED</color>

But given the error they received during install they don't actually have anything. So is there a way for me to clear them out? Can do manually in files if needed so I can install them again from scratch? When I disabled the mod before I thought the list would clear but it didn't for me, how can I uninstall the mod, clear list, and then reactivate it if that is necessary?

Will experiement myself but if you have any tips then I appreciate it :)

WheteThunger commented 2 years ago

I doubt that the profiles are corrupt. In the text you pasted, they are showing as disabled, so you probably just need to enable them.

To enable a profile, run maprofile enable <name>. Example: maprofile enable OutpostAirwolf.

If you actually need to reinstall a profile, run maprofile clear <name>, then mainstall <name>.

If you want to fully delete a profile, you'll have to remove the data file for that profile, then reload the plugin, since Oxide doesn't currently allow plugins to delete data files (only edit them).

WheteThunger commented 2 years ago

Closing as it seems you have resolved the issue. Feel free to reopen if you need further assistance.