Integration between drone and Gitea (bleeding edge) erroring out on webhook #1201

Closed
opened 2025-11-02 03:52:14 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @techknowlogick on GitHub (Nov 1, 2017).

  • Gitea version (or commit ref): e6a97b6
  • Git version: 2.13.5
  • Operating system: centos (Docker)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

When I push a commit to a repo that has a webhook that is connected to drone the webhook fails. Checking the logs from gitea I see that drone fetches a URL from the API, but is returned a 404 (not found) error.
I've tested calling that route directly via browser and I also get a 404. However when I call /api/v1/repos/sdstack/atomic/ directly via my browser (when I am logged in) I get information about the repo, and when I am logged out (testing via incognito mode) I call the /api/v1/repos/sdstack/atomic/ URL and it gives me an expected 403 (as it is a private repo so I wouldn't want someone not logged in to be able to get that information).

Drone version: 0.8.1+build.1318

172.18.0.100 - - [01/Nov/2017:20:39:28 +0300] "GET /api/v1/repos/sdstack/atomic/raw/6d31739044602484ef3b658270a973c5ebedb461/.drone.yml HTTP/1.1" 404 11349 "-" "Go-http-client/1.1" "-"

Originally created by @techknowlogick on GitHub (Nov 1, 2017). - Gitea version (or commit ref): e6a97b6 - Git version: 2.13.5 - Operating system: centos (Docker) - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description When I push a commit to a repo that has a webhook that is connected to drone the webhook fails. Checking the logs from gitea I see that drone fetches a URL from the API, but is returned a 404 (not found) error. I've tested calling that route directly via browser and I also get a 404. However when I call /api/v1/repos/sdstack/atomic/ directly via my browser (when I am logged in) I get information about the repo, and when I am logged out (testing via incognito mode) I call the /api/v1/repos/sdstack/atomic/ URL and it gives me an expected 403 (as it is a private repo so I wouldn't want someone not logged in to be able to get that information). Drone version: 0.8.1+build.1318 172.18.0.100 - - [01/Nov/2017:20:39:28 +0300] "GET /api/v1/repos/sdstack/atomic/raw/6d31739044602484ef3b658270a973c5ebedb461/.drone.yml HTTP/1.1" 404 11349 "-" "Go-http-client/1.1" "-"
GiteaMirror added the issue/regressiontype/bug labels 2025-11-02 03:52:14 -06:00
Author
Owner

@techknowlogick commented on GitHub (Nov 2, 2017):

Just confirmed this happens on latest commit of gitea 122a66f

[Macaron] 2017-11-02 03:12:13: Started GET /api/v1/repos/whff/whff/raw/ad61956db6300cad2d0f72fbe4c5128f041c05dc/.drone.yml for 172.18.0.100
[Macaron] 2017-11-02 03:12:13: Completed /api/v1/repos/whff/whff/raw/ad61956db6300cad2d0f72fbe4c5128f041c05dc/.drone.yml 404 Not Found in 9.807562ms

@techknowlogick commented on GitHub (Nov 2, 2017): Just confirmed this happens on latest commit of gitea 122a66f [Macaron] 2017-11-02 03:12:13: Started GET /api/v1/repos/whff/whff/raw/ad61956db6300cad2d0f72fbe4c5128f041c05dc/.drone.yml for 172.18.0.100 [Macaron] 2017-11-02 03:12:13: Completed /api/v1/repos/whff/whff/raw/ad61956db6300cad2d0f72fbe4c5128f041c05dc/.drone.yml 404 Not Found in 9.807562ms
Author
Owner

@lflare commented on GitHub (Nov 2, 2017):

I would like to confirm that I have the same odd issue.

EDIT: Not sure if this is relevant? 517c003af2

@lflare commented on GitHub (Nov 2, 2017): I would like to confirm that I have the same odd issue. EDIT: Not sure if this is relevant? https://github.com/drone/drone/commit/517c003af2d9043f4cdd0fb280cb4776250d3f0f
Author
Owner

@lafriks commented on GitHub (Nov 2, 2017):

@LFlare it should not be related

@lafriks commented on GitHub (Nov 2, 2017): @LFlare it should not be related
Author
Owner

