Capgemini / mesos-ui

An alternative web UI for Apache Mesos, built with :heart: and React.JS
http://capgemini.github.io/devops/mesos-ui
MIT License
220 stars 48 forks source link

Unable to access UI #102

Open tejas0908 opened 8 years ago

tejas0908 commented 8 years ago

I have deployed mesos-ui as a marathon app using its docker image. But when i try to access the UI, it responds with a 404.

Here's the curl output

curl -v http://localhost:51026
* Rebuilt URL to: http://localhost:51026/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 51026 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:51026
> Accept: */*
>
< HTTP/1.1 404 Not Found
< X-Powered-By: Express
< X-Content-Type-Options: nosniff
< Content-Type: text/html; charset=utf-8
< Content-Length: 13
< Date: Tue, 27 Sep 2016 05:09:20 GMT
< Connection: keep-alive
<
Cannot GET /
* Connection #0 to host localhost left intact

Here's a copy of my marathon.json

{
  "id": "mesos-ui",
  "instances": 1,
  "cpus": 0.2,
  "mem": 512,
  "env": {
    "ZOOKEEPER_ADDRESS": "mesos-master:2181"
  },
  "labels": {
    "DCOS_PACKAGE_NAME": "mesos-ui",
    "DCOS_PACKAGE_IS_FRAMEWORK": "false",
    "DCOS_PACKAGE_VERSION": "0.1.0"
  },
  "healthChecks": [
    {
      "gracePeriodSeconds": 120,
      "intervalSeconds": 15,
      "maxConsecutiveFailures": 10,
      "path": "/",
      "portIndex": 0,
      "protocol": "HTTP",
      "timeoutSeconds": 5
    }
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "capgemini/mesos-ui:standalone-latest",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 5000,
          "hostPort": 51026,
          "servicePort": 10097,
          "protocol": "tcp"
        }
      ]
    }
  }
}

It looks like the request is going through to express. So the docker port mappings should be fine. But the GET / seems to give a 404.

Would appreciate any help.

pavel-main commented 7 years ago

I have the same error, deployed via Docker command-line:

docker run -p 5000:5000 -e ZOOKEEPER_ADDRESS="localhost:2181" capgemini/mesos-ui:standalone-latest
pavel-main commented 7 years ago

@tejas0908 Ok, I've resolved this, looks like repo README and Marathon config are outdated. Use the instruction from Docker Hub: https://hub.docker.com/r/capgemini/mesos-ui

tl;dr Instead of ZOOKEEPER_ADDRESS provide MESOS_ENDPOINT environment variable.

enxebre commented 7 years ago

Hi there! thanks for reporting the issue!

Are you actually running Zookeeper and is it reachable from the container? The issue you're finding is probably the app not being able to connect to zookeeper which results in not loading properly and giving the 404.

If you are not running Zookeeper or don't want to use master election you can use MESOS_ENDPOINT as you just pointed out. For testing without running Mesos you can just: export NODE_ENV=development which will enable a stub server on :8000

then: docker run -p 5000:5000 -p 8000:8000 -e MESOS_ENDPOINT=127.0.0.1:8000 capgemini/mesos-ui:standalone-latest

We need to update the docs and improving error logging to reflect this.

pavel-main commented 7 years ago

@enxebre I had a Zookeeper/Mesos master on the same instance:

$ echo ruok | nc localhost 2181
imok

Something definitely broken with ZOOKEEPER_ADDRESS environment variable

pavel-main commented 7 years ago

@enxebre You were right, container didn't have access to it's host machine services. It worked, when I've provided docker0 link IP address:

$ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:93:ed:16:3b  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:93ff:feed:163b/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:4262 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8848039 (8.8 MB)  TX bytes:470642 (470.6 KB)

And then:

docker run -p 5000:5000 -e ZOOKEEPER_ADDRESS="172.17.0.1:2181" capgemini/mesos-ui:standalone-latest
enxebre commented 7 years ago

oh brilliant, thanks for feedback! It sucks we can't see anything on the logs though. Just created a ticket for this https://github.com/Capgemini/mesos-ui/issues/104