Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-4012

Add support for MariaDB to Stash

    XMLWordPrintable

    Details

    • Regular Expression:
      Index column size too large

      Description

      Add support for MariaDB to Stash

      Currently Stash supports MySQL as described in the Supported platforms. However, Stash is not tested against variants of MySQL like Percona and MariaDB. For support, you should switch to a normal MySQL installation as per the document's description.

      This issue intends to engage us on a research about the viability of adding full support to MariaDB.

      Currently we mapped two scenarios:

      Scenario 1

      When trying to upload to a Git repository, the following error is displayed:

      [xxx@attlasin_server git_project]# git push origin master
      Password:
      Counting objects: 21183, done.
      Delta compression using up to 3 threads.
      Compressing objects: 100% (8287/8287), done.
      Writing objects: 100% (21183/21183), 20.18 MiB | 8.28 MiB/s, done.
      Total 21183 (delta 12854), reused 20762 (delta 12433)
      remote: Hook com.atlassian.stash.hooks.permissions.internal.BranchPermissionHook failed. Error:
      remote: There was a SQL exception thrown by the Active Objects library:
      remote: Database:
      remote:         - name:MySQL
      remote:         - version:5.5.5-10.0.4-MariaDB
      remote:         - minor version:5
      remote:         - major version:5
      remote: Driver:
      remote:         - name:MySQL Connector Java
      remote:         - version:mysql-connector-java-5.1.25 ( Revision: ${bzr.revision-id} )
      remote:
      remote: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
      

      Workaround for Scenario 1

      • Find query in the log:
      2013-10-25 16:55:01,169 ERROR [threadpool:thread-7] marek.knappe 1014x21271x1 1vmdfi9 122.99.118.175 "POST /scm/cg/compass-gateway.git/git-receive-pack HTTP/1.1" net.java.ao.sql Exception executing SQL update <CREATE INDEX index_ao_6978bb_res847341420 ON AO_6978BB_RESTRICTED_REF(REF_VALUE)>
      
      • Execute the query manually:
      MariaDB [ecc_stash]> CREATE INDEX index_ao_6978bb_res847341420 ON AO_6978BB_RESTRICTED_REF(REF_VALUE);
      Query OK, 0 rows affected, 1 warning (0.06 sec)
      Records: 0  Duplicates: 0  Warnings: 1
      
      • Probable root cause:

      It's likely that 1 warning part is the culprit. The JDBC driver probably doesn't differentiate between warnings and errors, so either is probably treated as the SQL statement failing.

      Scenario 2

      "An error occurred" pops up on all repo pages. The details state "An error occurred while processing the request. Check the server logs for more information."

      2013-10-24 04:36:27,940 ERROR [http-bio-7994-exec-2] kdonarski 276x4235x1 1kh3kc1 79.173.31.46 "GET /rest/sync/latest/projects/OSA/repos/osa HTTP/1.1" net.java.ao.sql Exception executing SQL update <CREATE INDEX index_ao_02a6c0_rej1887153917 ON AO_02A6C0_REJECTED_REF(REF_ID)>
      java.sql.SQLException: Index column size too large. The maximum column size is 767 bytes.
      ...
      
      2013-10-24 04:36:27,967 ERROR [http-bio-7994-exec-2] kdonarski 276x4235x1 1kh3kc1 79.173.31.46 "GET /rest/sync/latest/projects/OSA/repos/osa HTTP/1.1" c.a.s.r.e.UnhandledExceptionMapper Unhandled exception while processing REST call
      com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
      Database:
      	- name:MySQL
      	- version:5.5.30-MariaDB
      	- minor version:5
      	- major version:5
      Driver:
      	- name:MySQL-AB JDBC Driver
      	- version:mysql-connector-java-5.1.23 ( Revision: ${bzr.revision-id} )
      
      java.sql.SQLException: Index column size too large. The maximum column size is 767 bytes.
      ...
      Caused by: java.sql.SQLException: Index column size too large. The maximum column size is 767 bytes.
      

      Workaround for Scenario 2

      At the moment the immediate workaround is to disable the Ref Syncing plugin that is affected by this error. To do that, go to Administration -> Manage Add-ons and select 'Show all' in the drop-down for filtering plugins. Find a plugin named Atlassian Stash Repository Ref Synchronizer and disable that plugin. This should cause the error to disappear from your repository pages.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                18 Vote for this issue
                Watchers:
                26 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: