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] Fix index creation and rebuild #2265

Closed
To-om opened this issue Nov 26, 2021 · 5 comments
Closed

[Bug] Fix index creation and rebuild #2265

To-om opened this issue Nov 26, 2021 · 5 comments
Assignees
Labels
bug TheHive4 TheHive4 related issues
Milestone

Comments

@To-om
Copy link
Contributor

To-om commented Nov 26, 2021

Request Type

Bug

Problem Description

The index creation is not correctly rebuilt after a database restore. Only one index should be used (managed by Elasticsearch or Lucene). All composite indices should be removed. When the index is not available, TheHive should refuse to start (db.janusgraph.dropAndRebuildIndexOnFailure: false) or remove the index and rebuild a new one (db.janusgraph.dropAndRebuildIndexOnFailure: true)

@To-om To-om added bug TheHive4 TheHive4 related issues labels Nov 26, 2021
@To-om To-om added this to the 4.1.15 milestone Nov 26, 2021
@To-om To-om self-assigned this Nov 26, 2021
To-om added a commit that referenced this issue Nov 29, 2021
@To-om To-om closed this as completed Nov 29, 2021
To-om added a commit that referenced this issue Dec 2, 2021
To-om added a commit that referenced this issue Dec 2, 2021
@azgaviperr
Copy link

Hello, where should be set db.janusgraph.dropAndRebuildIndexOnFailure: true ?

I added it to the application.conf.

Got currently an index issue after ugrading to 3.15.1 (forgot to change :latest ^^)

@To-om
Copy link
Contributor Author

To-om commented Dec 8, 2021

@azgaviperr Hello, what is your issue ?

@azgaviperr
Copy link

I fixed my issue with the index from the upgrade (container was restarting before finishing reindex).

However I am not sure where to setup db.janusgraph.dropAndRebuildIndexOnFailure: true

@To-om
Copy link
Contributor Author

To-om commented Dec 9, 2021

this settings should not be set to true in normal use, otherwise TheHive will remove index and rebuild it if the index engine is not ready yet at startup (can occur when using docker-compose for example). If should be set to true if you known that the index need to be rebuilt.

To answer you question, db.janusgraph.dropAndRebuildIndexOnFailure is the full path of the config. You can set it in root section in application.conf. Or you can set dropAndRebuildIndexOnFailure under db.janusgraph section:

db.janusgraph {
  storage {
    backend: cql
    // [...]
  }
  index.search {
    backend: lucene
    // [...]
  }

  dropAndRebuildIndexOnFailure: false
}
    

@azgaviperr
Copy link

Happy I did pretty much understand this ^^

image

Thanks for the info.

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

2 participants