/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in
`_query': Mysql2::Error: Incorrect string value:.......)
(ActiveRecord::StatementInvalid) from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in
`block in query' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in
`handle_interrupt' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in
`query' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in
`block in execute' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in
`block in log' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in
`instrument' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in
`log' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in
`execute' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in
`execute' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:248:in
`exec_insert' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:108:in
`insert' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in
`insert' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:64:in
`insert' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:524:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/counter_cache.rb:139:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/locking/optimistic.rb:75:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/dirty.rb:133:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:306:in
`block in _create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in
`call' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in
`block (2 levels) in compile' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in
`call' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in
`__run_callbacks__' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in
`_run_create_callbacks' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:306:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/timestamp.rb:57:in
`_create_record' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:504:in
`create_or_update' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:302:in
`block in create_or_update' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in
`call' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in
`block (2 levels) in compile' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in
`call' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in
`__run_callbacks__' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in
`_run_save_callbacks' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:302:in
`create_or_update' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:120:in
`save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/validations.rb:37:in
`save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/dirty.rb:21:in
`save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:286:in
`block (2 levels) in save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:351:in
`block in with_transaction_returning_status' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in
`transaction' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:220:in
`transaction' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:348:in
`with_transaction_returning_status' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:286:in
`block in save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:301:in
`rollback_active_record_state!' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:285:in
`save' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/protected_attributes-1.1.4/lib/active_record/mass_assignment_security/persistence.rb:46:in
`create' from
/usr/local/redmine/app/models/repository/git.rb:218:in `save_revision' from
/usr/local/redmine/app/models/repository/git.rb:207:in `block (2 levels) in
save_revisions' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in
`block in transaction' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in
`within_new_transaction' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in
`transaction' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:220:in
`transaction' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:277:in
`transaction' from
/usr/local/redmine/app/models/repository/git.rb:204:in `block in
save_revisions' from /usr/local/redmine/app/models/repository/git.rb:203:in
`each' from
/usr/local/redmine/app/models/repository/git.rb:203:in `save_revisions' from
/usr/local/redmine/app/models/repository/git.rb:153:in `fetch_changesets' from /usr/local/redmine/app/models/repository.rb:346:in
`block (2 levels) in fetch_changesets' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in
`each' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in
`each' from
/usr/local/redmine/app/models/repository.rb:344:in `block in
fetch_changesets' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in
`each' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in
`each' from /usr/local/redmine/app/models/repository.rb:343:in
`fetch_changesets' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/runner.rb:62:in
`<top (required)>' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/runner.rb:62:in
`eval' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/runner.rb:62:in
`<top (required)>' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:123:in
`require' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:123:in
`require_command!' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:90:in
`runner' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in
`run_command!' from
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in
`<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>' |
add fuction
def
get_ascii_only(str_a) ret_val = "" str_a.each_byte do |c| $char = c.chr if $char.ascii_only? ret_val += $char end end return ret_val end private :get_ascii_only |
Modify revision function
def
save_revision(rev) parents = (rev.parents ||
[]).collect{|rp| find_changeset_by_name(rp)}.compact begin changeset = Changeset.create( :repository => self, :revision => rev.identifier, :scmid => rev.scmid, :committer => rev.author, :committed_on => rev.time, :comments => rev.message, :parents => parents ) rescue new_mesg = get_ascii_only(rev.message) changeset = Changeset.create( :repository => self, :revision => rev.identifier, :scmid => rev.scmid, :committer => rev.author, :committed_on => rev.time, :comments => new_mesg, :parents => parents ) end unless changeset.new_record? rev.paths.each { |change|
changeset.create_change(change) } end changeset end |
Comments
Post a Comment