# Cron doesn't trigger for a branch name with a slash in the name

**URL:** https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695
**Category:** Drone Support
**Created:** [November 25, 2021, 3:34pm UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695 "2021-11-25T15:34:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Chris\_S](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Chris\_S](https://drone.discourse.group/u/Chris_S)
#### Post date: [November 25, 2021, 3:34pm UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695/1 "2021-11-25T15:34:37Z")

</div>

We’ve been using Drone (1.x) Cron successfully for some time with a simple branch name such as `version` or `main`. However, when we try to add a Cron with a branch name such as `release/version/1.0.0`, we note that the Cron is never triggered (or if it is, nothing shows in the Drone UI/Logs).

Our pipeline is defined using Starlark in a `.drone.star` file; converting this to `.drone.yaml` using the `drone starlark` command also gives no output for such branch names, for example:

```bash
drone starlark --build.event cron --build.branch version --build.commit my-commit --stdout

```

outputs the expected set of pipeline definitions to STDOUT, while

```bash
drone starlark --build.event cron --build.branch release/version/1.0.0 --build.commit my-commit --stdout

```

outputs an empty YAML document:

> …

---

<div class="post-metadata">

### Author: ![csgitharness](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/csgitharness/32/904_2.png) [@csgitharness](https://drone.discourse.group/u/csgitharness)
#### Post date: [November 30, 2021, 11:34am UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695/2 "2021-11-30T11:34:33Z")

</div>

Hello @Chris_S  
Thank you for reaching out to Harness Support. This does seem like an odd occurrence, could you please share with us the Drone Server logs from the Pod when the cron command is executed manually?

Looking Forward to hearing from you.

Thanks & Regards,  
Harness Support

---

<div class="post-metadata">

### Author: ![Chris\_S](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Chris\_S](https://drone.discourse.group/u/Chris_S)
#### Post date: [November 30, 2021, 1:32pm UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695/3 "2021-11-30T13:32:40Z")

</div>

Unfortunately I don’t have access to the Drone Server logs as it’s a managed service used by multiple tennants - I’ll ask whether there’s anything the managed service provider can extract for us to paste here in future

---

<div class="post-metadata">

### Author: ![Chris\_S](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Chris\_S](https://drone.discourse.group/u/Chris_S)
#### Post date: [December 2, 2021, 12:32pm UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695/4 "2021-12-02T12:32:50Z")

</div>

The only logs we’ve been able to find via our managed service support team is:

```json
{"branch":"master","cron":571,"error":"","level":"warning","msg":"cron: cannot find commit","repo":"our/repo","time":"2021-12-01T09:24:23Z"}

```

Confusingly this log indicates a branch of `master` whereas we’d explicitly specified a branch of `release/version/4.0.0` in our Drone cron job to run at 09:00 yesterday.

Resetting our cron job to our normal `version` branch allowed it to run successfully this morning. So definitely something going wrong on the Drone side it seems.

---

<div class="post-metadata">

### Author: ![SimonVHB](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/simonvhb/32/3423_2.png) [@SimonVHB](https://drone.discourse.group/u/SimonVHB)
#### Post date: [January 13, 2022, 8:49am UTC](https://drone.discourse.group/t/cron-doesnt-trigger-for-a-branch-name-with-a-slash-in-the-name/9695/5 "2022-01-13T08:49:23Z")

</div>

Hi,

We’re running the latest version (2.8.0) of Drone and I’m seeing the same problem.  
When you the target branch of a cron job has a “/” (slash) it won’t trigger.

I did some debugging though, it has something to do with the url encoding of the slash in the branch name.  
If I for example create a cron job, with the target branch `release%2Fversion` instead of `release/version` the cron job does start running (I see the correct steps and name for the pipeline in the build). But now the clone step now fails due to it searching for a ref which doesn’t exist (`fatal: couldn't find remote ref refs/heads/release%2Fversion`).

It’s not the UI having the problem though, because when I create the cron job using the API, I have the same problem.

When trying to trigger the cron job (again with the correct branch name, including the slash) using the API, drone returns the following empty message: `{"message":""}`

All the testing I did was not with starlark btw, just normal yaml config files.
