# Drone calling wrong URL on gitea tag create hook

**URL:** <https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818>\
**Category:** Drone Support\
**Created:** [October 18, 2017, 5:04pm UTC](https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818 "2017-10-18T17:04:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dashie/32/3969_2.png) [@dashie](https://drone.discourse.group/u/dashie)\
**Post date:** [October 18, 2017, 5:04pm UTC](https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818/1 "2017-10-18T17:04:54Z")

</div>

The webhook when creating a tag always returns 404, I’m using drone 0.7.

Note: yes, my x-forwarded-things are OK since a `push` works perfectly, here is the `create` for tags which doesn’t works.

According to some issues I found (`http://discuss.harness.io/t/drone-0-5-817-gitea-a-gogs-fork-tag-webhook-404/105/5`, `https://github.com/drone/drone/issues/1870` then `https://github.com/go-gitea/gitea/issues/426`), drone is likely using the wrong url to get the .drone.yml file for tag push.

I can manually access to “`https://mygitea/api/v1/repos/dashie/somerepository/raw/v0.4.2/.drone.yml`” without the extras “refs/tag”, with refs/tags it will fails.

But in the log from the nginx serving gitea:  
`GET /api/v1/repos/dashie/somerepository/raw//.drone.yml HTTP/1.1" 404 3544 "-" "Go-http-client/1.1`

This is an URL called **by** drone, and the tag is missing “/raw//.drone.yml”

Is that a new bug or incompatibility with the/my current gitea (1.2.0+rc2) webhook ?

For reference, the payload my gitea is pushing:

````auto
  "secret": "blah====",
  "sha": "b2fb92d248b4ceb8e23817c7ecd23d4c1bbb3e49",
  "ref": "v0.4.2",
  "ref_type": "tag",
  "repository": {
    "id": 69,
    "owner": {
      "id": 1,
      "login": "dashie",
      "full_name": "x",
      "email": "x",
      "avatar_url": "x",
      "username": "dashie"
    },
    "name": "somerepository",
    "full_name": "dashie/somerepository",
    "description": "x.",
    "empty": false,
    "private": false,
    "fork": false,
    "parent": null,
    "mirror": false,
    "size": 26600,
    "html_url": "http://mygitea/dashie/somerepository",
    "ssh_url": "gogs@mygitea:dashie/somerepository.git",
    "clone_url": "http://mygitea/dashie/somerepository.git",
    "website": "https://mygitea/",
    "stars_count": 0,
    "forks_count": 1,
    "watchers_count": 1,
    "open_issues_count": 0,
    "default_branch": "master",
    "created_at": "2017-05-05T11:00:49+02:00",
    "updated_at": "2017-10-18T09:39:09+02:00",
    "permissions": {
      "admin": false,
      "push": false,
      "pull": false
    }
  },
  "sender": {
    "id": 1,
    "login": "dashie",
    "full_name": "x",
    "email": "x",
    "avatar_url": "x",
    "username": "dashie"
  }
}```
````

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 18, 2017, 6:01pm UTC](https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818/2 "2017-10-18T18:01:35Z")

</div>

> Is that a new bug or incompatibility with the/my current gitea (1.2.0+rc2) webhook ?

Maybe, gitea has made a number of breaking changes, including a breaking change to authorization that prevent cloning repositories [1]. Or it could be an issue with the drone gitea driver which is relatively immature. I use drone with gogs and do not have any issues, fwiw.

I would recommend sending a patch to either drone or gitea you are experiencing issues. The gitea integration is community maintained and not something that I personally support.

[1] [Urgent fix for changed auth behavior on Gitea by tboerger · Pull Request #2241 · harness/gitness · GitHub](https://github.com/drone/drone/pull/2241)

---

<div class="post-metadata">

**Author:** ![dashie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dashie/32/3969_2.png) [@dashie](https://drone.discourse.group/u/dashie)\
**Post date:** [October 18, 2017, 6:30pm UTC](https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818/3 "2017-10-18T18:30:47Z")

</div>

But as stated, a push event works perfectly, drone can clone and do it job without issue on a push event.

And as the log extract tells me, it’s not a clone issue but a missing thing in an URL drone is creating and calling.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 18, 2017, 6:47pm UTC](https://drone.discourse.group/t/drone-calling-wrong-url-on-gitea-tag-create-hook/10818/4 "2017-10-18T18:47:01Z")

</div>

> [@How to Override Lambda Function Name in Workflow using variables](https://drone.discourse.group/t/how-to-override-lambda-function-name-in-workflow-using-variables/915/3):
>
> And as the log extract tells me, it’s not a clone issue but a missing thing in an URL drone is creating and calling.

I would recommend submitting a patch in this case.
