geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
406 stars 482 forks source link

continuous js error due to elastic missing #4360

Open pvgenuchten opened 4 years ago

pvgenuchten commented 4 years ago

UI calls /geonetwork/warninghealthcheck at every load, this method fails always if no elastic is configured, causing a js error in browser

Why are we always calling warninghealthcheck? Maybe we should only call it if a relevant admin page is loaded?

This method should not return an error related to elastic if the instance is not setup with elastic

"name": "DashboardAppHealthCheck",
"status": "ERROR",
"msg": "Error creating bean with name 'EsSearchManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.fao.geonet.es.EsClient org.fao.geonet.kernel.search.EsSearchManager.client; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.fao.geonet.es.EsClient] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}",
"exception": "org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EsSearchManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.fao.geonet.es.EsClient org.fao.geonet.kernel.search.EsSearchManager.client; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.fao.geonet.es.EsClient] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\n\tat 

and

{
"name": "IndexHealthCheck",
"status": "ERROR",
"msg": "Remote index module is not installed in your catalogue installation. Add 'es' to the spring.profiles.active in WEB-INF/web.xml to activate it."
}
fxprunayre commented 4 years ago

causing a js error in browser

image

There is no JS error. A HTTP call with a status 500.

Based on the response some functionalities are enabled or not. eg WFS feature indexing for the map app.

josegar74 commented 4 years ago

I guess a better option can be to return a report of the status of services (with http 200) instead of returning http 500, but to check what code changes are required for this in the UI.

pvgenuchten commented 4 years ago

the point here is that gn should not check any elastic status, if elastic is not configured

josegar74 commented 4 years ago

I guess should check Elastic, but the backend should return some message indicating it's not enabled, instead of an error, so the UI can disable the related elements.

RomainBourgATOL commented 9 months ago

HI

Is there any news about this issue ? This error is still present in 3.12.9