aerokube / selenoid-ui

Graphical user interface for Selenoid project
https://aerokube.com/selenoid-ui/latest/
Apache License 2.0
305 stars 76 forks source link

SSE only receives first message then crashes in selenoid-ui:latest #124

Closed O5ten closed 5 years ago

O5ten commented 6 years ago

Was debugging why selenoid-ui was not updating the currently running sessions today and realized that react crashed as soon as the first response came back from the SSE endpoint /events. Running the /events endpoint directly worked fine so i could rule out the nginx proxy we have in place doing something funky. So i'm going to guess a bug has snuck into the selenoid-ui frontend-code in latest.

I can see the following error-message in the console.

https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B67.0%2C%2068.0%7D&args[]=

The setup where it happened to us consists of selenoid-ui running against ggr-ui with one plain selenoid grid on a linux host and one selenoid binary running on windows if that matters in any way.

The first SSE message that comes back looks like this.

data: {
    "state":{
          "total":10,
          "used":0,
          "queued":0,
          "pending":0,
          "browsers":{
                 "chrome":{
                          "67.0":{},
                          "68.0":{}
                  },
                 "firefox":{
                          "60.0":{},
                          "61.0":{}
                  },
                  "internet explorer":{
                          "11":{}
                  },
                  "opera":{
                          "53.0":{},
                          "54.0":{}
                  }
           }
     },
    "origin":"http://ggr-ui:8888",
    "browsers":{
           "chrome":0,
           "firefox":0,
           "internet explorer":0,
           "opera":0
      },
      "sessions":{},
      "errors":[]
}

The error message above appears directly after the first even is returned. Downgrading to selenoid-ui:latest-release did the trick. :)

lanwen commented 5 years ago

Can't reproduce it on 1.6.2. Feel free to open if issue still actual for you