Webhooks api stopped working #6486

Closed
opened 2025-11-02 06:57:25 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @bobemoe on GitHub (Dec 8, 2020).

Originally assigned to: @lunny on GitHub.

  • Gitea version (or commit ref): 1.14.0+dev-337-g42354dfe4
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

After upgrading from a db version 160 to 162 I get the following error when trying to add a new webhook:

Error 1366: Incorrect integer value: 'gitea' for column git.webhook.hook_task_type

Also Drone integration hooks are failing. Probably others too.

Maybe the migration is incomplete? https://github.com/go-gitea/gitea/pull/13664

Originally created by @bobemoe on GitHub (Dec 8, 2020). Originally assigned to: @lunny on GitHub. <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.0+dev-337-g42354dfe4 - Git version: - Operating system: <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description After upgrading from a db version 160 to 162 I get the following error when trying to add a new webhook: `Error 1366: Incorrect integer value: 'gitea' for column git.webhook.hook_task_type` Also Drone integration hooks are failing. Probably others too. Maybe the migration is incomplete? https://github.com/go-gitea/gitea/pull/13664
GiteaMirror added the topic/webhooksskip-changelogtype/bug labels 2025-11-02 06:57:25 -06:00
Author
Owner

@bobemoe commented on GitHub (Dec 10, 2020):

Thanks @lunny, the error has changed now, looks like the DB is good and I can create webhook from the web interface. :)

I'm still having trouble getting Drone to create its webhook over the API. Its showing There was a problem enabling your repository. Unprocessable Entity. Not many clues in the logs but if I try to create webhook using swagger the response is: {"message": "Invalid hook type"} which looks like it is being thrown from bc1cf6e5d3/routers/api/v1/utils/hook.go (L54-L58)

@bobemoe commented on GitHub (Dec 10, 2020): Thanks @lunny, the error has changed now, looks like the DB is good and I can create webhook from the web interface. :) I'm still having trouble getting Drone to create its webhook over the API. Its showing `There was a problem enabling your repository. Unprocessable Entity.` Not many clues in the logs but if I try to create webhook using swagger the response is: `{"message": "Invalid hook type"}` which looks like it is being thrown from https://github.com/go-gitea/gitea/blob/bc1cf6e5d365265d18144a2afae25ca04df691b8/routers/api/v1/utils/hook.go#L54-L58
Author
Owner

@bobemoe commented on GitHub (Dec 10, 2020):

What are the valid hook types? I tried gitea, Gitea and 3 from the API, all with same response. Has it changed? Wondering if this is a BC break and Drone itself will need updating?

@bobemoe commented on GitHub (Dec 10, 2020): What are the valid hook types? I tried `gitea`, `Gitea` and `3` from the API, all with same response. Has it changed? Wondering if this is a BC break and Drone itself will need updating?
Author
Owner

@bobemoe commented on GitHub (Dec 10, 2020):

I might have fixed this... just testing, will PR soon

@bobemoe commented on GitHub (Dec 10, 2020): I might have fixed this... just testing, will PR soon
Author
Owner

@bobemoe commented on GitHub (Dec 10, 2020):

Nope. Ignore previous message, I can't get it to work. No PR coming :(

@bobemoe commented on GitHub (Dec 10, 2020): Nope. Ignore previous message, I can't get it to work. No PR coming :(
Author
Owner

@lunny commented on GitHub (Dec 11, 2020):

@bobemoe Please confirm #13937 fixed this.

@lunny commented on GitHub (Dec 11, 2020): @bobemoe Please confirm #13937 fixed this.
Author
Owner

@bobemoe commented on GitHub (Dec 11, 2020):

I think the error is still there but I'm having trouble getting a complied version to work in my drone environment. I don't supposed there is a linux-amd64 compiled version available for download?

@bobemoe commented on GitHub (Dec 11, 2020): I think the error is still there but I'm having trouble getting a complied version to work in my drone environment. I don't supposed there is a linux-amd64 compiled version available for download?
Author
Owner

@pat-s commented on GitHub (Dec 11, 2020):

I also see issues enabling drone repos on latest gitea master - could be related to this issue here.

@pat-s commented on GitHub (Dec 11, 2020): I also see issues enabling drone repos on latest gitea master - could be related to this issue here.
Author
Owner

@bobemoe commented on GitHub (Dec 11, 2020):

I can confirm the bug is still present on #13937 and master.

Using older version (1.13) I am able to create webhook over api using swagger ​/repos​/{owner}​/{repo}​/hooks
and body:

{
  "active": true,
  "branch_filter": "master",
  "config": {
      "url":"http://test.local",
     "content_type":"json"
  },
  "events": [
    "push"
  ],
  "type": "gitea"
}

But on #13937 and master I get the {"message": "Invalid hook type"} response

@bobemoe commented on GitHub (Dec 11, 2020): I can confirm the bug is still present on #13937 and master. Using older version (1.13) I am able to create webhook over api using swagger ​`/repos​/{owner}​/{repo}​/hooks` and body: ``` { "active": true, "branch_filter": "master", "config": { "url":"http://test.local", "content_type":"json" }, "events": [ "push" ], "type": "gitea" } ``` But on #13937 and master I get the `{"message": "Invalid hook type"}` response
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6486