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

Problem with the nodes of ElasticSeach #5

Open
alvaro-lopezgarcia opened this issue Jul 18, 2019 · 3 comments
Open

Problem with the nodes of ElasticSeach #5

alvaro-lopezgarcia opened this issue Jul 18, 2019 · 3 comments
Labels

Comments

@alvaro-lopezgarcia
Copy link

Hi Arey,
My name is Alvaro and I am a 23 years old student from Madrid who has just finished a Telecommunications Engineering degree.
I am writing to you because now during the summer I am working in a project trying to develop MusicBrainz and Discogs databases in Elastic Search to learn about ES, where I am a beginner.
To index MusicBrainz I am following your tutorial, however now I had a problem that I did not know how to solve in several days. I hope that you can help me, I will be so grateful.
I followed the tutorial working with Docker and Compose, and the first part of this (the docker part) I think that worked fine.
The problem appears in the Quick Start part. After do "mvn install", the next command: mvn exec:java return the next error:

ERROR org.springframework.batch.core.step.AbstractStep [229] - Encountered an error executing step deleteIndexIfExists in job musicAlbumJob org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) ~[elasticsearch-1.7.1.jar:na]
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200) ~[elasticsearch-1.7.1.jar:na]
at org.elasticsearch.client.transport.support.InternalTransportIndicesAdminClient.execute(InternalTransportIndicesAdminClient.java:86) ~[elasticsearch-1.7.1.jar:na]

2019-07-18 17:18:43,551 [com.javaetmoi.elasticsearch.musicbrainz.batch.IndexBatchMain.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher [136] - Job: [FlowJob: [name=musicAlbumJob]] completed with the following parameters: [{}] and the following status: [FAILED]
2019-07-18 17:18:43,551 [com.javaetmoi.elasticsearch.musicbrainz.batch.IndexBatchMain.main()] INFO org.springframework.context.support.ClassPathXmlApplicationContext [984] - Closing org.springframework.context.support.ClassPathXmlApplicationContext@66d6172a: startup date [Thu Jul 18 17:18:11 CEST 2019]; root of context hierarchy
2019-07-18 17:18:43,564 [com.javaetmoi.elasticsearch.musicbrainz.batch.IndexBatchMain.main()] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor [202] - Shutting down ExecutorService
2019-07-18 17:18:43,564 [com.javaetmoi.elasticsearch.musicbrainz.batch.IndexBatchMain.main()] INFO org.springframework.data.elasticsearch.client.TransportClientFactoryBean [59] - Closing elasticSearch client

I think that it should be a problem with Elasticsearch but I dont know what. I have another version of it more recent (maybe it cause trouble but I dont think so).
Do you know how can I fix that?
Thanks a lot for your time and for this project which is very cool.
I wait for your answer soon.
Alvaro.

@arey arey added the question label Jul 22, 2019
@arey
Copy link
Owner

arey commented Jul 22, 2019

Hi @alvaro-lopezgarcia. Elasticsearch regularly changes its API. The version used by this project is an older one: 1.7.1
Regarding to this blog post https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html, the TransportClient will be removed from ES 8 and is deprecated since ES 7. It could explains. Which version of ES are you using?
I'm worried about my base code is using a too older version of the ES API.

@alvaro-lopezgarcia
Copy link
Author

Hello @arey, thanks for answering I am very grateful.
The version of elastic that I used to work was 6.2, but this project didn't work in that version for me so I installed version 1.7.1 which is very old but works for this project.
I have resolved the problem that I explained you, I have got to change in the file es-musicbrainz-batch.properties the elasticsearch and postgres addresses to localhost (127.0.0.1) and it resolved the trouble.
However, now a new error appears to me in the step IndexMusicAlbum because reading the dates appears an unskippable exception beacause of the gender of the artist. I haven't got any idea of how to resolve it. It doesn't seems to be a configuration problem but I don't really know. I copy here the logs for if you could explain me more about it and maybe how to fix it...

Executing step: [indexMusicAlbum]
2019-07-22 16:56:23,824 [batchTaskExecutor-1] ERROR org.springframework.batch.core.step.AbstractStep [229] - Encountered an error executing step indexMusicAlbumPartition in job musicAlbumJob org.springframework.batch.core.step.skip.NonSkippableReadException: Non-skippable exception during read
at org.springframework.batch.core.step.item.FaultTolerantChunkProvider.read(FaultTolerantChunkProvider.java:105) ~[spring-batch-core-3.0.10.RELEASE.jar:3.0.10.RELEASE]
at org.springframework.batch.core.step.item.SimpleChunkProvider$1.doInIteration(SimpleChunkProvider.java:116) ~[spring-batch-core-3.0.10.RELEASE.jar:3.0.10.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374) ~[spring-batch-infrastructure-3.0.10.RELEASE.jar:3.0.10.RELEASE]
Caused by: java.lang.IllegalArgumentException: Unrecognized artist gender: 4
at fm.last.musicbrainz.data.model.Gender.valueOf(Gender.java:52) ~[musicbrainz-data-3.1.0.jar:na]
at com.javaetmoi.elasticsearch.musicbrainz.batch.mapper.AlbumRowMapper.mapRow(AlbumRowMapper.java:51) ~[classes/:na]
at com.javaetmoi.elasticsearch.musicbrainz.batch.mapper.AlbumRowMapper.mapRow(AlbumRowMapper.java:29) ~[classes/:na]

2019-07-22 16:56:23,825 [batchTaskExecutor-1] INFO com.javaetmoi.core.batch.listener.LogStepListener [75] - Step indexMusicAlbumPartition:partition0 - Read count: 201 - Write count: 0 - Commit count: 0

Thanks a lot again for your time!

@arey
Copy link
Owner

arey commented Jul 23, 2019

The exception cause show that the MusicBrainz database has introduced a new gender : java.lang.IllegalArgumentException: Unrecognized artist gender: 4
The last version of the musicbrainz-data artefactId does not reference it:
https://github.com/lastfm/musicbrainz-data/blob/master/src/main/java/fm/last/musicbrainz/data/model/Gender.java
We have to found the corresponding label of the ID number 4, then submit a PR to musicbrainz-data. By waiting, you could copy/paste the class and use this temporary copy.
You may also configure the Spring Batch job to skip the IllegalArgumentException (with the <skippable-exception-classes> tag)
See https://docs.spring.io/spring-batch/trunk/reference/html/configureStep.html for more details

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

No branches or pull requests

2 participants