-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
ElasticSearch Exception on Newly Generated Application #24206
Comments
I tried to generate an app with the configuration below. I don't get an error anymore (probably because the pagination is turned off), but the search simply delivers no results. I turned the faker off and added my own entries. I also tried to add "generator-jhipster-es-entity-reindexer", but apparently it didn't help. @user-0209 So you still don't have a solution? At least some manual fix after the generation?
|
I don't have a solution at this moment. I'm trying to make https://github.com/Ebsan/generator-jhipster-es-entity-reindexer work. I'm pretty sure its just about rebuilding the index. |
JHipster has completed the sample check This check uses |
Meanwhile I undestand that in version 8 jhipster adopted the ES module standard. Also, some exports might have changed and that breaks not only https://github.com/Ebsan/generator-jhipster-es-entity-reindexer but also most of the other generators not immediately part of the jhipster repository. However, I need this reindexing functionality and would go forward to update the generator. |
@user-0209 I believe you can use https://github.com/jhipster/generator-jhipster-entity-audit as an example. |
@user-0209 I found this sample with elasticsearch on version 8. https://github.com/jhipster/jhipster-sample-app-elasticsearch Maybe it is of any to you. |
Thank you for responding. In fact, I find it amazing, how fast I'm getting responses in this Jhipster context. |
Our elasticsearch tests needs improvements to avoid regressions like this one. |
By the way, if someone is interested, I positively tested running the backend generated with the latest version 7 and the frontend with version 8. The search works. You only need to change the GET mappings in all *Resource.java files from @GetMapping("/_search/RESOURCE") to @GetMapping("/RESOURCE/_search"), which is really not hard to do. This way you get Angular 16, which is nice. |
@user-0209 Any progress in the meanwhile? |
@aturyng: The problem is not ES as such. Once the index for the entity is in place, things work (for the entity instances that have been updated). The problem is with the preloaded fake-data. Not sure, if I'm old-fashioned, but I want defined, repeatable test data in the development cycle. Earlier (I think version 6), I had one of those re-indexing extensions in place and it worked. However, and here is the point: since few versions so many things have changed that all these blueprints don't work and apparently, nobody is taking the effort, to update them (guess why). So I embarked on porting one of the reindexing modules to a proper blueprint, but I have to say, it is very time-consuming due to a complete lack of documentation of those jHipster base classes, but not only. The blueprints chapter can only serve as a teaser, re-eingineering the base classes is necessary. In summary, I'd highly appreciate JSDoc for the baseclasses and in the blueprints documentation experts should say, when (scenario) you want which base class. Amongst the core-team maintained official blueprints there should be an (almost) empty blueprint that is up to speed with the respective JHipster version. Having said this, I'm still much in favour of getting the application generated, because otherwise you'd end in another tunnel. Thanks to the core team. Let me know, if I'm missing some documentation. |
The issue seems to be with new elasticsearch. As a workaround I've used elasticsearch version from Jhipster 7 and it works very good. Version 7.17.4 –> OK, version 8.7.1 -> NOT OK. |
@Nenzyz Thank you for your input! |
The only change from the freshly created project was changes in What doesn't work still is reindexing of existing entities, but this is unrelated to this issue. (I won't post in the old issue, since this one is referenced in the old) |
I think I know what happened here, give me some time I'll get a reason and a way to solve it. |
Unfortunately, jhipster 8.1.0 does not solve the problem. I get exactly the same error. |
The same error with me, anyone can help to fix it? |
Hi, Not a real fix, but the jhipster-reindexer module can be used to resync entities in search engine |
@Tcharl thank you for your reply. $ yo jhipster-es-entity-reindexer Cannot find module 'C:\Users\Nyen.npm-packages\node_modules\generator-jhipster-es-entity-reindexer\node_modules\generator-jhipster\dist\generators\generator-base\index.js' |
It's kind of an old one: the class has to be adapted a bit |
This issue is stale because it has been open for too long without any activity. |
Overview of the issue
In a newly generated application, Elastic Search is causing an "Internal server error" by throwing an exception. Once an entity instance has been updated, it can be searched. On all other (not yet updated) entities of the same type, ElasticSearch doesn't find anything. On other entity types, where no entity yet has been updated, the Internal Server Error/ElasticSearch Exception still occurs.
Stack Traces and Messages
Application Message when no entity has been updated:
Messages upon successful search on an previously updated entity:
Messages upon failed search on a not-yet updated entity:
Motivation for or Use Case
A newly generated application should work out of the box. Apparently ElasticSearch has to build datastructures that do not exist on a new application. Also, initial indexing does not happen on fake data. All of this creates much irritation because you are not told, what the problem is.
Reproduce the error
A sample JDL is given below. JDL is in the otherwise empty application folder.
Related issues
https://github.com/jhipster/generator-jhipster/issues/22603
Suggest a Fix
JHipster Version(s)
JHipster configuration
.yo-rc.json file
JDL definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Ubuntu 22.04
Firefox: 119.0.1
Environment and Tools
openjdk version "17.0.8.1" 2023-08-24
OpenJDK Runtime Environment (build 17.0.8.1+1-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.8.1+1-Ubuntu-0ubuntu122.04, mixed mode, sharing)
git version 2.34.1
node: v20.9.0
npm: 10.1.0
Docker version 24.0.7, build afdd53b
The text was updated successfully, but these errors were encountered: