Strange UI Text behaviour

Just got this error (I have a debugger)

(X) Error occured: get_isActiveAndEnabled can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function./  at (wrapper managed-to-native) UnityEngine.Behaviour.get_isActiveAndEnabled(UnityEngine.Behaviour)
  at UnityEngine.EventSystems.UIBehaviour.IsActive () [0x00000] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\UIBehaviour.cs:28 
  at UnityEngine.UI.Graphic.SetVerticesDirty () [0x00000] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Graphic.cs:267 
  at UnityEngine.UI.Text.set_text (System.String value) [0x0003d] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Text.cs:212 
  at ChatController.Print (System.String msg) [0x0007e] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ChatController.cs:60 
  at ClientController.ProcessMessage (System.Net.Sockets.NetworkStream stream) [0x00184] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ClientController.cs:103 
  at ClientController.MessageProcessLoop () [0x00019] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ClientController.cs:45

Okay, MessageProcessLoop() is self-explanatory.
ProcessMessage() is also self-explanatory. It calls Print() funciton.
Print() just adds a text into list, and then applies it to text UI object.
And then this error comes out.

Any ideas?

As the message says, you can’t call some common methods like SetActive or LoadScene outside of the main thread. You or your assets are probably using some async operation which calls MessageProccessLoop, or the async operation is directly someone of the list.
Whats the main thread? Everything called from this:

If you’re using some library, if it’s dessigned for Unity it should have a mainthread operation in order to do this… If you’re using threads and tasks, try to implement it as a Coroutine.