aerokube / ggr-ui

The missing /status API for Ggr
https://aerokube.com/ggr-ui/latest/
Apache License 2.0
39 stars 15 forks source link

Selenoid UI error - cannot unmarshal number into Go value of type selenoid.State #8

Closed monkpit closed 6 years ago

monkpit commented 6 years ago

I have the following setup...

2 docker hosts running 2 copies of Selenoid, 1 on each host. I have GGR and GGR-UI running with quota XML files specifying each of the 2 hosts as hosts in the XML. The quota XML files are on a volume that is shared to all relevant GGR / GGR-UI containers.

When I point Selenoid-UI at GGR-UI, and open the Selenoid-UI page, it shows the Selenoid status as Red. In the logs for the Selenoid-UI container I see this error repeated:

can't get status (json: cannot unmarshal number into Go value of type selenoid.State)

For reference, this is what is reported by http://<ggr-ui-url>:8888/status when a container is running a test in Chrome:

{
  "browsers": {
    "chrome": {
      "66.0": {
        "test": {
          "count": 1,
          "sessions": [
            {
              "caps": {
                "applicationContainers": null,
                "browserName": "chrome",
                "browserVersion": "",
                "containerHostname": "",
                "env": null,
                "hostsEntries": null,
                "labels": null,
                "name": "",
                "screenResolution": "1920x1080x24",
                "selenoid:options": null,
                "timeZone": "",
                "version": "66.0",
                "videoFrameRate": 0,
                "videoName": "",
                "videoScreenSize": "1920x1080"
              },
              "container": "9338f9c4ec56018360ca1048ea8e63e7ca6b736084582d2187419cec9e4e622e",
              "containerInfo": {
                "id": "9338f9c4ec56018360ca1048ea8e63e7ca6b736084582d2187419cec9e4e622e",
                "ip": "172.17.0.3"
              },
              "id": "11683c93804e090b01a66b616c644a1e6b2cf214509835c980ccdb61ab5ef037",
              "screen": "1920x1080x24",
              "vnc": false
            }
          ]
        }
      }
    },
    "firefox": {
      "58.0": {
      }
    }
  },
  "pending": 0,
  "queued": 0,
  "total": 10,
  "used": 1
}

And this is what is reported from /status when no tests are running:

{
  "browsers": {
    "chrome": {
      "66.0": {
      }
    },
    "firefox": {
      "58.0": {
      }
    }
  },
  "pending": 0,
  "queued": 0,
  "total": 10,
  "used": 0
}

Please let me know if I can provide any further info, or if I should file this issue on the Selenoid-UI page. Thanks!

monkpit commented 6 years ago

My quota XML file looks like this:

<qa:browsers xmlns:qa="urn:config.gridrouter.qatools.ru">
<browser name="firefox" defaultVersion="58.0">
    <version number="58.0">
        <region name="1">
            <host name="host1" port="4445" count="1"/>
            <host name="host2" port="4445" count="1"/>
        </region>
    </version>
</browser>
<browser name="chrome" defaultVersion="66.0">
    <version number="66.0">
        <region name="1">
            <host name="host1" port="4445" count="1"/>
            <host name="host2" port="4445" count="1"/>
        </region>
    </version>
</browser>
</qa:browsers>
vania-pooh commented 6 years ago

@monkpit ggr-ui seems to return correct data. I think there is an issue in connecting Selenoid UI to Ggr UI. Please provide a command - how you are starting Selenoid UI.

monkpit commented 6 years ago

--selenoid-uri=http://<loadbalancer>:8889/status with loadbalancer rule to redirect requests on :8889 to ggr-ui on :8888

EDIT: maybe this is because of extra /status in my command... :(

vania-pooh commented 6 years ago

@monkpit yes, --selenoid-uri should be without /status, just --selenoid-uri http://<loadbalancer>:8889

monkpit commented 6 years ago

Got it working after a little more effort. Thanks for the response!