Skip to content

Webhooks api stopped working #13907

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

Closed
1 of 6 tasks
bobemoe opened this issue Dec 8, 2020 · 8 comments · Fixed by #13960
Closed
1 of 6 tasks

Webhooks api stopped working #13907

bobemoe opened this issue Dec 8, 2020 · 8 comments · Fixed by #13960
Assignees
Labels
skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/webhooks type/bug

Comments

@bobemoe
Copy link
Contributor

bobemoe commented Dec 8, 2020

  • 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? #13664

@lunny lunny added the type/bug label Dec 9, 2020
@lunny lunny self-assigned this Dec 9, 2020
@lunny lunny added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Dec 9, 2020
@bobemoe
Copy link
Contributor Author

bobemoe commented 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

func CheckCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption) bool {
if !webhook.IsValidHookTaskType(form.Type) {
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid hook type")
return false
}

@bobemoe
Copy link
Contributor Author

bobemoe commented 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
Copy link
Contributor Author

bobemoe commented Dec 10, 2020

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

@bobemoe
Copy link
Contributor Author

bobemoe commented Dec 10, 2020

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

@lunny
Copy link
Member

lunny commented Dec 11, 2020

@bobemoe Please confirm #13937 fixed this.

@bobemoe
Copy link
Contributor Author

bobemoe commented 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?

@pat-s
Copy link
Member

pat-s commented Dec 11, 2020

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

@bobemoe
Copy link
Contributor Author

bobemoe commented 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 bobemoe changed the title Webhooks stopped working Webhooks api stopped working Dec 11, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/webhooks type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants