meilisearch-java icon indicating copy to clipboard operation
meilisearch-java copied to clipboard

NPE when updating primaryKey after meili update to 0.28.0 (breaking changes)

Open dbacinski opened this issue 1 year ago • 5 comments

Description

After update of meilisearch from 0.27.2 to 0.28.0 updating of index primary key has started failing with NPE

meiliClient.updateIndex("indexName", "productId")

Exception in thread "main" java.lang.NullPointerException
	at java.base/java.io.Reader.<init>(Reader.java:168)
	at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:76)
	at com.meilisearch.sdk.http.DefaultHttpClient.execute(DefaultHttpClient.java:62)
	at com.meilisearch.sdk.http.DefaultHttpClient.put(DefaultHttpClient.java:87)
	at com.meilisearch.sdk.MeiliSearchHttpRequest.put(MeiliSearchHttpRequest.java:106)
	at com.meilisearch.sdk.IndexesHandler.updatePrimaryKey(IndexesHandler.java:83)
	at com.meilisearch.sdk.Client.updateIndex(Client.java:139)

It seems like version 0.28.0 is not returning any response but the client library is expecting to get one.

It works fine after reverting meili to 0.27.2

Environment (please complete the following information):

  • OS: Linux
  • Meilisearch version: v.0.28.0
  • meilisearch-java version: v0.7.2

dbacinski avatar Jul 19 '22 09:07 dbacinski

https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0 I see there are breaking changes in 0.28.0:

The endpoint to update an index is now PATCH /indexes/{indexUid} instead of PUT

when do you plan to adapt java library to those changes?

dbacinski avatar Jul 19 '22 09:07 dbacinski

Hi @dbacinski, Indeed the v0.28.0 of Meilisearch has been released last week but the SDK is not yet updated with this. The v0.7.2 of this SDK is only compatible with the v0.27, I let you check the changelog about it. I will try to update it as soon as possible but we have to make a refactor of this SDK so it could take some time. Sorry for the inconvenience.

alallema avatar Jul 19 '22 10:07 alallema

Any news on this issue @alallema ?

rauldeheer avatar Aug 31 '22 09:08 rauldeheer

Hi @rauldeheer, @alallema is currently on vacation :)

But we are still working on that refactor; unfortunately, we can't give you an estimation of when we should finish it.

Thanks for using Meilisearch, and sorry for the inconvenience!

brunoocasali avatar Aug 31 '22 17:08 brunoocasali

Thank you for replying. I'll just wait for a new release, thanks. @brunoocasali

rauldeheer avatar Sep 01 '22 06:09 rauldeheer