Defect #28760
closedMysql2::Error: Data too long for column 'ip' at row 1: INSERT INTO `viewings`
0%
Description
Mysql2::Error: Data too long for column 'ip' at row 1: INSERT INTO `viewings` (`viewer_id`, `ip`, `viewed_id`, `viewed_type`, `created_at`) VALUES (17, '94.180.176.236, 172.68.246.219', 7, 'Message', '2018-05-12 02:45:08')
log
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `block in query'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `handle_interrupt'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `query'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:225:in `execute'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:242:in `exec_insert'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:108:in `insert'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/relation.rb:64:in `insert'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/persistence.rb:524:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/counter_cache.rb:139:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/locking/optimistic.rb:75:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/attribute_methods/dirty.rb:133:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:306:in `block in _create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_create_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:306:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/timestamp.rb:57:in `_create_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/persistence.rb:504:in `create_or_update'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:117:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `create_or_update'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/persistence.rb:120:in `save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/validations.rb:37:in `save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block in save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:285:in `save'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/has_many_association.rb:41:in `insert_record'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:570:in `block (2 levels) in concat_records'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:415:in `replace_on_target'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:410:in `add_to_target'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:569:in `block in concat_records'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:567:in `each'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:567:in `concat_records'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/has_many_association.rb:180:in `concat_records'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:175:in `block in concat'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:190:in `block in transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:189:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_association.rb:175:in `concat'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/associations/collection_proxy.rb:970:in `<<'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/redmine_crm-0.0.37/lib/redmine_crm/acts_as_viewed/rcrm_acts_as_viewed.rb:168:in `block in view'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/redmine_crm-0.0.37/lib/redmine_crm/acts_as_viewed/rcrm_acts_as_viewed.rb:163:in `view'
/opt/redmine/redmine/plugins/redmine_questions/lib/redmine_questions/patches/messages_controller_patch.rb:9:in `view_message'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:432:in `block in make_lambda'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:228:in `block in halting_and_conditional'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `block in call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `each'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
/opt/redmine/redmine/lib/redmine/sudo_mode.rb:63:in `sudo_mode'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:432:in `block in make_lambda'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:312:in `block in halting'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:497:in `block in around'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:137:in `process'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/rendering.rb:30:in `process'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal.rb:196:in `dispatch'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_controller/metal.rb:237:in `block in action'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:43:in `serve'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `each'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `serve'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:817:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/etag.rb:24:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/conditionalget.rb:25:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/head.rb:13:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-xml_parser-1.0.2/lib/action_dispatch/xml_params_parser.rb:16:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/flash.rb:260:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/session/abstract/id.rb:225:in `context'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/session/abstract/id.rb:220:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/query_cache.rb:36:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/rack/logger.rb:38:in `call_app'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `block in call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:26:in `tagged'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `tagged'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/methodoverride.rb:22:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/runtime.rb:18:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/middleware/static.rb:120:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/content_length.rb:15:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/rack-1.6.9/lib/rack/sendfile.rb:113:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/application.rb:165:in `call'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
/opt/redmine/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
Updated by artem Smirnov over 7 years ago
artem Smirnov wrote:
Mysql2::Error: Data too long for column 'ip' at row 1: INSERT INTO `viewings` (`viewer_id`, `ip`, `viewed_id`, `viewed_type`, `created_at`) VALUES (17, '94.180.176.236, 172.68.246.219', 7, 'Message', '2018-05-12 02:45:08')
[...]
because the server has identified two types of ip addresses, an error occurs that is resolved by changing the data type from 25 to 255
my solution to this problem
mysql -p -u
use redmine;
ALTER TABLE `viewings` CHANGE `ip` `ip` VARCHAR CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
Updated by Go MAEDA over 7 years ago
- Status changed from New to Closed
- Resolution set to Invalid
Plain Redmine does not have a table named "viewings". The following line in the error log indicates that the problem was caused by redmine_questions plugin. Please contact the author of the plugin.
/opt/redmine/redmine/plugins/redmine_questions/lib/redmine_questions/patches/messages_controller_patch.rb:9:in `view_message'