# \[API\] external\_links are ignored when creating a stack (environment) using the API

**URL:** <https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193>\
**Category:** Rancher 1.x\
**Created:** [December 8, 2015, 1:49pm UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193 "2015-12-08T13:49:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [December 8, 2015, 1:49pm UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/1 "2015-12-08T13:49:25Z")

</div>

Hi.

My assumption is that when passing a docker-compose.yml to the API when creating a stack it should behave just like it would had I used rancher-compose. It seems not to be the case for external links - they are ignored.

My simple (and not very constructive, I know, I’m playing with different features) docker-compose:

> foo:  
> restart: “no”  
> external\_links:  
> - “Default/artifacts-external:artifacts-external”  
> image: nginx  
> command: sleep 30  
> labels:  
> io.rancher.container.start\_once: true

and an even simpler rancher-compose.yml:

> foo:  
> scale: ‘1’

So are my assumptions incorrect, or is this a bug?

---

<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 10, 2015, 5:25am UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/2 "2015-12-10T05:25:29Z")

</div>

There shouldn’t be any bug, but you might be hitting this issue where if you have multiple environments the links (including external ones) to not show up.

I’m assuming that you have the yaml file correctly white spaced as it’s not correctly whitespaced in what you provided.

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

---

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [December 10, 2015, 8:04am UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/3 "2015-12-10T08:04:02Z")

</div>

I do have several environments, and I often see exactly that issue. But I don’t think that’s what’s going on here.  
When I look at the service config the links aren’t there either, which I assume they would have to be should a refresh improve the situation. And a refresh has no effect.  
And yes, the indentation is correct in the file but got crippled when pasting it to the chat.

---

<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, 2015, 8:33pm UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/4 "2015-12-14T20:33:45Z")

</div>

What version of Rancher and rancher-compose are you using?

How did you check that external\_links are not working? Also, is the `artifacts-external` service active? If there are no containers in the service that are running, there is nothing to return.

---

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [December 15, 2015, 7:16am UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/5 "2015-12-15T07:16:44Z")

</div>

@denise I tried with version 0.46 and 0.47.  
The “test” was simply looking at the resulting yaml configs in the UI. No external links showed up on any of the versions and refreshing the UI had no effect. And yes, the artifacts-external service was active.  
The container was running for 30 seconds, then stopped. That was plenty for me to check the configs, and even do a refresh. Would Rancher need more time than that?

---

<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 17, 2015, 7:52pm UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/6 "2015-12-17T19:52:22Z")

</div>

Do you know why the container stopped? Honestly, I don’t know if it would be enough time to check the config.

---

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [December 18, 2015, 7:41am UTC](https://forums.suse.com/t/api-external-links-are-ignored-when-creating-a-stack-environment-using-the-api/1193/7 "2015-12-18T07:41:04Z")

</div>

@denise, yes it stops because it only runs a sleep for 30 seconds (as evident from the yml file). It does not restart due to the run\_once label. All of that works fine.  
I’ve resorted to the docker API for our current batch processing needs, so I haven’t given this a try with the latest (0.50 and 0.50.1) versions.

I do see that issue #1389 is still present in the latest versions though.
