Cannot run Gitea Webhook #3734

Closed
opened 2025-11-02 05:23:38 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @axeloz on GitHub (Aug 5, 2019).

  • Gitea version (or commit ref): 1.8.2
  • Git version: 2.7.4
  • Operating system: Ubuntu Serveur 16
  • 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

Hello,
This is the first time I come across this issue despite I'm using Webhooks very often.
I have created a new Gitea's webhook.
My target URL is correct. It returns {"success":true,"deployment_id":1487}
My post content is JSON. Only for pushes.
When I try to run the webhook, I get the following error:
PrepareWebhook: CreateHookTask: Error 1366: Incorrect string value: '\xF0\x9F\x9A\x80\n...' for column `gitea`.`hook_task`.`payload_content` at row 1

Screenshots

Capture d’écran 2019-08-05 à 17 08 29

Originally created by @axeloz on GitHub (Aug 5, 2019). - Gitea version (or commit ref): 1.8.2 - Git version: 2.7.4 - Operating system: Ubuntu Serveur 16 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description Hello, This is the first time I come across this issue despite I'm using Webhooks very often. I have created a new Gitea's webhook. My target URL is correct. It returns `{"success":true,"deployment_id":1487}` My post content is JSON. Only for pushes. When I try to run the webhook, I get the following error: ```PrepareWebhook: CreateHookTask: Error 1366: Incorrect string value: '\xF0\x9F\x9A\x80\n...' for column `gitea`.`hook_task`.`payload_content` at row 1``` ## Screenshots ![Capture d’écran 2019-08-05 à 17 08 29](https://user-images.githubusercontent.com/1597611/62474664-b3774080-b7a3-11e9-846d-e89a75107c65.jpg)
GiteaMirror added the type/question label 2025-11-02 05:23:38 -06:00
Author
Owner

@lunny commented on GitHub (Aug 5, 2019):

Maybe you should use utf8mb4 character.

@lunny commented on GitHub (Aug 5, 2019): Maybe you should use utf8mb4 character.
Author
Owner

@axeloz commented on GitHub (Aug 5, 2019):

thanks @lunny are you talking about the table itself?
I tried this, same result. Thanks

@axeloz commented on GitHub (Aug 5, 2019): thanks @lunny are you talking about the table itself? I tried this, same result. Thanks
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

I'm unable to fix this. I tried deleting the webhook and recreate it. No luck.
I can't find any corresponding row into the hook_task table. I don't get it. Any idea? Thanks

@axeloz commented on GitHub (Aug 6, 2019): I'm unable to fix this. I tried deleting the webhook and recreate it. No luck. I can't find any corresponding row into the `hook_task` table. I don't get it. Any idea? Thanks
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

Could it be because the latest commit message is First commit ever 🚀 with on emoticon?

@axeloz commented on GitHub (Aug 6, 2019): Could it be because the latest commit message is `First commit ever 🚀` with on emoticon?
Author
Owner

@lunny commented on GitHub (Aug 6, 2019):

@axeloz yes. That's why I ask your before that if your mysql is utf8mb4 character . emoji will not work on utf8 character of mysql.

@lunny commented on GitHub (Aug 6, 2019): @axeloz yes. That's why I ask your before that if your mysql is utf8mb4 character . emoji will not work on utf8 character of mysql.
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

Yes I confirm, I pushed a new commit without emoticon and the webhook worked. Do you mean I should change all tables to mb4? Shouldn't it be done via a Gitea migration for all users?

@axeloz commented on GitHub (Aug 6, 2019): Yes I confirm, I pushed a new commit without emoticon and the webhook worked. Do you mean I should change all tables to mb4? Shouldn't it be done via a Gitea migration for all users?
Author
Owner

@lunny commented on GitHub (Aug 6, 2019):

@axeloz utf8mb4 is not a must option for gitea. And default is utf8 currently.

@lunny commented on GitHub (Aug 6, 2019): @axeloz utf8mb4 is not a must option for gitea. And default is utf8 currently.
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

@lunny I get that but as there is this kind of bugs, it might be a good idea to fix this for everyone wouldn't it?
Also, I did set the hook_table as mb4 and it didn't fix. So this is probably related to another table (or many other tables).

@axeloz commented on GitHub (Aug 6, 2019): @lunny I get that but as there is this kind of bugs, it might be a good idea to fix this for everyone wouldn't it? Also, I did set the `hook_table` as mb4 and it didn't fix. So this is probably related to another table (or many other tables).
Author
Owner

@mrsdizzie commented on GitHub (Aug 6, 2019):

We should change the default to utf8mb4 on MySQL since this will keep being a regular problem the longer we use utf8 on MySQL.

For existing cases, you can convert the current db like:

gitea convert -C /path/to/config/app.ini
@mrsdizzie commented on GitHub (Aug 6, 2019): We should change the default to utf8mb4 on MySQL since this will keep being a regular problem the longer we use utf8 on MySQL. For existing cases, you can convert the current db like: ``` gitea convert -C /path/to/config/app.ini ```
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

@mrsdizzie

COMMANDS:
     web       Start Gitea web server
     serv      This command should only be called by SSH shell
     hook      Delegate commands to corresponding Git hooks
     dump      Dump Gitea files and database
     cert      Generate self-signed certificate
     admin     Command line interface to perform common administrative operations
     generate  Command line interface for running generators
     migrate   Migrate the database
     keys      This command queries the Gitea database to get the authorized command for a given ssh key fingerprint
     help, h   Shows a list of commands or help for one command
@axeloz commented on GitHub (Aug 6, 2019): @mrsdizzie ``` COMMANDS: web Start Gitea web server serv This command should only be called by SSH shell hook Delegate commands to corresponding Git hooks dump Dump Gitea files and database cert Generate self-signed certificate admin Command line interface to perform common administrative operations generate Command line interface for running generators migrate Migrate the database keys This command queries the Gitea database to get the authorized command for a given ssh key fingerprint help, h Shows a list of commands or help for one command ```
Author
Owner

@mrsdizzie commented on GitHub (Aug 6, 2019):

Oh sorry I hadn't seen your older version, that command is only available in 1.9.0 and above (which is released now).

If you can't upgrade gitea for that command you'll need to update your database manually then.

@mrsdizzie commented on GitHub (Aug 6, 2019): Oh sorry I hadn't seen your older version, that command is only available in 1.9.0 and above (which is released now). If you can't upgrade gitea for that command you'll need to update your database manually then.
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

No worries, I will upgrade

@axeloz commented on GitHub (Aug 6, 2019): No worries, I will upgrade
Author
Owner

@axeloz commented on GitHub (Aug 6, 2019):

Thanks by the way

@axeloz commented on GitHub (Aug 6, 2019): Thanks by the way
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3734