Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drone calling wrong URL on gitea tag create hook #2245

Closed
rhaamo opened this issue Oct 18, 2017 · 1 comment
Closed

Drone calling wrong URL on gitea tag create hook #2245

rhaamo opened this issue Oct 18, 2017 · 1 comment

Comments

@rhaamo
Copy link

rhaamo commented Oct 18, 2017

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

According to some issues I found (https://discourse.drone.io/t/drone-0-5-817-gitea-a-gogs-fork-tag-webhook-404/105/5, #1870 then go-gitea/gitea#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, it 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"

Looks like the tag is missing "/raw//.drone.yml"

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

For reference, the payload my gitea is pushing:

{
  "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"
  }
}
@bradrydzewski
Copy link

bradrydzewski commented Oct 18, 2017

The primary root cause for drone not using the correct hook URL is that drone cannot determine its own URL. This happens when drone is installed behind a reverse proxy or load balancer and the X-Fowarded-For and X-Forwarded-Proto variables are not properly configured.

If you have any further questions, please create a thread at https://discourse.drone.io/

@harness harness locked and limited conversation to collaborators Oct 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants