Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Users in Admin-Org are not allowed to switch to any other org #1385

Closed
crackytsi opened this issue Jun 7, 2020 · 13 comments
Closed

[Bug] Users in Admin-Org are not allowed to switch to any other org #1385

crackytsi opened this issue Jun 7, 2020 · 13 comments
Assignees
Labels
bug cannot reproduce TheHive4 TheHive4 related issues
Milestone

Comments

@crackytsi
Copy link

Bug

Work Environment

Question Answer
OS version (server) Debian
OS version (client) 10
TheHive version / git hash 4 RC3
Package Type DEB

Problem Description

I created a user with an login in admin-Org (same as admin@thehive.local)
After that, I imported the same user also using the migration tool (user was included).
When I logged in, I was only able to access the Super-User Admin-Page (Admin-Org), but there was no chance to switch to any other org (e.g. the newly created one).
When I delete the user from admin-org, I was able to login to the imported Org.

@crackytsi crackytsi added TheHive4 TheHive4 related issues bug labels Jun 7, 2020
@To-om To-om added this to the 4.0.0-RC4 milestone Jun 8, 2020
@To-om To-om self-assigned this Jun 28, 2020
@To-om
Copy link
Contributor

To-om commented Jun 28, 2020

I cannot reproduce this problem.

@crackytsi
Copy link
Author

@To-om: I would like to reproduce it with the lastest git snapshot bc0f84e . Unforunately after starting TheHive4 (with a clean cassandra keyspace) it freezese (reproducable) at the last line below and does not react, even after a night. No http port is bound:

2020-07-02 06:21:43,605 [INFO] from com.datastax.driver.core.Cluster in main - New Cassandra host /192.168.2.2:9042 added
2020-07-02 06:21:44,039 [INFO] from org.janusgraph.core.util.ReflectiveConfigOptionLoader in main - Loaded and initialized config classes: 7 OK out of 13 attempts in PT0.035S
2020-07-02 06:21:46,433 [INFO] from org.janusgraph.graphdb.idmanagement.UniqueInstanceIdRetriever in main - Generated unique-instance-id=c0a8c8025049-misp-prod1
2020-07-02 06:21:46,473 [INFO] from com.datastax.driver.core.ClockFactory in main - Using native clock to generate timestamps.
2020-07-02 06:21:46,636 [INFO] from com.datastax.driver.core.policies.DCAwareRoundRobinPolicy in main - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
2020-07-02 06:21:46,636 [INFO] from com.datastax.driver.core.Cluster in main - New Cassandra host /192.168.2.2:9042 added
2020-07-02 06:21:46,682 [INFO] from org.janusgraph.diskstorage.Backend in main - Configuring index [search]
2020-07-02 06:21:46,990 [INFO] from org.janusgraph.diskstorage.Backend in main - Initiated backend operations thread pool of size 16
2020-07-02 06:21:47,449 [INFO] from org.janusgraph.diskstorage.log.kcvs.KCVSLog in main - Loaded unidentified ReadMarker start time 2020-07-02T04:21:47.449Z into org.janusgraph.diskstorage.log.kcvs.KCVSLog$MessagePuller@3e0e0ba7
2020-07-02 06:21:47,497 [INFO] from org.thp.scalligraph.models.Database in main - Instantiate JanusDatabase using cql backend
2020-07-02 06:21:48,146 [INFO] from org.reflections.Reflections in main - Reflections took 611 ms to scan 1 urls, producing 139 keys and 2195 values

I had the same issue already on d54b7ff

@To-om
Copy link
Contributor

To-om commented Jul 3, 2020

If TheHive doesn't listen on HTTP port, without any error in logs, it often means that your configuration file contain invalid content. In this case, error message is not write to log file but in program output. Run TheHive in a terminal: bin/thehive -Dconfig.file=conf/application.conf -Dlogger.file=conf/logback.xml -Dpidfile.path=/dev/null.

If it doesn't help, try to increase the log level: in conf/logback.xml comment all <logger> and add the line <logger name="org.thp" level="DEBUG" />

@crackytsi
Copy link
Author

