jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

Exception on search running a local docker instance of Elasticsearch #14931

Closed cordial closed 4 months ago

cordial commented 3 years ago
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)
fengshui-manager@0.0.1-SNAPSHOT /Users/davidcarter/work/fengshuiManager
ā””ā”€ā”€ generator-jhipster@7.0.1
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

cordial commented 3 years ago

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}"

github-actions[bot] commented 3 years ago

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

indiepopart commented 2 years ago

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.

cordial commented 2 years ago

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.

github-actions[bot] commented 12 months ago

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

DanielFran commented 11 months ago

@indiepopart Are you available to contribute with a PR?

github-actions[bot] commented 4 months ago

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