{"action":"created","issue":{"url":"https://api.github.com/repos/hyperhq/hyperd/issues/722","repository_url":"https://api.github.com/repos/hyperhq/hyperd","labels_url":"https://api.github.com/repos/hyperhq/hyperd/issues/722/labels{/name}","comments_url":"https://api.github.com/repos/hyperhq/hyperd/issues/722/comments","events_url":"https://api.github.com/repos/hyperhq/hyperd/issues/722/events","html_url":"https://github.com/hyperhq/hyperd/issues/722","id":326879172,"number":722,"title":"Consul docker image doesn't work with hyperctl or docker+runv","user":{"login":"svarlamov","id":10859025,"avatar_url":"https://avatars0.githubusercontent.com/u/10859025?v=4","gravatar_id":"","url":"https://api.github.com/users/svarlamov","html_url":"https://github.com/svarlamov","followers_url":"https://api.github.com/users/svarlamov/followers","following_url":"https://api.github.com/users/svarlamov/following{/other_user}","gists_url":"https://api.github.com/users/svarlamov/gists{/gist_id}","starred_url":"https://api.github.com/users/svarlamov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svarlamov/subscriptions","organizations_url":"https://api.github.com/users/svarlamov/orgs","repos_url":"https://api.github.com/users/svarlamov/repos","events_url":"https://api.github.com/users/svarlamov/events{/privacy}","received_events_url":"https://api.github.com/users/svarlamov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-28T02:44:31Z","updated_at":"2018-05-28T03:17:34Z","closed_at":null,"author_association":"NONE","body":"I've been struggling to debug an issue with the standard [consul image](https://hub.docker.com/_/consul/https://hub.docker.com/_/consul/) when running on docker+runv and/or pure hyperctl stack.\r\n\r\nFirst of all, when running docker+runc (on the same fresh Ubuntu 16.04 bare metal box for all these examples -- I also tried on centos 7 bare metal and two other ubuntu 16.04 bare metal boxes), I get the following successful start:\r\n\r\n```bash\r\nroot@hyperdev-02:~# docker run -d   --name consul   -p \"8500:8500\"   -h \"consul\"   consul agent -server -bootstrap -client \"0.0.0.0\"\r\na991885eddd23412dfceb3b5bbd56d1e52b0ef67e29ae54405e3012da2576c7b\r\nroot@hyperdev-02:~# docker ps\r\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                      NAMES\r\na991885eddd2        consul              \"docker-entrypoint...\"   45 seconds ago      Up 21 seconds       8300-8302/tcp, 8301-8302/udp, 8600/tcp, 8600/udp, 0.0.0.0:8500->8500/tcp   consul\r\nroot@hyperdev-02:~# docker logs a991885eddd2\r\nbootstrap = true: do not enable unless necessary\r\n==> Starting Consul agent...\r\n==> Consul agent running!\r\n           Version: 'v1.1.0'\r\n           Node ID: 'fb56a8fd-1dcc-70ae-231e-19f4fc012a14'\r\n         Node name: 'consul'\r\n        Datacenter: 'dc1' (Segment: '<all>')\r\n            Server: true (Bootstrap: true)\r\n       Client Addr: [0.0.0.0] (HTTP: 8500, HTTPS: -1, DNS: 8600)\r\n      Cluster Addr: 172.17.0.2 (LAN: 8301, WAN: 8302)\r\n           Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false\r\n\r\n==> Log data will now stream in as it occurs:\r\n\r\n    2018/05/27 11:45:24 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:fb56a8fd-1dcc-70ae-231e-19f4fc012a14 Address:172.17.0.2:8300}]\r\n    2018/05/27 11:45:24 [INFO] raft: Node at 172.17.0.2:8300 [Follower] entering Follower state (Leader: \"\")\r\n    2018/05/27 11:45:24 [INFO] serf: EventMemberJoin: consul.dc1 172.17.0.2\r\n    2018/05/27 11:45:24 [INFO] serf: EventMemberJoin: consul 172.17.0.2\r\n    2018/05/27 11:45:24 [INFO] agent: Started DNS server 0.0.0.0:8600 (tcp)\r\n    2018/05/27 11:45:24 [INFO] consul: Adding LAN server consul (Addr: tcp/172.17.0.2:8300) (DC: dc1)\r\n    2018/05/27 11:45:24 [INFO] agent: Started DNS server 0.0.0.0:8600 (udp)\r\n    2018/05/27 11:45:24 [INFO] consul: Handled member-join event for server \"consul.dc1\" in area \"wan\"\r\n    2018/05/27 11:45:24 [INFO] agent: Started HTTP server on [::]:8500 (tcp)\r\n    2018/05/27 11:45:24 [INFO] agent: started state syncer\r\n    2018/05/27 11:45:30 [WARN] raft: Heartbeat timeout from \"\" reached, starting election\r\n    2018/05/27 11:45:30 [INFO] raft: Node at 172.17.0.2:8300 [Candidate] entering Candidate state in term 2\r\n    2018/05/27 11:45:30 [INFO] raft: Election won. Tally: 1\r\n    2018/05/27 11:45:30 [INFO] raft: Node at 172.17.0.2:8300 [Leader] entering Leader state\r\n    2018/05/27 11:45:30 [INFO] consul: cluster leadership acquired\r\n    2018/05/27 11:45:30 [INFO] consul: New leader elected: consul\r\n    2018/05/27 11:45:30 [INFO] consul: member 'consul' joined, marking health alive\r\n    2018/05/27 11:45:30 [INFO] agent: Synced node info\r\n```\r\n\r\nAnd subsequently, the consul server works as expected.\r\n\r\nNow, with docker+runv, I run the same `docker run ...` command as above, but I get the following output in the docker logs and the container exits:\r\n\r\n```bash\r\nroot@hyperdev-02:~# docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES\r\nbcadbb56da7c        consul              \"docker-entrypoint...\"   10 seconds ago      Exited (1) 6 seconds ago                           consul\r\nroot@hyperdev-02:~# docker logs bcadbb56da7c\r\nbootstrap = true: do not enable unless necessary\r\n==> Starting Consul agent...\r\n==> Error starting agent: Failed to start Consul server: Failed to start Raft: invalid argument\r\n```\r\n\r\nThe process (and container) exit with the mysterious \"Failed to start Consul server\" error...\r\n\r\nTrying it with `hyperctl` (slightly different command as `hyperctl` doesn't support the `-h` host flag):\r\n\r\n```bash\r\nroot@hyperdev-02:~# hyperctl run -d --name consul --publish 8500:8500 consul agent -server -bootstrap -client \"0.0.0.0\"\r\nUsing default tag: latest\r\nlatest: Pulling from library/consul\r\nff3a5c916c92: Pull complete \r\n4f7ceec429a3: Pull complete \r\n479d56dd1427: Pull complete \r\nfe7ac0cf7b6b: Pull complete \r\ne2db5deeb099: Pull complete \r\nDigest: sha256:1c7b20c43b933c34e52e56f33904dda64cd78f085cab670cfc7c3ee34429a249\r\nStatus: Downloaded newer image for consul:latest\r\nsha256:1c7b20c43b933c34e52e56f33904dda64cd78f085cab670cfc7c3ee34429a249: Pulling from library/consul\r\nDigest: sha256:1c7b20c43b933c34e52e56f33904dda64cd78f085cab670cfc7c3ee34429a249\r\nStatus: Downloaded newer image for consul@sha256:1c7b20c43b933c34e52e56f33904dda64cd78f085cab670cfc7c3ee34429a249\r\nPOD id is consul\r\nTime to run a POD is 35350 ms\r\nroot@hyperdev-02:~# hyperctl list\r\nPOD ID              POD Name            VM name             Status\r\nconsul              consul              vm-taqgLYUXKv       running\r\nroot@hyperdev-02:~# hyperctl logs consul\r\nbootstrap = true: do not enable unless necessary\r\n==> Starting Consul agent...\r\n==> Error starting agent: Failed to start Consul server: Failed to start Raft: invalid argument\r\n```\r\n\r\nThe first thing that I noticed is that when running with `runv`, the `PORTS` in the `docker ps` command are missing... So I have also tried running the container with `--net=host` which doesn't seem to work with `runv` for whatever reason... And then I also tried to just `--publish` all of the ports that are exposed in the `consul:latest` Dockerfile, but that yielded the same error...\r\n\r\nOn a separate note, it'd be great to have some sort of a lookup table/doc article with a list of known incompatabilities+workarounds for normal docker containers running on the `runv` stack... Maybe this exists, but I haven't been able to uncover it. Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/hyperhq/hyperd/issues/comments/392408549","html_url":"https://github.com/hyperhq/hyperd/issues/722#issuecomment-392408549","issue_url":"https://api.github.com/repos/hyperhq/hyperd/issues/722","id":392408549,"user":{"login":"svarlamov","id":10859025,"avatar_url":"https://avatars0.githubusercontent.com/u/10859025?v=4","gravatar_id":"","url":"https://api.github.com/users/svarlamov","html_url":"https://github.com/svarlamov","followers_url":"https://api.github.com/users/svarlamov/followers","following_url":"https://api.github.com/users/svarlamov/following{/other_user}","gists_url":"https://api.github.com/users/svarlamov/gists{/gist_id}","starred_url":"https://api.github.com/users/svarlamov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svarlamov/subscriptions","organizations_url":"https://api.github.com/users/svarlamov/orgs","repos_url":"https://api.github.com/users/svarlamov/repos","events_url":"https://api.github.com/users/svarlamov/events{/privacy}","received_events_url":"https://api.github.com/users/svarlamov/received_events","type":"User","site_admin":false},"created_at":"2018-05-28T03:17:34Z","updated_at":"2018-05-28T03:17:34Z","author_association":"NONE","body":"I have also tried the exact 'fix' described in the following reddit post for consul on windows -- which is very similar in that it's VM-based -- but I get the same error as before...\r\n\r\nhttps://www.reddit.com/r/docker/comments/89nhkw/i_am_trying_to_run_a_containerized_consul_on/\r\n\r\n`-p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302/udp -p 8302:8302 -p 8400:8400 -p 8500:8500 -p 53:53/udp`"}}
{"actor":{"display_login":"svarlamov"}}