[ 
https://issues.apache.org/jira/browse/EAGLE-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15813660#comment-15813660
 ] 

ASF GitHub Bot commented on EAGLE-851:
--------------------------------------

Github user haoch commented on the issue:

    https://github.com/apache/eagle/pull/765
  
    I think the feature should be added into backend 
`org.apache.eagle.service.metadata.resource.MetadataResource#validatePolicy()`


> Add validation for policy name
> ------------------------------
>
>                 Key: EAGLE-851
>                 URL: https://issues.apache.org/jira/browse/EAGLE-851
>             Project: Eagle
>          Issue Type: Bug
>          Components: Web UI
>            Reporter: JiJun Tang
>            Assignee: JiJun Tang
>            Priority: Minor
>             Fix For: v0.5.0
>
>
> Long policyId will cause exception like below:
> {noformat}
> ERROR [2017-01-09 01:07:35,547] 
> org.apache.eagle.alert.metadata.impl.JdbcMetadataHandler: Error to add 
> publishments to policy xxx_topologyHealthCheckApp_nodeManagerStatusNotRunning
> ! com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for 
> column 'policyId' at row 1
> ! at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3885) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at 
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at 
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2141) 
> ~[mysql-connector-java-5.1.34.jar:5.1.34]
> ! at 
> com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1773)
>  ~[mysql-connector-java-5.1.34.jar:5.1.34]
> {noformat}
> We should check the length of policyId before insert into the table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to