Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
140 stars 2 forks source link

Headless Server Keeps Clearing Account Bans and Allowed Hosts #522

Open Enverex opened 1 year ago

Enverex commented 1 year ago

Describe the bug?

Resonite now allows you to use your main account for headless hosting which is great because it was a permission and security pain before due to having to juggle several aspects.

Unfortunately it seems this doesn't quite work properly as every time you shut down a headless server, it seems to wipe your Allowed Hosts and Bans lists. The former being annoying, the latter potentially being outright dangerous.

To Reproduce

Log into your account normally add some people to the ban list, add some hosts to the allowed list. Quit.

Spin up a headless, let it host the world for a little bit. Shut it back down.

Log back into your account on the normal desktop client, you'll find your allowed hosts and bans are now empty.

Expected behavior

For the two lists to be shared and work normally, with neither overwriting the other. Anything added on either side should show on the other, anything removed on either side should show on the other.

Currently it looks like the headless just pushes back blank lists on shutdown which nukes both lists.

Screenshots

No response

Resonite Version Number

2023.10.19.620

What Platforms does this occur on?

Windows, Linux

What headset if any do you use?

No response

Log Files

Not sure what would be useful here, except one key line that I think is responsible (seen on headless shutdown):

Finished sync for U-Enverex:R-Settings. Local: 88, Global: 2332

Feels like it's doing a force-local-sync over my account settings from that description, but it never loaded them in the first place, so it's always blank. It needs to merge before saving anyway if it's going to be ran in multiple places at the same time to avoid mid-air-collisions.

Additional Context

No response

Reporters

No response

shiftyscales commented 1 year ago

To clarify something, @Enverex - does this issue occur if everything is done on the same machine, and only one instance of the account is running at a time? E.g.:

If that fails, could you then also verify if the same occurs if you manually specify/force the local database folder to the same location for both clients and see if the issue still occurs?

I am also wondering if order is relevant, e.g. if headless were exited first, then the graphical client if the issue still occurs.

That does seem like a likely answer though- so I think you are right in that it has a blank/empty list by default, and the sync is probably overwriting it. Determining the above would help confirm that it is the sync that is responsible for clearing the lists in the graphical client on subsequent launches.

shiftyscales commented 9 months ago

Request for more information has not been responded to in almost three months. Closing this out.

Enverex commented 9 months ago

Sorry, I thought I replied to this. I remember testing all this but apparently didn't put the notes on here so I'm not sure what happened to those. I'll test again shortly. It's a bit of a faff though given that I don't normally run the headless on the same machine.

Gyztor commented 1 month ago

I have also been running into this recently though it's more just when I ban on a headless the changes don't save between shutdown and startup. Especially when using the console commands. Usually avoid ever logging into graphical client on headless account to avoid issues. Went looking through logs as well to see if I could find anything for the people that were banned via console commands but couldn't find much, but did find some errors for the one person banned while in session.

