scobal / seyren

An alerting dashboard for Graphite
Other
859 stars 220 forks source link

mongo store issue #420

Open tuwid opened 8 years ago

tuwid commented 8 years ago
Oct 31, 2016 11:55:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Oct 31, 2016 11:55:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Oct 31, 2016 11:55:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.37

Oct 31, 2016 11:55:42 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Oct 31, 2016 11:55:43 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oct 31, 2016 11:56:15 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.spring.SpringContextLoaderListener
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'alertsBean' defined in URL [jar:file:/root/.extract/webapps/ROOT/WEB-INF/lib/seyren-api-1.5.0.jar!/com/seyren/api/bean/AlertsBean.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.seyren.core.store.AlertsStore]: : Error creating bean with name 'mongoStore' defined in URL [jar:file:/root/.extract/webapps/ROOT/WEB-INF/lib/seyren-mongo-1.5.0.jar!/com/seyren/mongo/MongoStore.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.seyren.mongo.MongoStore]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoStore' defined in URL [jar:file:/root/.extract/webapps/ROOT/WEB-INF/lib/seyren-mongo-1.5.0.jar!/com/seyren/mongo/MongoStore.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.seyren.mongo.MongoStore]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1131)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1034)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:48)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoStore' defined in URL [jar:file:/root/.extract/webapps/ROOT/WEB-INF/lib/seyren-mongo-1.5.0.jar!/com/seyren/mongo/MongoStore.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.seyren.mongo.MongoStore]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1131)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1034)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 25 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.seyren.mongo.MongoStore]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267)
    ... 38 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.
    at com.seyren.mongo.MongoStore.<init>(MongoStore.java:75)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
    ... 40 more
Caused by: java.lang.RuntimeException: Failed to bootstrap Mongo indexes. Please refer to the logs for more information.
    at com.seyren.mongo.MongoStore.bootstrapMongo(MongoStore.java:89)
    at com.seyren.mongo.MongoStore.<init>(MongoStore.java:73)
    ... 45 more
Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
    at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:369)
    at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101)
    at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75)
    at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71)
    at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68)
    at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:219)
    at com.mongodb.operation.CreateIndexesOperation.execute(CreateIndexesOperation.java:111)
    at com.mongodb.operation.CreateIndexesOperation.execute(CreateIndexesOperation.java:66)
    at com.mongodb.Mongo.execute(Mongo.java:781)
    at com.mongodb.Mongo$2.execute(Mongo.java:764)
    at com.mongodb.DBCollection.createIndex(DBCollection.java:1541)
    at com.seyren.mongo.MongoStore.createIndices(MongoStore.java:96)
    at com.seyren.mongo.MongoStore.bootstrapMongo(MongoStore.java:82)
    ... 46 more

Oct 31, 2016 11:56:15 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Oct 31, 2016 11:56:15 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Oct 31, 2016 11:56:15 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Oct 31, 2016 11:56:15 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [cluster-ClusterId{value='5817da01263df42c7a0df3d4', description='null'}-localhost:27017] but has failed to stop it. This is very likely to create a memory leak.
Oct 31, 2016 11:56:15 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [pool-2-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Oct 31, 2016 11:56:15 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]

Ubuntu 14.04 trusty and seyren 1.5

any ideas ?

VAdamec commented 8 years ago

Test you environment setup (MONGO_URL) and connection to mongodb from seyren container, but for me last version which works correctly was 1.3.0 + mongo:3.0.1 . Newer version failing on many different mongodb errors (indexes, ...)

dcrozz commented 7 years ago

Same problem, and still not solved though I have changed to 1.3.0 + mongo 3.0.1. Is there any thing extra to do before

wget https://github.com/scobal/seyren/releases/download/1.3.0/seyren-1.3.0.jar
export GRAPHITE_URL=http://graphite.foohost.com:80
java -jar seyren-1.5.0.jar
open http://localhost:8080

and

sudo mongod ?

rodrigo-ramos commented 7 years ago

Hi

I had have the same error. This is caused by setting bad the variable MONGO_URL, which must be like follow:

MONGO_URL=mongodb://localhost:27017/seyren

mongodb -> Protocol (do not change). localhost -> IP or hostname in which MongoDB is running. 2701: -> Mongodb listen port seyren -> Database used by Seyren jar (do not change).

sellers commented 6 years ago

I have this error when I tried to switch form 1.3.0 to either 1.5.0 or then 1.4.0. I even delete a mongo delete of all my checks (in a test env.) and it still gives the same error:

"...Caused by: com.mongodb.MongoCommandException: Command failed with error -1: 'index not found with name [checkId_1_target_1]' on server localhost:27017. The full response is { "nIndexesWas" : 3, "ok" : 0.0, "errmsg" : "index not found with name [checkId_1_target_1]" }..."

my seyren+mongo on 16.04.4 with 1.3.0.jar from years ago does run (but every so often I get a 100% CPU by Mongo and I have to stop and start Mongo....