# Error creating stack using docker-compose.yml and rancher-compose.yml

**URL:** <https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828>\
**Category:** Rancher 1.x\
**Created:** [December 7, 2016, 11:39am UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828 "2016-12-07T11:39:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Felicissimo](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@Fernando\_Felicissimo](https://forums.suse.com/u/Fernando_Felicissimo)\
**Post date:** [December 7, 2016, 11:39am UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828/1 "2016-12-07T11:39:48Z")

</div>

I ran an export of the config from a stack later I deleted the stack and I recreated it using docker-compose.yml and rancher-compose.yml from the Rancher console and it gives me an error **“Failed to find existing service: Merchanweb)”.**

**rancher-compose.yml**

version: '2’  
services:  
merchanapiback:  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 18202  
unhealthy\_threshold: 3  
initializing\_timeout: 60000  
interval: 2000  
strategy: recreate  
request\_line: GET “/ping” "HTTP/1.0"  
reinitializing\_timeout: 60000  
merchanapibacklb:  
lb\_config:  
certs: []  
port\_rules:  
- priority: 1  
protocol: http  
service: merchan/merchanapiback  
source\_port: 18202  
target\_port: 18202  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 42  
unhealthy\_threshold: 3  
interval: 2000  
merchanapiservicelb:  
lb\_config:  
certs: []  
port\_rules:  
- priority: 1  
protocol: http  
service: merchan/merchanapiservice  
source\_port: 18203  
target\_port: 18203  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 42  
unhealthy\_threshold: 3  
interval: 2000  
merchanapiservice:  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 18203  
unhealthy\_threshold: 3  
initializing\_timeout: 60000  
interval: 2000  
strategy: recreate  
request\_line: GET “/ping” "HTTP/1.0"  
reinitializing\_timeout: 60000  
merchanweb:  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 18201  
unhealthy\_threshold: 3  
initializing\_timeout: 60000  
interval: 2000  
strategy: recreate  
request\_line: GET “/ping” "HTTP/1.0"  
reinitializing\_timeout: 60000  
merchanweblb:  
lb\_config:  
certs: []  
port\_rules:  
- priority: 1  
protocol: http  
service: merchan/merchanweb  
source\_port: 18201  
target\_port: 18201  
health\_check:  
response\_timeout: 2000  
healthy\_threshold: 2  
port: 42  
unhealthy\_threshold: 3  
interval: 2000

**docker-compose.yml**

version: '2’  
services:  
merchanapiback:  
image: qideia/merchanapiback  
environment:  
APORT: '18202’  
MONGO: DB:10200/MERCHAN  
HTTPSERVER: 'TRUE’  
MERCHANTOKEN:\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*xM2FmM2MTR4NS4  
stdin\_open: true  
tty: true  
labels:  
io.rancher.container.pull\_image: always  
io.rancher.scheduler.global: 'true’  
merchanapibacklb:  
image: rancher/lb-service-haproxy:v0.4.2  
ports:  
- 18202:18202/tcp  
labels:  
io.rancher.container.agent.role: environmentAdmin  
io.rancher.container.create\_agent: 'true’  
io.rancher.scheduler.global: 'true’  
merchanapiservicelb:  
image: rancher/lb-service-haproxy:v0.4.2  
ports:  
- 18203:18203/tcp  
labels:  
io.rancher.container.agent.role: environmentAdmin  
io.rancher.container.create\_agent: 'true’  
io.rancher.scheduler.global: 'true’  
merchanapiservice:  
image: qideia/merchanapiusuario  
environment:  
APIGEEURL: [https://apigateway.com.br/v1](https://apigateway.com.br/v1)  
CODIGOSISTEMA: '3808’  
APIGEEAUTHTOKEN: Bearer \*\*\*\*\*\*\*\*\*\*\*AiF2wAnGWGgx  
HTTPSERVER: 'TRUE’  
MERCHANTOKEN:\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*5NGExM2FmM2MTR4NS4  
APORT: '18203’  
stdin\_open: true  
tty: true  
labels:  
io.rancher.container.pull\_image: always  
io.rancher.scheduler.global: 'true’  
merchanweb:  
image: qideia/merchanweb  
environment:  
MERCHANTOKEN:\*\*\*\*\*\*\*\*\*GExM2FmM2MTR4NS4  
URLAPIUSUARIO: [http://IP:18203/merchan/api/v1](http://IP:18203/merchan/api/v1)  
URLAPITIROCERTO: [http://IP:18202/merchan/api/v1](http://IP:18202/merchan/api/v1)  
PORT: '18201’  
HTTPSERVER: 'TRUE’  
stdin\_open: true  
tty: true  
labels:  
io.rancher.container.pull\_image: always  
io.rancher.scheduler.global: 'true’  
merchanweblb:  
image: rancher/lb-service-haproxy:v0.4.2  
ports:  
- 18201:18201/tcp  
labels:  
io.rancher.container.agent.role: environmentAdmin  
io.rancher.container.create\_agent: 'true’  
io.rancher.scheduler.global: ‘true’

---

<div class="post-metadata">

**Author:** ![dishcandanty](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dishcandanty](https://forums.suse.com/u/dishcandanty)\
**Post date:** [December 12, 2016, 7:55pm UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828/2 "2016-12-12T19:55:30Z")

</div>

> [@Fernando\_Felicissimo](#):
>
> Failed to find existing service

Having a similar issue. Did you find a fix? anyone else with thoughts?

---

<div class="post-metadata">

**Author:** ![kataik](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@kataik](https://forums.suse.com/u/kataik)\
**Post date:** [December 13, 2016, 11:05pm UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828/3 "2016-12-13T23:05:14Z")

</div>

I was facing the same issue. You should not qualify your service with the stack’s name in your rancher-compose.yml, like:  
lb\_config:  
…  
service: merchanweb

Once the stack is created, it will automatically prefixed with the stack’s name.

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [December 14, 2016, 1:42am UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828/4 "2016-12-14T01:42:35Z")

</div>

This is already fixed in Rancher v1.2.1. If you exported a stack that had a load balancer pointing to a service in the stack, it was prefixed with the stack name in the port rules of the load balancer.

[https://github.com/rancher/rancher/issues/6829](https://github.com/rancher/rancher/issues/6829)

---

<div class="post-metadata">

**Author:** ![Fernando\_Felicissimo](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@Fernando\_Felicissimo](https://forums.suse.com/u/Fernando_Felicissimo)\
**Post date:** [December 15, 2016, 10:57pm UTC](https://forums.suse.com/t/error-creating-stack-using-docker-compose-yml-and-rancher-compose-yml/4828/5 "2016-12-15T22:57:28Z")

</div>

Fixed thanks Denise… I upgraded to version 1.2.1-rc3
