# Running pipelines from templates not working

**URL:** <https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513>\
**Category:** Drone Support\
**Created:** [September 15, 2022, 8:03am UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513 "2022-09-15T08:03:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![natali](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/natali/32/7488_2.png) [@natali](https://drone.discourse.group/u/natali)\
**Post date:** [September 15, 2022, 8:03am UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/1 "2022-09-15T08:03:53Z")

</div>

Hey, I am trying to run pipelines using templates but all builds stuck at pending.  
I am new with the templates option, it worked for me for a while until suddenly all template pipelines are stuck at pending.  
The weird thing is, that when running the same pipeline exactly not from template- it works fine.

Drone configuration:  
Deployed with helm over our eks cluster  
drone chart version- 0.6.0  
drone runner kube chart version- 0.1.10

Providing an examples:  
Pipeline:  
kind: pipeline  
type: kubernetes  
name: default-test  
steps:

- name: test  
image: alpine  
commands:
  - echo “hey”

Build info:

- With template:  
{“id”:2087,“repo\_id”:73,“trigger”:“nataliavr”,“number”:816,“parent”:815,“status”:“pending”,“event”:“push”,“action”:“”,“link”:“[https://github.com/coognitive/core.centralized-auth/compare/092e1a462b0f...b7a16941f416",“timestamp”:0,“message”:"Update](https://github.com/coognitive/core.centralized-auth/compare/092e1a462b0f...b7a16941f416%22,%22timestamp%22:0,%22message%22:%22Update) .drone.yaml”,“before”:“092e1a462b0feaf1b48be3fbef739c8d02e44ca6”,“after”:“b7a16941f416d320184855ca996e2aa6402285ec”,“ref”:“refs/heads/dev”,“source\_repo”:“”,“source”:“dev”,“target”:“dev”,“author\_login”:“nataliavr”,“author\_name”:“nataliavr”,“author\_email”:"75317270+nataliavr@users.noreply.github.com",“author\_avatar”:“[https://avatars.githubusercontent.com/u/75317270?v=4",“sender”:“nataliavr”,“started”:0,“finished”:0,“created”:1663228309,“updated”:1663228309,“version”:1,“stages”:[{“id”:2040,“repo\_id”:73,“build\_id”:2087,“number”:1,“name”:“default”,“kind”:“template”,“status”:“pending”,“errignore”:false,“exit\_code”:0,“os”:“linux”,“arch”:“amd64”,“started”:0,“stopped”:0,“created”:1663228309,“updated”:1663228309,“version”:1,“on\_success”:true,"on\_failure](https://avatars.githubusercontent.com/u/75317270?v=4%22,%22sender%22:%22nataliavr%22,%22started%22:0,%22finished%22:0,%22created%22:1663228309,%22updated%22:1663228309,%22version%22:1,%22stages%22:%5B%7B%22id%22:2040,%22repo_id%22:73,%22build_id%22:2087,%22number%22:1,%22name%22:%22default%22,%22kind%22:%22template%22,%22status%22:%22pending%22,%22errignore%22:false,%22exit_code%22:0,%22os%22:%22linux%22,%22arch%22:%22amd64%22,%22started%22:0,%22stopped%22:0,%22created%22:1663228309,%22updated%22:1663228309,%22version%22:1,%22on_success%22:true,%22on_failure)”:false}]}

- Without template:  
{“id”:2088,“repo\_id”:73,“trigger”:“@hook”,“number”:817,“status”:“success”,“event”:“push”,“action”:“”,“link”:“[https://github.com/coognitive/core.centralized-auth/compare/b7a16941f416...d454c800a119",“timestamp”:0,“message”:"Update](https://github.com/coognitive/core.centralized-auth/compare/b7a16941f416...d454c800a119%22,%22timestamp%22:0,%22message%22:%22Update) .drone.yaml”,“before”:“b7a16941f416d320184855ca996e2aa6402285ec”,“after”:“d454c800a119bd528a8d12443abf9778aa17c62f”,“ref”:“refs/heads/dev”,“source\_repo”:“”,“source”:“dev”,“target”:“dev”,“author\_login”:“nataliavr”,“author\_name”:“nataliavr”,“author\_email”:"75317270+nataliavr@users.noreply.github.com",“author\_avatar”:“[https://avatars.githubusercontent.com/u/75317270?v=4",“sender”:“nataliavr”,“started”:1663228523,“finished”:1663228535,“created”:1663228523,“updated”:1663228523,“version”:3,“stages”:[{“id”:2041,“repo\_id”:73,“build\_id”:2088,“number”:1,“name”:“default-test”,“kind”:“pipeline”,“type”:“kubernetes”,“status”:“success”,“errignore”:false,“exit\_code”:0,“machine”:“drone-runner-kube-687884b76f-vlqj5”,“os”:“linux”,“arch”:“amd64”,“started”:1663228523,“stopped”:1663228535,“created”:1663228523,“updated”:1663228535,“version”:4,“on\_success”:true,“on\_failure”:false,“steps”:[{“id”:6228,“step\_id”:2041,“number”:1,“name”:“clone”,“status”:“success”,“exit\_code”:0,“started”:1663228525,“stopped”:1663228532,“version”:4,“image”:“drone/git:latest”},{“id”:6229,“step\_id”:2041,“number”:2,“name”:“test”,“status”:“success”,“exit\_code”:0,“started”:1663228532,“stopped”:1663228535,“version”:4,“depends\_on”:[“clone”],“image”:"docker.io/library/alpine:latest](https://avatars.githubusercontent.com/u/75317270?v=4%22,%22sender%22:%22nataliavr%22,%22started%22:1663228523,%22finished%22:1663228535,%22created%22:1663228523,%22updated%22:1663228523,%22version%22:3,%22stages%22:%5B%7B%22id%22:2041,%22repo_id%22:73,%22build_id%22:2088,%22number%22:1,%22name%22:%22default-test%22,%22kind%22:%22pipeline%22,%22type%22:%22kubernetes%22,%22status%22:%22success%22,%22errignore%22:false,%22exit_code%22:0,%22machine%22:%22drone-runner-kube-687884b76f-vlqj5%22,%22os%22:%22linux%22,%22arch%22:%22amd64%22,%22started%22:1663228523,%22stopped%22:1663228535,%22created%22:1663228523,%22updated%22:1663228535,%22version%22:4,%22on_success%22:true,%22on_failure%22:false,%22steps%22:%5B%7B%22id%22:6228,%22step_id%22:2041,%22number%22:1,%22name%22:%22clone%22,%22status%22:%22success%22,%22exit_code%22:0,%22started%22:1663228525,%22stopped%22:1663228532,%22version%22:4,%22image%22:%22drone/git:latest%22%7D,%7B%22id%22:6229,%22step_id%22:2041,%22number%22:2,%22name%22:%22test%22,%22status%22:%22success%22,%22exit_code%22:0,%22started%22:1663228532,%22stopped%22:1663228535,%22version%22:4,%22depends_on%22:%5B%22clone%22%5D,%22image%22:%22docker.io/library/alpine:latest)”}]}]}

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 15, 2022, 9:18am UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/2 "2022-09-15T09:18:44Z")

</div>

Hi @natali let me check the possible reasons for this issue and get back to you.

Thanks!

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 15, 2022, 9:34am UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/3 "2022-09-15T09:34:50Z")

</div>

Hi @natali can you check this link? you can get some solution from here: [Drone hangs when using templates - Drone](https://discourse.drone.io/t/drone-hangs-when-using-templates/9709)

Thanks!

---

<div class="post-metadata">

**Author:** ![natali](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/natali/32/7488_2.png) [@natali](https://drone.discourse.group/u/natali)\
**Post date:** [September 15, 2022, 10:34am UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/4 "2022-09-15T10:34:57Z")

</div>

Tried to add “—” as they mentioned in the end, but still pending.

* * *

kind: template  
load: test.yaml

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 15, 2022, 1:36pm UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/5 "2022-09-15T13:36:26Z")

</div>

Hi @natali can you share the template that you are using along with `.drone.yml` file?

Thanks!

---

<div class="post-metadata">

**Author:** ![natali](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/natali/32/7488_2.png) [@natali](https://drone.discourse.group/u/natali)\
**Post date:** [September 15, 2022, 1:41pm UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/6 "2022-09-15T13:41:55Z")

</div>

It also happend with other pipelines, so I made a very basic pipeline just to test templates issue  
The template is:

```auto
kind: pipeline
type: kubernetes
name: default-test
steps:
   - name: test
     image: alpine
     commands:
        - echo "hey"

```

and .drone.yml is:

```auto
---
kind: template
load: test.yaml

```

---

<div class="post-metadata">

**Author:** ![natali](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/natali/32/7488_2.png) [@natali](https://drone.discourse.group/u/natali)\
**Post date:** [September 15, 2022, 1:48pm UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/8 "2022-09-15T13:48:14Z")

</div>

I tested it now with another repo which haven’t been activated before to make a clean start, and in the other repo the same template works.  
But still when trying to run on first repo it stuck at pending.

Is there something that might prevent templates on specific repo? since running regular pipelines on that repo works fine

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 15, 2022, 2:48pm UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/9 "2022-09-15T14:48:40Z")

</div>

got it! @natali let me check

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 15, 2022, 5:40pm UTC](https://drone.discourse.group/t/running-pipelines-from-templates-not-working/12513/10 "2022-09-15T17:40:38Z")

</div>

@natali usually templates are attached to the organization so you might possibly get an error if you tried to use a template from a different organization.

Thanks!
