{"action":"created","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/7032","repository_url":"https://api.github.com/repos/rancher/rancher","labels_url":"https://api.github.com/repos/rancher/rancher/issues/7032/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/7032/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/7032/events","html_url":"https://github.com/rancher/rancher/issues/7032","id":195319615,"number":7032,"title":"Could not create stack with Load Balancer","user":{"login":"clicman","id":1079535,"avatar_url":"https://avatars.githubusercontent.com/u/1079535?v=3","gravatar_id":"","url":"https://api.github.com/users/clicman","html_url":"https://github.com/clicman","followers_url":"https://api.github.com/users/clicman/followers","following_url":"https://api.github.com/users/clicman/following{/other_user}","gists_url":"https://api.github.com/users/clicman/gists{/gist_id}","starred_url":"https://api.github.com/users/clicman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clicman/subscriptions","organizations_url":"https://api.github.com/users/clicman/orgs","repos_url":"https://api.github.com/users/clicman/repos","events_url":"https://api.github.com/users/clicman/events{/privacy}","received_events_url":"https://api.github.com/users/clicman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-13T17:39:10Z","updated_at":"2016-12-14T00:28:27Z","closed_at":"2016-12-13T18:19:18Z","body":"**Rancher Version:** 1.2\r\n\r\n**Docker Version:** 1.12.3\r\n\r\n**OS and where are the hosts located? (cloud, bare metal, etc):** Ubuntu 16.04 on Azure\r\n\r\n**Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB)** Single node\r\n\r\n**Environment Type: (Cattle/Kubernetes/Swarm/Mesos)** Cattle\r\n\r\n**Steps to Reproduce:**\r\nCreate stack (a71 in my case) via docker and rancher composes with service and load balancer configured to serve this service\r\n\r\n**Results:** \r\n Error (Failed to find existing service: a71/mongo)\r\n\r\n\r\n**Expected:**\r\nStack successfully created\r\n\r\n\r\n*docker-compose.yml*\r\n```yml\r\napi:\r\n  environment: {COMMIT_HASH: 147e1006029a584c7df932ff4c8dfeebf407108c, DB_MONGO_DB: dddb,\r\n    DB_MONGO_HOST: mongo, DB_MONGO_PASSWORD: '123456', DB_MONGO_PORT: '27017',\r\n    DB_MONGO_USER: user, DB_POSTGRES_DB: dddb, DB_POSTGRES_HOST: postgres, DB_POSTGRES_PASSWORD: '123456',\r\n    DB_POSTGRES_PORT: '5432', DB_POSTGRES_USER: postres, GIT_BRANCH: master}\r\n  external_links: ['postgres/postgres:postgres']\r\n  image: docker-registry:5000/api\r\n  labels: {io.rancher.container.pull_image: always, 'io.rancher.scheduler.affinity:host_label': purpose=ci}\r\n  links: ['mongo:']\r\n  log_driver: ''\r\n  log_opt: {}\r\n  stdin_open: true\r\n  tty: true\r\nmongo:\r\n  environment: {DB_MONGO_PORT: '27017'}\r\n  image: docker-registry:5000/mongo\r\n  labels: {io.rancher.container.pull_image: always}\r\n  log_driver: ''\r\n  log_opt: {}\r\n  stdin_open: true\r\n  tty: true\r\nmongo-balancer:\r\n  image: rancher/lb-service-haproxy:v0.4.2\r\n  labels: {io.rancher.container.agent.role: environmentAdmin, io.rancher.container.create_agent: 'true',\r\n    'io.rancher.scheduler.affinity:host_label': balancer=true}\r\n  ports: ['60000:60000/tcp']\r\nsite:\r\n  environment: {API_URL: 'http://api.XXX', CLOUD_STORAGE_URL: 'http://api.XXX/resources'}\r\n  image: docker-registry:5000/site\r\n  labels: {io.rancher.container.pull_image: always, 'io.rancher.scheduler.affinity:host_label': purpose=ci}\r\n  links: ['api:']\r\n  log_driver: ''\r\n  log_opt: {}\r\n  stdin_open: true\r\n  tty: true\r\n```\r\n\r\n*rancher-compose.yml*\r\n```yml\r\napi:\r\n  health_check: {healthy_threshold: 2, initializing_timeout: 360000, interval: 2000,\r\n    port: 5099, response_timeout: 5000, strategy: none, unhealthy_threshold: 3}\r\n  scale: 1\r\nmongo: {scale: 1}\r\nmongo-balancer:\r\n  health_check: {healthy_threshold: 2, interval: 2000, port: 42, response_timeout: 2000,\r\n    unhealthy_threshold: 3}\r\n  lb_config:\r\n    certs: []\r\n    config: timeout tunnel        15m\r\n    port_rules:\r\n    - {priority: '1', protocol: tcp, service: a71/mongo, source_port: '60000', target_port: '27017'}\r\n  scale: 1\r\nsite:\r\n  health_check: {healthy_threshold: 2, initializing_timeout: 360000, interval: 2000,\r\n    port: 3000, request_line: GET \"/healthcheck\" \"HTTP/1.0\", response_timeout: 2000,\r\n    strategy: recreate, unhealthy_threshold: 10}\r\n  scale: 1\r\n```\r\n\r\nIt seems load balancer should not try to resolve targets until all other services created. Or it should be more smart check strategy. And I believe it possible, because all necessary information given to rancher.\r\n\r\nAnd you can see what all services are up, but balancer not created\r\n![image](https://cloud.githubusercontent.com/assets/1079535/21151670/ea9a480c-c195-11e6-9476-fcd9ab1881e8.png)\r\n"},"comment":{"url":"https://api.github.com/repos/rancher/rancher/issues/comments/266905786","html_url":"https://github.com/rancher/rancher/issues/7032#issuecomment-266905786","issue_url":"https://api.github.com/repos/rancher/rancher/issues/7032","id":266905786,"user":{"login":"clicman","id":1079535,"avatar_url":"https://avatars.githubusercontent.com/u/1079535?v=3","gravatar_id":"","url":"https://api.github.com/users/clicman","html_url":"https://github.com/clicman","followers_url":"https://api.github.com/users/clicman/followers","following_url":"https://api.github.com/users/clicman/following{/other_user}","gists_url":"https://api.github.com/users/clicman/gists{/gist_id}","starred_url":"https://api.github.com/users/clicman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clicman/subscriptions","organizations_url":"https://api.github.com/users/clicman/orgs","repos_url":"https://api.github.com/users/clicman/repos","events_url":"https://api.github.com/users/clicman/events{/privacy}","received_events_url":"https://api.github.com/users/clicman/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T00:28:27Z","updated_at":"2016-12-14T00:28:27Z","body":"Thank you! My fault."}}
{"actor":{"display_login":"clicman"}}