generator-jhipster icon indicating copy to clipboard operation
generator-jhipster copied to clipboard

Exception on search running a local docker instance of Elasticsearch

Open cordial opened this issue 3 years ago • 6 comments

Overview of the issue

I'm trying to setup a local instance of elasticsearch using the docker instructions on your site. However, I get an exception when I try and search on an entity I created.

Motivation for or Use Case

Throws exception and unable to search with elasticsearch locally.

Reproduce the error
  1. Create local jhipster react project (I used gradle and MongoDB).
  2. Create entity with various fields
  3. Follow Jipster Elasticsearch instructions for local development (for docker instance) - https://www.jhipster.tech/using-elasticsearch/
  4. Login and navigate to the new entity.
  5. Type text into the search field for the entity.
  6. Exception is displayed in gradlew console -

"Exception in search() with cause = 'ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]' and exception = 'Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]'

org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]"

JHipster Version(s)

jhipster version 7.0.1

JHipster configuration

INFO! Using JHipster version installed locally in current project's node_modules Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] /Users/davidcarter/work/fengshuiManager
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "blueprints": [],
    "otherModules": [],
    "applicationType": "monolith",
    "baseName": "fengshuiManager",
    "jhipsterVersion": "7.0.1",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": [],
    "pages": [],
    "creationTimestamp": 1620227346794,
    "serviceDiscoveryType": "eureka",
    "reactive": false,
    "authenticationType": "jwt",
    "packageName": "com.lime.fsm",
    "serverPort": "8080",
    "cacheProvider": "no",
    "enableHibernateCache": false,
    "databaseType": "mongodb",
    "buildTool": "gradle",
    "serverSideOptions": ["searchEngine:elasticsearch"],
    "websocket": false,
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": false,
    "nativeLanguage": "en",
    "packageFolder": "com/lime/fsm",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "devDatabaseType": "mongodb",
    "prodDatabaseType": "mongodb",
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en", "fr"],
    "lastLiquibaseTimestamp": 1620236115000,
    "entities": ["Partialresult", "CalcsheetResults"]
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Partialresult {
  emailAddress String required unique
  responseData Instant
  floorPlansUploaded Boolean
  houseImagesUploaded Boolean
  folderName String
}
entity CalcsheetResults {
  averageCompass String
  adjustedCompass String
  sittingAndFacing String
  outsideWaterVolume String
  fsConstructionCycle String
  totalSquareFootage String
  metalPounds String
  metalKg String
  heavyMetalKg String
}
paginate Partialresult, CalcsheetResults with pagination
service Partialresult, CalcsheetResults with serviceImpl

Environment and Tools

openjdk version "15" 2020-09-15 OpenJDK Runtime Environment (build 15+36-1562) OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)

git version 2.30.1 (Apple Git-130)

node: v15.1.0

npm: 7.0.8

Docker version 20.10.6, build 370c289

docker-compose version 1.29.1, build c34c88b2

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Mac/Any browser

  • [ x ] Checking this box is mandatory (this is just to show you read everything)

cordial avatar May 10 '21 11:05 cordial

Later on there is perhaps a more pertinent exception -

" Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://localhost:9200], URI [/calcsheetresults/_search?typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=dfs_query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 400 Bad Request] {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [id] in order to sort on","index_uuid":"e0VRGAk9T0WOAvRUvrT2tg","index":"calcsheetresults"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"calcsheetresults","node":"sa9YqIUKT8u6sg_ftuVqKw","reason":{"type":"query_shard_exception","reason":"No mapping found for [id] in order to sort on","index_uuid":"e0VRGAk9T0WOAvRUvrT2tg","index":"calcsheetresults"}}]},"status":400}"

cordial avatar May 10 '21 12:05 cordial

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

github-actions[bot] avatar Jun 10 '21 00:06 github-actions[bot]

I am having the same issue for entities that declare pagination in the JDL. The sort piece of the query is not supported with the default configurations.

indiepopart avatar Nov 12 '21 15:11 indiepopart

I am having the same issue for entities that declare pagination in the JDL. The sort piece of the query is not supported with the default configurations.

I gave up in the end.

cordial avatar Nov 12 '21 15:11 cordial

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days

github-actions[bot] avatar Oct 25 '23 00:10 github-actions[bot]

@indiepopart Are you available to contribute with a PR?

DanielFran avatar Oct 31 '23 13:10 DanielFran

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days

github-actions[bot] avatar Jun 03 '24 00:06 github-actions[bot]