Error injecting constructor, java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
  at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:71)
  at org.thp.scalligraph.janus.JanusDatabase.class(JanusDatabase.scala:56)
  while locating org.thp.scalligraph.janus.JanusDatabase
  while locating org.thp.scalligraph.models.Database
    for the 2nd parameter of org.thp.scalligraph.services.config.ApplicationConfig.<init>(ApplicationConfig.scala:20)
  at org.thp.scalligraph.services.config.ApplicationConfig.class(ApplicationConfig.scala:19)
  while locating org.thp.scalligraph.services.config.ApplicationConfig
    for the 2nd parameter of org.thp.thehive.services.TOTPAuthSrvProvider.<init>(TOTPAuthSrv.scala:101)
  at org.thp.thehive.services.TOTPAuthSrvProvider.class(TOTPAuthSrv.scala:100)
  while locating org.thp.thehive.services.TOTPAuthSrvProvider
  while locating org.thp.scalligraph.auth.AuthSrv
    for the 1st parameter of org.thp.scalligraph.controllers.Entrypoint.<init>(Entrypoint.scala:27)
  at org.thp.scalligraph.controllers.Entrypoint.class(Entrypoint.scala:26)
  while locating org.thp.scalligraph.controllers.Entrypoint
    for the 1st parameter of org.thp.thehive.controllers.v1.CaseCtrl.<init>(CaseCtrl.scala:21)
  at org.thp.thehive.controllers.v1.CaseCtrl.class(CaseCtrl.scala:20)
  while locating org.thp.thehive.controllers.v1.CaseCtrl
    for the 1st parameter of org.thp.thehive.controllers.v1.Router.<init>(Router.scala:10)
  at org.thp.thehive.controllers.v1.Router.class(Router.scala:9)
  while locating org.thp.thehive.controllers.v1.Router
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:64)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:411)
        at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:50)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:112)
        at org.thp.scalligraph.janus.JanusDatabase$.openDatabase(JanusDatabase.scala:51)
        at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:72)
        at org.thp.scalligraph.janus.JanusDatabase$$FastClassByGuice$$113881e3.newInstance(<generated>)
        at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:60)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
        at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:111)
        at com.google.inject.Guice.createInjector(Guice.java:87)
        at com.google.inject.Guice.createInjector(Guice.java:78)
        at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)
        at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:155)
        at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
        at play.core.server.ProdServerStart$.start(ProdServerStart.scala:54)
        at play.core.server.ProdServerStart$.main(ProdServerStart.scala:30)
        at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        ... 69 more
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1:9042] Cannot connect))
        at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:268)
        at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:107)
        at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1813)
        at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1726)
        at com.datastax.driver.core.Cluster.init(Cluster.java:214)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:387)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:366)
        at com.datastax.driver.core.Cluster.connect(Cluster.java:311)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.initializeSession(CQLStoreManager.java:320)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.<init>(CQLStoreManager.java:182)
        ... 73 more

@To-om
Copy link
Contributor

To-om commented Jul 3, 2020

TheHive cannot connect to your cassandra service: NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042

@crackytsi
Copy link
Author

Yes. But strangely cassandra is listening, and an older Version of th4 is working with the same Cassandra db.

@crackytsi
Copy link
Author

I try to compile a new version this morning with latest commits to retest it.

@crackytsi
Copy link
Author

Unfortunately it still doesn't work.
I'm pretty sure the issue is not Cassandra, because all my other (older) compiled TheHive4 versions are working.

Start of "git log" in directory TheHive is

commit 37f27524e1fa672cea108c419ff08c7726b1da4a (HEAD -> develop-th4, origin/develop-th4)
Author: To-om <toom@thehive-project.org>
Date:   Thu Jul 9 08:32:35 2020 +0200
    #1424 Enforce MISP threat level range

Start of "git log" in directory TheHive/ScalliGraph is

commit a502a74392495f25da7601668417e1a6de0004fb (HEAD)
Author: To-om <toom@thehive-project.org>
Date:   Mon Jul 6 11:48:49 2020 +0200

The first error message appearing is:

1) Error injecting constructor, java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
  at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:71)
  at org.thp.scalligraph.janus.JanusDatabase.class(JanusDatabase.scala:56)
  while locating org.thp.scalligraph.janus.JanusDatabase
  while locating org.thp.scalligraph.models.Database
    for the 1st parameter of org.thp.thehive.models.DatabaseProvider.<init>(SchemaUpdaterActor.scala:19)
  at org.thp.thehive.models.DatabaseProvider.class(SchemaUpdaterActor.scala:18)
  while locating org.thp.thehive.models.DatabaseProvider
  while locating org.thp.scalligraph.models.Database annotated with @com.google.inject.name.Named(value=with-thehive-schema)
    for the 4th parameter of org.thp.thehive.services.AuditSrv.<init>(AuditSrv.scala:28)
  at org.thp.thehive.services.AuditSrv.class(AuditSrv.scala:27)
  while locating org.thp.thehive.services.AuditSrv
    for the 3rd parameter of org.thp.thehive.services.notification.NotificationActor.<init>(NotificationActor.scala:76)
  while locating org.thp.thehive.services.notification.NotificationActor

