matrx-software / matrx

Human-Agent Teaming Rapid Experimentation Software
https://www.matrx-software.com
MIT License
10 stars 3 forks source link

View disconnected - Agent does not exist (anymore) #304

Open rsverhagen94 opened 3 years ago

rsverhagen94 commented 3 years ago

What is your question? Often when running MATRX I encounter the below shown view disconnected issue. In this case the user can no longer control the agent and the page should be refreshed before being able to proceed. Any idea where this issue comes from and how to potentially solve/avoid it?

Screenshot from 2021-07-15 12-38-14

To what is your question related?

thaije commented 3 years ago

Hi @rsverhagen94, this notification happens when the frontend can't find the agent (human_0_in_team_0 in your case) in the state it received from the MATRX backend. Two example causes are that the frontend cannot connect to MATRX at all and doesn't get a state, or because a new world has started that doesn't include an agent with that name/ID.

Do you have some more info on when and how this occurs? For instance, after completing a world and starting the new one, or also in the middle of a world? Or when it is running for a longtime? And how often do you have this issue? Also, do you have a stacktrace of the browser console and the Python console when that happens?

This seems like a difficult issue to replicate, so it would also be really helpful if I could take a look at your code and try to debug it directly by running it and replicating the issue. Would that be a possibility?

rsverhagen94 commented 3 years ago

Hi @thaije, thanks for the quick reply! In almost all cases this issue occurs in the middle of a world, but does not seem to be dependent on the amount of time the world is running. It does seem to happen more often when the controls haven't been used for a little while. The issue occurs around twice when completing a world.

You can find my code at https://github.com/rsverhagen94/MATRX. Let me know if you can access and run it, or if you need additional information. Thanks a lot already for your help!

thaije commented 3 years ago

Hey @rsverhagen94, I was able to clone your repository and install everything according to your requirements.txt. Is it correct you're using MATRX v2.0.8? I ran the main.py a couple times:

I also tried accessing it from localhost:3000 (not recommended) and 127.0.0.1:3000 (recommended, faster url for the frontend). In each of the case I wasn't able to reproduce it. Am I still missing something?

If you do re-encounter the problem, can you post a stacktrace of the browser console log and the MATRX Python terminal log?

rsverhagen94 commented 3 years ago

Hi @thaije. I am indeed using v2.0.8. Good to hear you did not encounter the problem. Below the two screenshots of when the issue does occur.

Screenshot from 2021-07-25 12-35-12 Screenshot from 2021-07-25 12-35-06

thaije commented 3 years ago

Thanks for the screenshots @rsverhagen94. From the stack traces I can't pinpoint the cause of why the view disconnects either, but what I can do is change the way MATRX handles a disconnect. Now it seems to crash (red browser console error), but instead catch that error and let it try to reconnect. That could solve your issue. When would you need that fix for e.g. running experiments? Then I'll try to fit it in my schedule :) You would have to upgrade your MATRX version for that though.

rsverhagen94 commented 3 years ago

Hi @thaije, thanks for your help. I already started conducting last week but fortunately the issue only occurred rarely untill now.