6:11:18 AM.414  BanRequest: True for User ID22C24D00 (Alloc: 11) - UserName: ***, UserId: ***, MachineId: ***, Role: Guest. Changing User: User ID31DAA00 (Alloc: 1) - UserName: GyztorMizirath, UserId: ***, MachineId: ***, Role: Admin, ScheduledForValidation: True

   at System.Environment.get_StackTrace()
   at Elements.Core.UniLog.Log(String message, Boolean stackTrace) in D:\Workspace\Everion\FrooxEngine\Elements.Core\UniLog.cs:line 27
   at FrooxEngine.User.BanRequest_OnValueChange(SyncField`1 syncField) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\User.cs:line 1155
   at FrooxEngine.Sync`1.InternalDecodeDelta(BinaryReader reader, BinaryMessageBatch inboundMessage) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Sync Members\SyncFields\SyncPrimitive.cs:line 69
   at FrooxEngine.ConflictingSyncElement.DecodeDelta(BinaryReader reader, BinaryMessageBatch inboundMessage) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Base Classes\ConflictingSyncElement.cs:line 229
   at FrooxEngine.SyncController.DecodeBinaryMessage(Int32 recordIndex, BinaryMessageBatch message, Boolean isFull) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\SyncController.cs:line 327
   at FrooxEngine.Session.ApplyDataRecords(BinaryMessageBatch toProcess) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\Session.cs:line 1311
   at FrooxEngine.Session.ProcessMessage(SyncMessage msg, UInt64 lastDeltaSyncTime, List`1 controlMessagesToProcess) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\Session.cs:line 1143
   at FrooxEngine.Session.SyncLoop() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\Session.cs:line 826
   at FrooxEngine.Session.RunThreadLoop(Action loop) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\Session.cs:line 484
   at FrooxEngine.Session.<.ctor>b__77_2() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Controllers\Session.cs:line 258
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
6:11:18 AM.424  Banning user User ID22C24D00 (Alloc: 11) - UserName: ***, UserId: ***, MachineId: ***, Role: Guest. Last Changing User: User ID31DAA00 (Alloc: 1) - UserName: GyztorMizirath, UserId: ***, MachineId: ***, Role: Admin
6:11:18 AM.425  Peer Disconnected: ***:50687, reason: DisconnectPeerCalled, socketErrorCode: Success
6:11:18 AM.428  SIGNALR: BroadcastSession SessionInfo. Id: S-00227f5b-7e38-49bb-b67b-7739f93b0b3f, Name: ***, Host: HeadlessGyztor, CorrespondingWorldId: G-1P7r5aFQVsG:R-0ad7c97b-7f38-4ad1-9082-5f72176b407f, URLs: lnl-nat://be2ae106c5a14ea58ed05664ab2306bd/S-00227f5b-7e38-49bb-b67b-7739f93b0b3f, IsExpired: False to Public
6:11:18 AM.502  Session updated, forcing status update
6:11:18 AM.516  User Left ***. Username: ***, UserID: ***, AllocId: 11, AllocIDstart: 1, MachineID: ***
6:11:18 AM.521  Destroying User: User ID22C24D00 (Alloc: 11) - UserName: ***, UserId: ***, MachineId: ***, Role: Guest
Currently updating user: User ID2E00 (Alloc: 0) - UserName: HeadlessGyztor, UserId: ***, MachineId: ***, Role: Admin

   at System.Environment.get_StackTrace()
   at Elements.Core.UniLog.Log(String message, Boolean stackTrace) in D:\Workspace\Everion\FrooxEngine\Elements.Core\UniLog.cs:line 27
   at FrooxEngine.UserRoot.Slot_OnPrepareDestroy(Slot slot) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Components\Users\UserRoot.cs:line 926
   at FrooxEngine.Slot.PrepareDestruction() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Base Classes\Slot.cs:line 1093
   at FrooxEngine.SyncBagBase`2.InternalRemove(K key, Boolean sync, Boolean change) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Sync Members\SyncBagBase.cs:line 286
   at FrooxEngine.Slot.RelocateOrDestroyEmpty(Func`1 getRelocationTarget) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Base Classes\Slot.cs:line 995
   at FrooxEngine.Slot.DestroyPreservingAssets(Slot relocateAssets, Boolean sendDestroyingEvent) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Base Classes\Slot.cs:line 966
   at FrooxEngine.Slot.DestroyPreservingAssets() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Data Model\Base Classes\Slot.cs:line 828
   at FrooxEngine.SimpleUserSpawn.OnUserLeft(User user) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Components\Users\SimpleUserSpawn.cs:line 46
   at FrooxEngine.World.RunWorldEvents() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\World.cs:line 2769
   at FrooxEngine.World.RefreshStep() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\World.cs:line 1671
   at FrooxEngine.World.Refresh() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\World.cs:line 1359
   at FrooxEngine.WorldManager.UpdateStep() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\WorldManager.cs:line 632
   at FrooxEngine.WorldManager.RunUpdateLoop() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\WorldManager.cs:line 433
   at FrooxEngine.Engine.UpdateStep() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Engine.cs:line 1368
   at FrooxEngine.Engine.RunUpdateLoop() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Engine.cs:line 1168
   at FrooxEngine.StandaloneFrooxEngineRunner.UpdateLoop() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Engine\StandaloneFrooxEngineRunner.cs:line 204
6:11:18 AM.523  Exception running asynchronous task:
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at FrooxEngine.CommonAvatarBuilder.SpawnCloudAvatar(User user, AvatarManager avatarManager) in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Components\Users\CommonAvatarBuilder.cs:line 1054
   at FrooxEngine.CommonAvatarBuilder.<>c__DisplayClass36_0.<<BuildAvatar>b__8>d.MoveNext() in D:\Workspace\Everion\FrooxEngine\FrooxEngine\Components\Users\CommonAvatarBuilder.cs:line 1026
   --- End of inner exception stack trace ---

   at System.Environment.get_StackTrace()
   at Elements.Core.UniLog.Error(String message, Boolean stackTrace) in D:\Workspace\Everion\FrooxEngine\Elements.Core\UniLog.cs:line 59
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()