StrangeLoopGames / EcoIssues

131 stars 21 forks source link

SERVER ISSUE: Crash due to CultureManager get SortedWorks #24247

Closed Thibault-Brocheton closed 6 months ago

Thibault-Brocheton commented 10 months ago

Server Version: 0.10.0.1 beta release-535 No Mods

French server with 2 active days, around 100 online citizens

Steps to Reproduce:

Some citizens created WoodenFrame, added pictures inside and gave culture points After a server restart, server was unable to start because of following error:

[22:57:06.571] [21] [Error] [Eco] Failed to start the server. Exception was Exception: NullReferenceException
Message:Object reference not set to an instance of an object.
Source:Eco.Gameplay

System.NullReferenceException: Object reference not set to an instance of an object.
   at Eco.Gameplay.Settlements.Culture.CultureManager.<>c.<get_SortedWorks>b__28_0(UserTexture x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
   at Eco.Gameplay.Settlements.Culture.CultureManager.UpdateGlobalRankings()
   at Eco.Gameplay.Settlements.Culture.CultureManager.<Initialize>b__22_0()
   at Eco.Core.Utils.Initializer.Initialize()
   at Eco.Server.PluginManager.InitializeAsync(StartupInfo startupInfo)
   at Eco.Server.Startup.StartAsync(StartupInfo startupInfo)

Here is the map to reproduce it:

Game.eco : https://drive.google.com/file/d/1jdbtS61F1hQxVQaUfOum03YnAjMEZV0U/view?usp=drive_link Game.db : https://drive.google.com/file/d/1mAhf5l_tAAeCKvKcjLkwhrP-rgsUadmz/view?usp=drive_link

Deleting WoodFrame from the save game does not fix the issue We had to rollback and ask players not to add woodenframe in the world. We're waiting for your advice to allow them again

Thibault-Brocheton commented 10 months ago

The initial crash we had was linked to Twitch extension:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Eco.WebServer.Utils.StatUtils.GetBucketedStatValues(Range timeRange, Single bucketSize, StatInfo info)
   at Eco.WebServer.Utils.StatUtils.GetGraphValuesFromDayRange(String key, Double startingDay, Double endingDay, Single maxSeconds)
   at Eco.WebServer.Web.Controllers.StatsController.GetGraphDataByDateRange(String key, Double dayStart, Double dayEnd)
   at lambda_method69909(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

We disabled the extension, there's no more crash, and now we don't have the culture crash at startup anymore.

D3nnis3n commented 10 months ago

@Thibault-Brocheton We cannot access the files on Drive, they need authorization, please make sure they can be accessed by anyone with link.

Thibault-Brocheton commented 10 months ago

damn I thought I did that fine it's fixed @D3nnis3n

D3nnis3n commented 6 months ago

Crash has been addressed long ago, cause for why picture was able to be created without creator is still unknown and not reproducible so far.