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] rc3 migration script failure #1369

Closed
joseluratm opened this issue May 27, 2020 · 7 comments
Closed

[Bug] rc3 migration script failure #1369

joseluratm opened this issue May 27, 2020 · 7 comments
Assignees
Labels
bug TheHive4 TheHive4 related issues
Milestone

Comments

@joseluratm
Copy link

joseluratm commented May 27, 2020

Request Type

Bug

Work Environment

Question Answer
OS version (server) Debian
TheHive version / git hash 4.0.0-rc3
Package Type Binary

Problem Description

Hi!
Today I updated my thehive4-rc2 to rc3 to do the migration I had in rc2 (I had to stop it because it was too slow). Now when I migrated to rc3 version and saw that many inconveniences had been solved, I set out to launch the database migration again, but I found this problem:

[info] a.e.s.Slf4jLogger - Slf4jLogger started
[info] a.r.a.t.ArteryTcpTransport - Remoting started with transport [Artery tcp]; listening on address [akka://[email protected]:40527] with UID [-289070641197308079]
[info] a.c.Cluster - Cluster Node [akka://[email protected]:40527] - Starting up, Akka version [2.6.3] ...
[info] a.c.Cluster - Cluster Node [akka://[email protected]:40527] - Registered cluster JMX MBean [akka:type=Cluster]
[info] a.c.Cluster - Cluster Node [akka://[email protected]:40527] - Started up successfully
[info] a.c.Cluster - Cluster Node [akka://[email protected]:40527] - 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://[email protected]:40527] - No seed-nodes configured, manual cluster join required, see https://doc.akka.io/docs/akka/current/typed/cluster.html#joining
[info] c.s.e.h.ElasticClient$ - Creating HTTP client on http://elasticsearch:9200
Exception in thread "main" com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: org.elasticsearch.client.RestClient.performRequestAsync(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lorg/apache/http/HttpEntity;Lorg/elasticsearch/client/ResponseListener;[Lorg/apache/http/Header;)V
  at org.thp.thehive.migration.th3.Input.<init>(Input.scala:47)
  at org.thp.thehive.migration.th3.Input.class(Input.scala:47)
  while locating org.thp.thehive.migration.th3.Input

1 error
        at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
        at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
        at org.thp.thehive.migration.th3.Input$.apply(Input.scala:43)
        at org.thp.thehive.migration.Migrate$.$anonfun$new$1(Migrate.scala:89)
        at org.thp.thehive.migration.Migrate$.$anonfun$new$1$adapted(Migrate.scala:82)
        at scala.Option.foreach(Option.scala:407)
        at org.thp.thehive.migration.Migrate$.delayedEndpoint$org$thp$thehive$migration$Migrate$1(Migrate.scala:82)
        at org.thp.thehive.migration.Migrate$delayedInit$body.apply(Migrate.scala:17)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at org.thp.thehive.migration.Migrate$.main(Migrate.scala:17)
        at org.thp.thehive.migration.Migrate.main(Migrate.scala)
Caused by: java.lang.NoSuchMethodError: org.elasticsearch.client.RestClient.performRequestAsync(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lorg/apache/http/HttpEntity;Lorg/elasticsearch/client/ResponseListener;[Lorg/apache/http/Header;)V
        at com.sksamuel.elastic4s.http.ElasticsearchJavaRestClient.send(ElasticsearchJavaRestClient.scala:72)
        at com.sksamuel.elastic4s.http.Executor$$anon$1.exec(Executor.scala:22)
        at com.sksamuel.elastic4s.http.Executor$$anon$1.exec(Executor.scala:15)
        at com.sksamuel.elastic4s.http.ElasticClient.execute(ElasticClient.scala:31)
        at org.thp.thehive.migration.th3.DBConfiguration.execute(DBConfiguration.scala:141)
        at org.thp.thehive.migration.th3.SearchWithScroll.<init>(DBFind.scala:131)
        at org.thp.thehive.migration.th3.DBFind.searchWithScroll(DBFind.scala:61)
        at org.thp.thehive.migration.th3.DBFind.apply(DBFind.scala:97)
        at org.thp.thehive.migration.th3.Input.<init>(Input.scala:362)
        at org.thp.thehive.migration.th3.Input$$FastClassByGuice$$1079ab92.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.InjectorImpl$1.get(InjectorImpl.java:1050)
        ... 16 more

I used these parameters to run the migration script:

./migrate --output /etc/thehive/application.conf --main-organisation TestOrg --es-index the_hive_15 --es-uri http://elasticsearch:9200

Complementary information

I used the version of thehive that is already compiled at

Here

By the way, after the mistake the migrate ends and does nothing!

@joseluratm joseluratm added TheHive4 TheHive4 related issues bug labels May 27, 2020
@To-om To-om modified the milestones: 4.0.0-RC4, 4.0.0-RC3 May 27, 2020
To-om added a commit that referenced this issue May 27, 2020
@To-om To-om closed this as completed May 27, 2020
@To-om
Copy link
Contributor

To-om commented May 27, 2020

@joseluratm I've regenerated packages. Can you update your package and try again the migration ?

@joseluratm
Copy link
Author

Hi, the script is working like a charm!!
thank you very much @To-om

@crackytsi
Copy link

crackytsi commented May 28, 2020

@To-om :I have also a debian 8.11 and running in the same issue. There is no newer update available if I try to update from "deb https://deb.thehive-project.org beta main"
My installed version is:

dpkg -s thehive4 | grep Version
Version: 4.0.0-0.2RC3

aptitude search thehive4 -F "%c %p %d %V"
i thehive4
Scalable, Open Source and Free Security Incident Response Solutions
4.0.0-0.2RC3

@To-om
Copy link
Contributor

To-om commented May 28, 2020

@crackytsi This is fixed by the updated package: 4.0.0-0.3-RC3

@crackytsi
Copy link

@To-om I know, but the file is missing:

Exists (old Version):
https://deb.thehive-project.org/pool/main/t/thehive4/thehive4_4.0.0-0.2RC3_all.deb

Missing (new Version):
https://deb.thehive-project.org/pool/main/t/thehive4/thehive4_4.0.0-0.3RC3_all.deb

I have no clue how @joseluratm was able to update it, because it seems to be missing.

@To-om
Copy link
Contributor

To-om commented May 28, 2020

@crackytsi Please try again, there was a problem in package publication.

@crackytsi
Copy link

@To-om Yes, now it's there, but I already compiled the version on my own ;)

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

No branches or pull requests

3 participants