IndexOutOfRangeException: Index was outside the bounds of the arraySolved
Since todays game update i am getting console spammed by NRE's,  i started to unload plugins (as it did not show plugin at fault) until i got to compound options , when i unloaded it i got this error
(21:27:40) | Unloaded plugin Compound Options v1.1.6 by FastBurst
(21:27:41) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:42) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:43) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:44) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:45) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:46) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:47) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:48) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:49) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:50) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:51) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:52) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:53) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:54) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:55) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:56) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:58) | IndexOutOfRangeException: Index was outside the bounds of the array.
(21:27:58) | [Compound Options] Trying to save default vendingOrders for Vehicles2
(21:27:59) | [Compound Options] Added Vending Machine: Vehicles2 to data file!
(21:27:59) | [Compound Options] Added Vending Machine: Vehicles2 to data file!
(21:27:59) | [Compound Options] Trying to save default vendingOrders for Compound_Extra2
(21:27:59) | [Compound Options] Added Vending Machine: Compound_Extra2 to data file!
(21:27:59) | [Compound Options] Added Vending Machine: Compound_Extra2 to data file!
(21:27:59) | [Compound Options] Trying to save default vendingOrders for Compound_Extra1
(21:27:59) | [Compound Options] Added Vending Machine: Compound_Extra1 to data file!
(21:27:59) | [Compound Options] Added Vending Machine: Compound_Extra1 to data file!
(21:27:59) | [Compound Options] Trying to save default vendingOrders for Tools
(21:27:59) | [Compound Options] Added Vending Machine: Tools to data file!
(21:27:59) | Failed to call hook 'OnServerInitialized' on plugin 'CompoundOptions v1.1.6' (NullReferenceException: Object reference not set to an instance of an object)
  at NPCVendingMachine.InstallFromVendingOrders () [0x00043] in <8b307985874147eca212836ef31034d8>:0 
  at Oxide.Plugins.CompoundOptions.UpdateVending (NPCVendingMachine vending) [0x0005c] in <fb4432cd48a849fc89ad52b17aa56c7b>:0 
  at Oxide.Plugins.CompoundOptions.OnServerInitialized () [0x00042] in <fb4432cd48a849fc89ad52b17aa56c7b>:0 
  at Oxide.Plugins.CompoundOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00275] in <fb4432cd48a849fc89ad52b17aa56c7b>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0
(21:27:59) | Loaded plugin Compound Options v1.1.6 by FastBurst
(21:28:02) | NullReferenceException: Object reference not set to an instance of an object
(21:28:03) | NullReferenceException: Object reference not set to an instance of an object
(21:28:04) | NullReferenceException: Object reference not set to an instance of an object
​

So i tried reloading it again and am stuck with the spam

Im not getting any errors on my end on Procedural or Custom Maps. Did you wipe the data files? That is the only 2 things I haven't done or ever do.
since  new rust  update the plugin itself is just unusable

ynzo - you say that yet it is working and loading perfefctly fine for me.

https://gyazo.com/42b47f5fd6afb92594c3989c4f66f048 - Still going to investigate as I have this on now 45 of my servers all differetn stepups and OS

Merged post

9b6b9a862019072f637ba128ac7effe1.jpg
https://gyazo.com/9b6b9a862019072f637ba128ac7effe1

As even shown here where example there is no Test Generators by default in any vending machines. and I have also changed the Scrap Amounts being used.

Merged post

Should be resolved with the latest update.

Just loaded the latest update and restarted server after updating oxide, getting this error in console

NullReferenceException: Object reference not set to an instance of an object
  at NPCVendingMachine.Refill () [0x00074] in <54079df9b4ba4e0a9ed7127849f02023>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <29eec3b46a6649b98388296ce60666bc>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <29eec3b46a6649b98388296ce60666bc>:0

Still getting spammed and still the same error when unloading plugin, all errors removed once i removed the plugin when server down and will wait for next update before installing it again
I would not say "fixed"

My logs are still full of

(12:03:52) | IndexOutOfRangeException: Index was outside the bounds of the array.

But the plugin is working but it's hell on my console output

bloodbeard
My logs are still full of

(12:03:52) | IndexOutOfRangeException: Index was outside the bounds of the array.

But the plugin is working but it's hell on my console output

I only got that error in console after i unloaded the plugin, when loaded i got the NRE killing my console,
The only thing i could do was stop the server (for update) and remove the plugin, which is a pity as i like it.

IndexOutOfRangeException: Index was outside the bounds of the array.
  at NPCVendingMachine.Refill () [0x0005f] in <8b307985874147eca212836ef31034d8>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <6409b009eb374969a1507514d17e7cc0>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <6409b009eb374969a1507514d17e7cc0>:0 
  
DivideByZeroException: Attempted to divide by zero.
  at NPCVendingMachine.Refill () [0x00085] in <8b307985874147eca212836ef31034d8>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <6409b009eb374969a1507514d17e7cc0>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <6409b009eb374969a1507514d17e7cc0>:0 