@lflare commented on GitHub (Nov 2, 2017):

@lafriks, I've tried using my front-end web proxy to dynamically rewrite the URLs on-the-go and from what I found out, accessing the API endpoint over web browser and having it rewrote works but having drone access the API endpoint to query for .drone.yml and having it rewrote does not work. Since Gitea responds to unauthenticated access to private repositories with a 404, I feel like it might have some relevance.

To that extent, I'm still scrolling through the code trying to figure out what changed recently that screwed up the integration.

EDIT: I believe I've found the issue @ 513375c429. Working out a hotfix now.

@lflare commented on GitHub (Nov 2, 2017): @lafriks, I've tried using my front-end web proxy to dynamically rewrite the URLs on-the-go and from what I found out, accessing the API endpoint over web browser and having it rewrote works **but** having drone access the API endpoint to query for `.drone.yml` and having it rewrote does **not** work. Since Gitea responds to unauthenticated access to private repositories with a _404_, I feel like it might have some relevance. To that extent, I'm still scrolling through the code trying to figure out what changed recently that screwed up the integration. EDIT: I believe I've found the issue @ 513375c429435ba60a667b219bdfb00e5b760b38. Working out a hotfix now.
Author
Owner

@lflare commented on GitHub (Nov 3, 2017):

@lafriks, @techknowlogick, this has been fixed in #2836.

@lflare commented on GitHub (Nov 3, 2017): @lafriks, @techknowlogick, this has been fixed in #2836.
Author
Owner

@strk commented on GitHub (Nov 4, 2017):

is Gitea-1.2.3 immune from this ?

@strk commented on GitHub (Nov 4, 2017): is Gitea-1.2.3 immune from this ?
Author
Owner

@lafriks commented on GitHub (Nov 4, 2017):

@strk yes it was broken on master

@lafriks commented on GitHub (Nov 4, 2017): @strk yes it was broken on master
Author
Owner

@quantonganh commented on GitHub (Mar 12, 2018):

I upgraded Gitea to version 1.4.0+rc2-3-g5d0c987 but still see this in the logs:

[Macaron] 2018-03-12 09:05:48: Started GET /api/v1/repos/org/repo/raw/refs/pull/70/head/.drone.yml for 172.18.0.1
[Macaron] 2018-03-12 09:05:48: Completed GET /api/v1/repos/org/repo/raw/refs/pull/70/head/.drone.yml 404 Not Found in 63.545961ms
@quantonganh commented on GitHub (Mar 12, 2018): I upgraded Gitea to version 1.4.0+rc2-3-g5d0c987 but still see this in the logs: ``` [Macaron] 2018-03-12 09:05:48: Started GET /api/v1/repos/org/repo/raw/refs/pull/70/head/.drone.yml for 172.18.0.1 [Macaron] 2018-03-12 09:05:48: Completed GET /api/v1/repos/org/repo/raw/refs/pull/70/head/.drone.yml 404 Not Found in 63.545961ms ```
Author
Owner

@selewu commented on GitHub (Sep 5, 2019):

I upgraded Gitea to version 1.9 but still see this in the logs:
[Macaron] 2019-09-05 08:12:33: Started GET /api/v1/repos/chaplin/xshop_new/raw/eaeb7e075e42001b97b89b348cd2df31156bf1aa/.drone.yml for 192.168.0.31
[Macaron] 2019-09-05 08:12:33: Completed GET /api/v1/repos/chaplin/xshop_new/raw/eaeb7e075e42001b97b89b348cd2df31156bf1aa/.drone.yml 404 Not Found in 78.427818ms

@selewu commented on GitHub (Sep 5, 2019): I upgraded Gitea to version 1.9 but still see this in the logs: `[Macaron] 2019-09-05 08:12:33: Started GET /api/v1/repos/chaplin/xshop_new/raw/eaeb7e075e42001b97b89b348cd2df31156bf1aa/.drone.yml for 192.168.0.31` `[Macaron] 2019-09-05 08:12:33: Completed GET /api/v1/repos/chaplin/xshop_new/raw/eaeb7e075e42001b97b89b348cd2df31156bf1aa/.drone.yml 404 Not Found in 78.427818ms`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1201