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

push webhook doesn't fire when pull request is merged #21129

Closed
berwyn opened this issue Sep 9, 2022 · 13 comments
Closed

push webhook doesn't fire when pull request is merged #21129

berwyn opened this issue Sep 9, 2022 · 13 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@berwyn
Copy link

berwyn commented Sep 9, 2022

Description

I have a sever with Drone and Gitea setup where I want to run steps every time a PR is merged. Drone ignores the PR closed/merged action, so I thought to filter by pushes to main, however Gitea doesn't dispatch a push event when I merge my PRs (configured as rebase then fast-forward).

Since I cannot find any documentation that lays out what events are pushed and when, I have to assume it's a bug that no push webhook is fired when new commits are pushed to a ref using a PR.

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

gitea/gitea:1.17-rootless with docker-compose, docker-ce 20.10.18 running on Ubuntu 22.04

Database

PostgreSQL

@berwyn berwyn added the type/bug label Sep 9, 2022
@jerry3k
Copy link

jerry3k commented Sep 10, 2022

I can confim we have the same issue after we upgraded our Gitea from 1.16 to 1.17. Here are the version with the issue:
Drone Server: drone/drone:2.9.1
Gitea: 1.17.0
Manually 'Test Delivery' from Gitea does fire the webhook but not from 'push'.

Also Tested: I can confirm the issue was not there for 1.16.9.
Can folks please check which of these New Features/Setting change needs to be configured to get this working: https://blog.gitea.io/2022/07/gitea-1.17.0-is-released/#:~:text=Gitea%201.17%20lays%20the%20foundation,avatar%20can%20now%20be%20communicated.

My hunch is its this change: https://blog.gitea.io/2022/07/gitea-1.17.0-is-released/#-change-initial-trust-model-to-committer-18335httpsgithubcomgo-giteagiteapull18335 (Change initial trust model to committer ) Can someone test please.

@exu-g
Copy link

exu-g commented Sep 11, 2022

Push events never fire for me either. I tested creating commits directory to a monitored branch and merging a pull request.
Gitea 1.17.2
Woodpecker 0.15.4

In the Monitoring tab, the GET /user/events seems stuck

image

@exu-g
Copy link

exu-g commented Sep 12, 2022

Creating a tag doesn't fire events (Create in webhook) either, with /user/events being stuck.

@xtulnx
Copy link

xtulnx commented Sep 16, 2022

@jerry3k @RealStickman Did you fix it please?

@jerry3k
Copy link

jerry3k commented Sep 16, 2022

@xtulnx no fix available as of yet.

@lunny
Copy link
Member

lunny commented Sep 19, 2022

webhook is unrelated with /user/events which is just related with notification UI. Could you find the webhook record in history?

@xtulnx

This comment was marked as outdated.

@lunny lunny added this to the 1.17.3 milestone Sep 20, 2022
@jerry3k
Copy link

jerry3k commented Sep 21, 2022

@jerry3k @RealStickman hi, I temporarily solved the problem of service exception by downgrading.

  1. Stop the service. Back up your data if necessary
  2. Git Image tag use 1.16.9: "gitea/gitea:1.16.9"
  3. ...
  4. Modify version=211 ...
    Downgraded 1.17.2 and 1.18.0-dev successfully.

Now my webhook and the latest activity in the homepage are back to normal

Please do NOT do this, as you will be UNABLE to upgrade it in future!

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 28, 2022

I just setup a Gitea 1.17.2 (docker/docker-rootless) locally and did a full test, all work as expected.

If there is a problem, there are only a few possibilities:

  1. The docker server (not client!) version is too low: make sure >=20.10.6
  2. The git hooks are out of sync: "Resynchronize pre-receive, update and post-receive hooks of all repositories" on the site admin panel
  3. The git repositories (and hooks) are stored on some filesystems(Windows/NAS) which don't support script execution, which is pretty a rare case.

(off topic: /user/events is designed to block for long time for long-polling, it's not related. And DO NOT downgrade by changing the version value in database manually if you are not an experienced Gitea developer)

If you think you encounter a bug, it needs more information to debug. It would be very helpful to provide a reproducible setup (docker-compose config and steps)


The details about push event and webhook:

client git push -> ssh server -> gitea serv sub-command -> git operation -> git hook runs scripts in the repository on the server -> gitea hook sub-command calls the internal HTTP api -> gitea web gets the push event -> insert into database (show activity on the dashboard) -> trigger webhook.

gitea online editor -> git operation -> git hook -> (the same as above).


Test Result

Docker (root)

image

Docker (rootless, merge PR with rebase)

image

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Sep 28, 2022
@wxiaoguang wxiaoguang removed this from the 1.17.3 milestone Sep 28, 2022
@exu-g
Copy link

exu-g commented Sep 28, 2022

@wxiaoguang Thanks for the detailed reply.
I can confirm storing stuff on a samba share was the issue for me. Local storage works.
Guess I'll have to use that going forward for gitea.

6543 pushed a commit that referenced this issue Sep 29, 2022
Follows
#21129 (comment)
* #21129 (comment)

A lot of users are asking similar questions.

The old content in FAQ doesn't seem to be related to the problem.
@kSandr-ki
Copy link

kSandr-ki commented Apr 17, 2023

I still don't understand
how docker version affects this, is it possible to somehow fix this without touching docker? I really dont wanna touch docker on production server ....

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 17, 2023

Because it's a Docker's bug:

@kSandr-ki
Copy link

thanks

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

8 participants