HTTP data collection causes IllegalStateException, "Host must be set to create a host URL"
Description
I am trying to do some HTTP data collection, but this keeps showing up in the collectd.log, IP address changed to protect the innocent:
2010-09-20 17:26:42,131 ERROR [CollectdScheduler-50 Pool-fiber0] CollectableService: An undeclared throwable was caught during data collection for interface 128.128.128.128/SomeThing org.opennms.netmgt.collectd.CollectionException: An undeclared throwable was caught during data collection for interface 128.128.128.128/SomeThing at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:408) at org.opennms.netmgt.collectd.CollectableService.run(CollectableService.java:314) at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:295) at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:427) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.IllegalStateException: Host must be set to create a host URL at org.apache.commons.httpclient.HostConfiguration.getHostURL(HostConfiguration.java:316) at org.opennms.netmgt.collectd.HttpCollector.persistResponse(HttpCollector.java:466) at org.opennms.netmgt.collectd.HttpCollector.doCollection(HttpCollector.java:253) at org.opennms.netmgt.collectd.HttpCollector.access$000(HttpCollector.java:98) at org.opennms.netmgt.collectd.HttpCollector$HttpCollectionSet.collect(HttpCollector.java:173) at org.opennms.netmgt.collectd.HttpCollector.collect(HttpCollector.java:132) at org.opennms.netmgt.collectd.CollectionSpecification.collect(CollectionSpecification.java:277) at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:380) ... 4 more
Yeah - I found this via the Google and I wanted to note that this ERROR is actually not fatal. In my case I saw the error while trying to determine the cause of an HTTP collection failure, but it was due to a bad regex.
Seth Leger February 4, 2011 at 12:44 PM
Closing bug that was due to incomplete configuration.
Stephen Goss February 3, 2011 at 6:18 PM
I posted this about 5 months ago. If I remember correctly, I think I was missing an attribute in the XML configuration for this service, What could be useful is something in the interface that sanity checks the configuration files for all the required attributes for each element type. I had to dig through all the logs just to find this error which didn't tell me that I was missing an attribute in a configuration XML file.
Seth Leger February 3, 2011 at 5:30 PM
Hi Steve,
Can you recheck this behavior with the 1.9 code (from the master branch)? The HTTP collector was refactored to use a new version of the HTTP library and it's possible that the problem has been resolved by migrating to this newer version of the library. Thanks!
I am trying to do some HTTP data collection, but this keeps showing up in the collectd.log, IP address changed to protect the innocent:
2010-09-20 17:26:42,131 ERROR [CollectdScheduler-50 Pool-fiber0] CollectableService: An undeclared throwable was caught during data collection for interface 128.128.128.128/SomeThing
org.opennms.netmgt.collectd.CollectionException: An undeclared throwable was caught during data collection for interface 128.128.128.128/SomeThing
at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:408)
at org.opennms.netmgt.collectd.CollectableService.run(CollectableService.java:314)
at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:295)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:427)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: Host must be set to create a host URL
at org.apache.commons.httpclient.HostConfiguration.getHostURL(HostConfiguration.java:316)
at org.opennms.netmgt.collectd.HttpCollector.persistResponse(HttpCollector.java:466)
at org.opennms.netmgt.collectd.HttpCollector.doCollection(HttpCollector.java:253)
at org.opennms.netmgt.collectd.HttpCollector.access$000(HttpCollector.java:98)
at org.opennms.netmgt.collectd.HttpCollector$HttpCollectionSet.collect(HttpCollector.java:173)
at org.opennms.netmgt.collectd.HttpCollector.collect(HttpCollector.java:132)
at org.opennms.netmgt.collectd.CollectionSpecification.collect(CollectionSpecification.java:277)
at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:380)
... 4 more