Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Gitea
  3. Database encoding problems

Database encoding problems

Scheduled Pinned Locked Moved Gitea
7 Posts 2 Posters 19.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robin
    wrote on last edited by
    #1

    Long story short, I've got some problems with encoding.

    See the following Github issue: https://github.com/go-gitea/gitea/issues/16016
    Which links to the following solution: Are you using MySQL? If so you probably need to convert the tables to utf8mb4, gitea convert can help with that but take a backup before doing it.

    I don't remember enough about MySQL anymore to know how to look into this myself, but I'm happy to try help test if you want to try hold my hand, @girish 🙂

    girishG 1 Reply Last reply
    0
    • R Robin

      Long story short, I've got some problems with encoding.

      See the following Github issue: https://github.com/go-gitea/gitea/issues/16016
      Which links to the following solution: Are you using MySQL? If so you probably need to convert the tables to utf8mb4, gitea convert can help with that but take a backup before doing it.

      I don't remember enough about MySQL anymore to know how to look into this myself, but I'm happy to try help test if you want to try hold my hand, @girish 🙂

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @robin What's a good way to reproduce/test this? Just paste some emojis?

      Cloudron uses utf8mb4 by default in mysql. So, the issue is probably something else.

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        On a new gitea install:

        mysql> SHOW VARIABLES LIKE "character_set_database";
        +------------------------+---------+
        | Variable_name          | Value   |
        +------------------------+---------+
        | character_set_database | utf8mb4 |
        +------------------------+---------+
        1 row in set (0.02 sec)
        
        mysql> show create table webhook;
        +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
        | Table   | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
        +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
        | webhook | CREATE TABLE `webhook` (
          `id` bigint NOT NULL AUTO_INCREMENT,
          `repo_id` bigint DEFAULT NULL,
          `org_id` bigint DEFAULT NULL,
          `is_system_webhook` tinyint(1) DEFAULT NULL,
          `url` text,
          `signature` text,
          `http_method` varchar(255) DEFAULT NULL,
          `content_type` int DEFAULT NULL,
          `secret` text,
          `events` text,
          `is_ssl` tinyint(1) DEFAULT NULL,
          `is_active` tinyint(1) DEFAULT NULL,
          `type` varchar(16) DEFAULT NULL,
          `meta` text,
          `last_status` int DEFAULT NULL,
          `created_unix` bigint DEFAULT NULL,
          `updated_unix` bigint DEFAULT NULL,
          PRIMARY KEY (`id`),
          KEY `IDX_webhook_org_id` (`org_id`),
          KEY `IDX_webhook_is_active` (`is_active`),
          KEY `IDX_webhook_created_unix` (`created_unix`),
          KEY `IDX_webhook_updated_unix` (`updated_unix`),
          KEY `IDX_webhook_repo_id` (`repo_id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC |
        +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
        1 row in set (0.00 sec)
        
        1 Reply Last reply
        0
        • R Offline
          R Offline
          Robin
          wrote on last edited by
          #4

          My existing install has this:

          ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC |

          So perhaps this might have been a bug that they corrected in a release sometime after I had already installed?

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Robin
            wrote on last edited by
            #5

            Searching around their issues, I find this: https://github.com/go-gitea/gitea/issues/11081

            girishG 1 Reply Last reply
            1
            • R Robin

              Searching around their issues, I find this: https://github.com/go-gitea/gitea/issues/11081

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by girish
              #6

              @robin indeed, looks like old installations had incorrect encoding. Does that gitea convert help? I don't know if ALTER TABLE works. Something like this : ALTER TABLE webhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Robin
                wrote on last edited by
                #7

                @girish Yeah, I ran:

                /home/git/gitea/gitea convert -c /run/gitea/app.ini as user git, and now things seem converted:

                ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC

                On the downside, the convert tool seems to unconditionally convert, and is quite slow, so I guess it can't easily be run as part of the startup process or something 😕

                1 Reply Last reply
                1

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Bookmarks
                • Search