You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Ronald van Zantvoort (JIRA)" <ji...@apache.org> on 2016/09/14 13:00:26 UTC

[jira] [Commented] (CLOUDSTACK-9071) stats.output.uri stops the server from starting if the uri is malformed

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

Ronald van Zantvoort commented on CLOUDSTACK-9071:
--------------------------------------------------

{noformat}
Sep 14, 2016 2:04:56 PM org.apache.catalina.core.StandardContext listenerStart                                                                                                           │······
SEVERE: Exception sending context initialized event to listener instance of class org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener                                │······
java.lang.StringIndexOutOfBoundsException: String index out of range: -1                                                                                                                 │······
        at java.lang.String.substring(String.java:1875)                                                                                                                                  │······
        at com.cloud.server.StatsCollector.init(StatsCollector.java:276)                                                                                                                 │······
        at com.cloud.server.StatsCollector.start(StatsCollector.java:247)            
{noformat}

See https://github.com/apache/cloudstack/blob/master/server/src/com/cloud/server/StatsCollector.java#L276 and on.

The code fails to validate the input sufficiently.
e.g. if no path is given (graphite://stats.example.com:2003) there won't be any uri.getPath().substring(1) 


> stats.output.uri stops the server from starting if the uri is malformed
> -----------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9071
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9071
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.6.0
>            Reporter: Carles Figuerola
>
> After inputting a malformed uri (was missing the graphite://) and restarting the management service, the application stops at:
> 2015-11-17 11:06:42,861 INFO  [c.c.s.StatsCollector] (localhost-startStop-1:null) metrics.dev.company.net is not a valid protocol for external statistics. No statistics will be send.
> No more logs are output and tomcat is up but serving a completely blank page.
> When the uri has this form: (graphite://metrics.dev.company.net:2013), the end result is very similar to the previous one
> (also, the last word should be "sent")



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