プロジェクト

全般

プロフィール

Vote #74221

完了

Repositories' extra_info column is too short with MySQL

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
119
issue_org_id:
14626
author_id:
59557
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
71
ステータス-->[Closed]

説明

In the database table repositories a field named "extra_info" has type "text", which in mysql is limited to 65535 chars. This breaks fetch_changesets command on repositories with a very large amount of branches (git). Actual reason is that is stores only part of the last commit hash or other line (like "!b" for "!binary"), and this causes errors in in fetch_changeset:

$ /usr/local/rvm/bin/redmine_rails runner "Repository.fetch_changesets" -e production

/usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/commands/runner.rb:53:in `eval': comparison of String with nil failed (ArgumentError)
    from /u01/apps/redmine-2.3.1/app/models/repository/git.rb:145:in `fetch_changesets'
    from /u01/apps/redmine-2.3.1/app/models/repository.rb:333:in `block (2 levels) in fetch_changesets'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.13/lib/active_record/associations/collection_proxy.rb:89:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.13/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
    from /u01/apps/redmine-2.3.1/app/models/repository.rb:331:in `block in fetch_changesets'
    from /u01/apps/redmine-2.3.1/app/models/repository.rb:330:in `each'
    from /u01/apps/redmine-2.3.1/app/models/repository.rb:330:in `fetch_changesets'
    from (eval):1:in `'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/commands/runner.rb:53:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/commands/runner.rb:53:in `'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/commands.rb:64:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/commands.rb:64:in `'
    from script/rails:6:in `require'
    from script/rails:6:in `
'

Changing the field type to LONGTEXT fixes the problem.


journals

--------------------------------------------------------------------------------
Any plans to affect this?

In the meantime, not being a Rails programmer, can I change this in the database and expect the code to Just Work? (Edit: no, it'd at least take a migration and possible code change)

--------------------------------------------------------------------------------
Sergey Vasilyev wrote:
> Changing the field type to LONGTEXT fixes the problem.

How to change on Rails?
http://railsdoc.com/migration

--------------------------------------------------------------------------------
Sergey Vasilyev wrote:
> This breaks fetch_changesets command on repositories with a very large amount of branches (git).

I think you had better remove merged branches.
https://github.com/sparklemotion/nokogiri/issues/1336
--------------------------------------------------------------------------------
encountered the same problem, Redmine version 3.1.1.stable.14752
<pre>
Processing by SysController#fetch_changesets as HTML
Parameters: {"key"=>"*********************"}
Mysql2::Error: Data too long for column 'extra_info' at row 1: UPDATE `repositories` SET `extra_info` = '---\nextra_report_last_commit: \'1\'\nheads:\n- !binar ....
...
n' WHERE `repositories`.`id` = 50
</pre>

anything else to do except ?
<pre>
ALTER TABLE repositories MODIFY extra_info LONGTEXT;
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Shouldn't we fix this issue along with #20127?
This is a patch to fix this: attachment:14626-change_repositories_extra_info_limit.diff
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------


related_issues

relates,Closed,20127,The description column in the issues table is too short (MySQL)

Admin Redmine さんが約4年前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン3.4.0_119 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0