I've been getting this error on repeat every second since the previous update. 

I updated to the latest CompoundOptions and still got this. 

Upon unloading the plugin, I started getting the index error. Before that it was just the Divide by Zero error.

Merged post

Alright so I've fixed the issue on my server. Hopefully this fix will work for all of you as well.
Here are the steps I did to fix it:
-Remove CompoundOptions plugin, data files, config file.
-Restart Server
-Add CompoundOptions
-Add in my previous saved data file
-...still got the same error
-Removed one of the generator entries. I believe it was just regular generator. (didnt say small or test, just generator)
-o.reload CompoundOptions
No more error spam.

Essentially you could probably just do the last 2 steps but in case that doesn't work for some people, I added my whole process from start to finish.
I think it's a problem with registering one of the generators. 

Merged post

Scratch everything I said above. The error came back.
After further digging, I've found the problem and solution. Makes more sense too.
Tested and confirmed no more error spam.

The new CompoundOptions data file has extra fields that the previous version of the file did not have. 
These fields were not automatically added to the old data file.

Solution: 
I saved my previous CompoundOptions data file. Deleted the plugin and all associated files.
Uploaded the latest version of the plugin. Put the old and new data file side by side...
Copy and pasted all the id's and prices from my old data file into the right spots of the new file. 
It was during that part I noticed that the new data file had extra values for things like weight, etc.

So the reason we're probably getting those index/cant divide by zero errors is because our old data file doesn't have those values at all. 

Hope this helps!

Thanks for the solve, works without any spamming now

What were the new fields added?  Compared old file to new file, all fields were the same.  Only differences I saw were the last 3 options were 0's, and in the new on they're 100, 100, 10.  Am I missing something somehow?  Unless those WERE the new fields, and I somehow didn't have those figures setup correctly.

Merged post

NVM, those fields were it.  Change those last 3 fields, and works fine.

Glad to hear it helped you guys too!

Rust community united! <3

I have tried everything, wiping data, wiping plugin and all attached files, everything, and still getting this spamming console.

I have 0 idea what to do now. :(

(Example of what my items look like in the file)

{
  "VendingMachinesOrders": {
    "Tools": [
      {
        "_comment": "Sell Chainsaw x 1 for Scrap x 500",
        "sellId": 1104520648,
        "sellAmount": 500,
        "sellAsBP": false,
        "currencyId": -932201673,
        "currencyAmount": 1,
        "currencyAsBP": false,
        "weight": 100,
        "refillAmount": 100,
        "refillDelay": 10.0
      },
IndexOutOfRangeException: Index was outside the bounds of the array.
  at NPCVendingMachine.Refill () [0x0005f] in <f09d046ed62f4180816fdfbceacd875b>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <9aec4685184845a88c8b74667717816f>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <9aec4685184845a88c8b74667717816f>:0 
Same, I have the same console spam as well, when any changes are made in the data/config.
summerbummer
IndexOutOfRangeException: Index was outside the bounds of the array.
  at NPCVendingMachine.Refill () [0x0005f] in <8b307985874147eca212836ef31034d8>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <6409b009eb374969a1507514d17e7cc0>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <6409b009eb374969a1507514d17e7cc0>:0 
  
DivideByZeroException: Attempted to divide by zero.
  at NPCVendingMachine.Refill () [0x00085] in <8b307985874147eca212836ef31034d8>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <6409b009eb374969a1507514d17e7cc0>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <6409b009eb374969a1507514d17e7cc0>:0 

I've been getting this error on repeat every second since the previous update. 

I updated to the latest CompoundOptions and still got this. 

Upon unloading the plugin, I started getting the index error. Before that it was just the Divide by Zero error.

Merged post

Alright so I've fixed the issue on my server. Hopefully this fix will work for all of you as well.
Here are the steps I did to fix it:
-Remove CompoundOptions plugin, data files, config file.
-Restart Server
-Add CompoundOptions
-Add in my previous saved data file
-...still got the same error
-Removed one of the generator entries. I believe it was just regular generator. (didnt say small or test, just generator)
-o.reload CompoundOptions
No more error spam.

Essentially you could probably just do the last 2 steps but in case that doesn't work for some people, I added my whole process from start to finish.
I think it's a problem with registering one of the generators. 

Merged post

Scratch everything I said above. The error came back.
After further digging, I've found the problem and solution. Makes more sense too.
Tested and confirmed no more error spam.

The new CompoundOptions data file has extra fields that the previous version of the file did not have. 
These fields were not automatically added to the old data file.

Solution: 
I saved my previous CompoundOptions data file. Deleted the plugin and all associated files.
Uploaded the latest version of the plugin. Put the old and new data file side by side...
Copy and pasted all the id's and prices from my old data file into the right spots of the new file. 
It was during that part I noticed that the new data file had extra values for things like weight, etc.

So the reason we're probably getting those index/cant divide by zero errors is because our old data file doesn't have those values at all. 

Hope this helps!

see above solution.

Locked automatically