[ZBX-10356] Different size of sendto field for usermedia Created: 2016 Feb 05  Updated: 2017 May 30  Resolved: 2016 Feb 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.11, 2.4.7, 3.0.0rc2
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.2rc1, 3.2.0alpha1

Type: Incident report Priority: Minor
Reporter: Kim Jongkwon Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: frontend, limits, usermedia
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mysql


Attachments: PNG File スクリーンショット 2016-02-05 10.23.17.png     PNG File スクリーンショット 2016-02-05 10.44.35.png    

 Description   

Please see the attached screenshot. This field varchar(100) on mysql. so text gets cut off when saved.
I think this "send to" field maxlength should be changed.



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Feb 05 ]

In MySQL parameter "sql_mode" is not set to STRICT_ALL_TABLES or STRICT_TRANS_TABLES (which is supposedly true for default my.cnf), then mysql silently trims too long value (zabbix v2.4).
http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_strict_all_tables

If the "sql_mode" is set, then we see this error in zabbix frontend:

Error in query [INSERT INTO media (mediaid,userid,mediatypeid,sendto,active,severity,period) VALUES ('10','1','6','01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789','0','63','1-7,00:00-24:00')] [Data too long for column 'sendto' at row 1]
...trim...

Postgres (zabbix v.2.2) produces an error on top of page:

pg_query(): Query failed: ERROR:  value too long for type character varying(100) [profile.php:159 → CAPIObject->updateMedia() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUser->updateMedia() → CUser->addMediaReal() → DBexecute() → pg_query() in /zab/www-dev/2.2pg/include/db.inc.php:509]
Error in query [INSERT INTO media (mediaid,userid,mediatypeid,sendto,active,severity,period) VALUES ('1','1','1','01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789','0','63','1-7,00:00-24:00')] [ERROR:  value too long for type character varying(100)]
Cannot insert user media.
Empty parameters

CONFIRMED

Comment by Ivo Kurzemnieks [ 2016 Feb 18 ]

(1) No translation string changes.

gunarspujats CLOSED

Comment by Ivo Kurzemnieks [ 2016 Feb 18 ]

RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-10356

Comment by Gunars Pujats (Inactive) [ 2016 Feb 24 ]

Successfully tested!

Comment by Ivo Kurzemnieks [ 2016 Feb 24 ]

Fixed in:

  • pre-2.2.12rc1 r58712
  • pre-2.4.8rc1 r58713
  • pre-3.0.2rc1 r58760
  • pre-3.1.0 (trunk) r58761
Generated at Fri Apr 19 13:05:26 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.