1 error

Full console-output with debug enabled is this:

[info] ScalligraphApplication - Loading application ...
[info] o.t.s.ScalligraphModule - Loading scalligraph module
[info] a.e.s.Slf4jLogger - Slf4jLogger started
[info] a.r.a.t.ArteryTcpTransport - Remoting started with transport [Artery tcp]; listening on address [akka://application@127.0.0.1:34785] with UID [-8053869758785289115]
[info] a.c.Cluster - Cluster Node [akka://application@127.0.0.1:34785] - Starting up, Akka version [2.6.5] ...
[info] a.c.Cluster - Cluster Node [akka://application@127.0.0.1:34785] - Registered cluster JMX MBean [akka:type=Cluster]
[info] a.c.Cluster - Cluster Node [akka://application@127.0.0.1:34785] - Started up successfully
[info] a.c.Cluster - Cluster Node [akka://application@127.0.0.1:34785] - No downing-provider-class configured, manual cluster downing required, see https://doc.akka.io/docs/akka/current/typed/cluster.html#downing
[info] a.c.Cluster - Cluster Node [akka://application@127.0.0.1:34785] - No seed-nodes configured, manual cluster join required, see https://doc.akka.io/docs/akka/current/typed/cluster.html#joining
[info] c.d.driver.core - DataStax Java driver 3.9.0 for Apache Cassandra
[info] c.d.d.c.GuavaCompatibility - Detected Guava >= 19 in the classpath, using modern compatibility layer
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.NettyUtil - Found Netty's native epoll transport in the classpath, using it
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[error] a.a.OneForOneStrategy - Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
  at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:71)
  at org.thp.scalligraph.janus.JanusDatabase.class(JanusDatabase.scala:56)
  while locating org.thp.scalligraph.janus.JanusDatabase
  while locating org.thp.scalligraph.models.Database
    for the 1st parameter of org.thp.thehive.models.DatabaseProvider.<init>(SchemaUpdaterActor.scala:19)
  at org.thp.thehive.models.DatabaseProvider.class(SchemaUpdaterActor.scala:18)
  while locating org.thp.thehive.models.DatabaseProvider
  while locating org.thp.scalligraph.models.Database annotated with @com.google.inject.name.Named(value=with-thehive-schema)
    for the 4th parameter of org.thp.thehive.services.AuditSrv.<init>(AuditSrv.scala:28)
  at org.thp.thehive.services.AuditSrv.class(AuditSrv.scala:27)
  while locating org.thp.thehive.services.AuditSrv
    for the 3rd parameter of org.thp.thehive.services.notification.NotificationActor.<init>(NotificationActor.scala:76)
  while locating org.thp.thehive.services.notification.NotificationActor

1 error
akka.actor.ActorInitializationException: akka://application/user/notification-actor: exception during creation
        at akka.actor.ActorInitializationException$.apply(Actor.scala:196)
        at akka.actor.ActorCell.create(ActorCell.scala:659)
        at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:511)
        at akka.actor.ActorCell.systemInvoke(ActorCell.scala:533)
        at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:295)
        at akka.dispatch.Mailbox.run(Mailbox.scala:230)
        at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
  at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:71)
  at org.thp.scalligraph.janus.JanusDatabase.class(JanusDatabase.scala:56)
  while locating org.thp.scalligraph.janus.JanusDatabase
  while locating org.thp.scalligraph.models.Database
    for the 1st parameter of org.thp.thehive.models.DatabaseProvider.<init>(SchemaUpdaterActor.scala:19)
  at org.thp.thehive.models.DatabaseProvider.class(SchemaUpdaterActor.scala:18)
  while locating org.thp.thehive.models.DatabaseProvider
  while locating org.thp.scalligraph.models.Database annotated with @com.google.inject.name.Named(value=with-thehive-schema)
    for the 4th parameter of org.thp.thehive.services.AuditSrv.<init>(AuditSrv.scala:28)
  at org.thp.thehive.services.AuditSrv.class(AuditSrv.scala:27)
  while locating org.thp.thehive.services.AuditSrv
    for the 3rd parameter of org.thp.thehive.services.notification.NotificationActor.<init>(NotificationActor.scala:76)
  while locating org.thp.thehive.services.notification.NotificationActor

1 error
        at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
        at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1097)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1131)
        at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:436)
        at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:431)
        at play.api.inject.ContextClassLoaderInjector.$anonfun$instanceOf$2(Injector.scala:119)
        at play.api.inject.ContextClassLoaderInjector.withContext(Injector.scala:128)
        at play.api.inject.ContextClassLoaderInjector.instanceOf(Injector.scala:119)
        at play.api.libs.concurrent.ActorRefProvider.$anonfun$get$1(Akka.scala:268)
        at akka.actor.TypedCreatorFunctionConsumer.produce(IndirectActorProducer.scala:91)
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:64)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:411)
        at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:50)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:112)
        at org.thp.scalligraph.janus.JanusDatabase$.openDatabase(JanusDatabase.scala:51)
        at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:72)
        at org.thp.scalligraph.janus.JanusDatabase$$FastClassByGuice$$113881e3.newInstance(<generated>)
Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:411)
        at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:50)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1:9042] Cannot connect))
        at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:268)
        at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:107)
        at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1813)
        at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1726)
        at com.datastax.driver.core.Cluster.init(Cluster.java:214)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:387)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:366)
        at com.datastax.driver.core.Cluster.connect(Cluster.java:311)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.initializeSession(CQLStoreManager.java:320)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.<init>(CQLStoreManager.java:182)
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] o.r.Reflections - Reflections took 702 ms to scan 1 urls, producing 139 keys and 2174 values
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[error] i.n.u.HashedWheelTimer - You are creating too many HashedWheelTimer instances. HashedWheelTimer is a shared resource that must be reused across the JVM,so that only a few instances are created.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
[info] c.d.d.c.ClockFactory - Using native clock to generate timestamps.
Oops, cannot start the server.
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
  at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:71)
  at org.thp.scalligraph.janus.JanusDatabase.class(JanusDatabase.scala:56)
  while locating org.thp.scalligraph.janus.JanusDatabase
  while locating org.thp.scalligraph.models.Database
    for the 1st parameter of org.thp.thehive.models.DatabaseProvider.<init>(SchemaUpdaterActor.scala:19)
  at org.thp.thehive.models.DatabaseProvider.class(SchemaUpdaterActor.scala:18)
  while locating org.thp.thehive.models.DatabaseProvider
  while locating org.thp.scalligraph.models.Database annotated with @com.google.inject.name.Named(value=with-thehive-schema)
    for the 1st parameter of org.thp.thehive.services.LocalUserSrv.<init>(LocalUserSrv.scala:18)
  at org.thp.thehive.services.LocalUserSrv.class(LocalUserSrv.scala:17)
  while locating org.thp.thehive.services.LocalUserSrv
  while locating org.thp.scalligraph.auth.UserSrv
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:64)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:411)
        at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:50)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:112)
        at org.thp.scalligraph.janus.JanusDatabase$.openDatabase(JanusDatabase.scala:51)
        at org.thp.scalligraph.janus.JanusDatabase.<init>(JanusDatabase.scala:72)
        at org.thp.scalligraph.janus.JanusDatabase$$FastClassByGuice$$113881e3.newInstance(<generated>)
        at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:60)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
        at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
        at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:111)
        at com.google.inject.Guice.createInjector(Guice.java:87)
        at com.google.inject.Guice.createInjector(Guice.java:78)
        at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)
        at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:155)
        at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
        at play.core.server.ProdServerStart$.start(ProdServerStart.scala:54)
        at play.core.server.ProdServerStart$.main(ProdServerStart.scala:30)
        at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        ... 46 more
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1:9042] Cannot connect))
        at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:268)
        at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:107)
        at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1813)
        at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1726)
        at com.datastax.driver.core.Cluster.init(Cluster.java:214)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:387)
        at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:366)
        at com.datastax.driver.core.Cluster.connect(Cluster.java:311)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.initializeSession(CQLStoreManager.java:320)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.<init>(CQLStoreManager.java:182)
        ... 51 more

@To-om
Copy link
Contributor

To-om commented Jul 9, 2020

I've just encountered the same issue (TheHive doesn't correctly start). I'm still investigating.

@crackytsi
Copy link
Author

Thanks for the info, good to know :)

@To-om
Copy link
Contributor

To-om commented Jul 9, 2020

@crackytsi see #1429

@crackytsi
Copy link
Author

As i am offline for the next 2 weeks: @To-om if possible can you please check this related to header authentication if you migrate admin users from th3? That was the way I was confronted with the issue...

@To-om
Copy link
Contributor

To-om commented Jul 17, 2020

@crackytsi Your problem can be solved by setting the name of the cookie that contain the organisation name: add the configuration auth.organisationCookieName: "X-Organisation" in your application.conf. I'll add it in the default configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cannot reproduce TheHive4 TheHive4 related issues
Projects
None yet
Development

No branches or pull requests

2 participants