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

Elastic Configuration does not account for repo.search.url property #334

Open
GGoetzelmann opened this issue Nov 18, 2024 · 0 comments
Open

Comments

@GGoetzelmann
Copy link

Describe the bug

Using base-repo with search enabled and an ES instance not running under the default URL 'localhost:9200', but a different hostname or port number (configured in application.properties file), leads to
Error creating bean with name 'dataResourceController' due to org.springframework.dao.DataAccessResourceFailureException: Connection refused.

Meanwhile, the ElasticsearchUtil is quite satisfied (aka the ES service is running and reachable):

2024-11-18 16:27:56 2024-11-18T15:27:56.665Z TRACE 9 --- [           main] e.k.datamanager.util.ElasticSearchUtil   : Trying to connect to elasticsearch instance.
2024-11-18 16:27:56 2024-11-18T15:27:56.776Z TRACE 9 --- [           main] e.k.datamanager.util.ElasticSearchUtil   : Status code value: 200

To Reproduce
Steps to reproduce the behavior:

  1. setup ES on non-9200 port or not-localhost
  2. set repo.search.url to ES URL from step 1
  3. enable search for base-repo
  4. start application
  5. See error

Expected behavior
Connection should be made to custom ES service

Likely culprit

https://github.com/kit-data-manager/base-repo/blob/main/src/main/java/edu/kit/datamanager/repo/configuration/ElasticConfiguration.java#L42

It seems to help to provide

    @Value("${repo.search.url}")
    private String searchUrl;

here, and to get host and port from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant