Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

fix fatal error of missing method parseString #302

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

ylwu-amzn
Copy link
Contributor

Issue #, if available:

Description of changes:
When cluster restarted, will restore model from checkpoint, but will throw fatal errors which will restart cluster.

[2020-10-29T19:43:34,676][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [ad5beb168c48658f8e0d1f227f3395cd] fatal error in thread [elasticsearch[ad5beb168c48658f8e0d1f227f3395cd][get][T#4]], exiting
java.lang.NoSuchMethodError: 'com.google.gson.JsonElement com.google.gson.JsonParser.parseString(java.lang.String)'
	at com.amazon.opendistroforelasticsearch.ad.ml.CheckpointDao.lambda$fromEntityModelCheckpoint$12(CheckpointDao.java:469) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at com.amazon.opendistroforelasticsearch.ad.ml.CheckpointDao.fromEntityModelCheckpoint(CheckpointDao.java:467) ~[?:?]
	at com.amazon.opendistroforelasticsearch.ad.ml.CheckpointDao.lambda$restoreModelCheckpoint$13(CheckpointDao.java:501) ~[?:?]

It's caused by ES cluster using old GSON version which doesn't have parseString method. It takes time find out which package introduces the old version of GSON. This PR change to use an old method "parse" as a workaround.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ylwu-amzn ylwu-amzn added the bug Something isn't working label Oct 30, 2020
@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #302 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #302      +/-   ##
============================================
- Coverage     72.03%   72.02%   -0.01%     
- Complexity     1967     1968       +1     
============================================
  Files           199      199              
  Lines          9462     9463       +1     
  Branches        844      844              
============================================
  Hits           6816     6816              
- Misses         2233     2236       +3     
+ Partials        413      411       -2     
Flag Coverage Δ Complexity Δ
#plugin 71.43% <100.00%> (-0.01%) 1968.00 <1.00> (+1.00) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...pendistroforelasticsearch/ad/ml/CheckpointDao.java 83.76% <100.00%> (+0.08%) 57.00 <1.00> (ø)
...ransport/DeleteAnomalyDetectorTransportAction.java 52.22% <0.00%> (-4.45%) 15.00% <0.00%> (-1.00%)
...asticsearch/ad/cluster/ADClusterEventListener.java 94.00% <0.00%> (+6.00%) 15.00% <0.00%> (+2.00%)

Copy link
Contributor

@yizheliu-amazon yizheliu-amazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens only when cluster restarts?

@ylwu-amzn ylwu-amzn merged commit 1f49f20 into opendistro-for-elasticsearch:master Oct 30, 2020
@ylwu-amzn
Copy link
Contributor Author

This happens only when cluster restarts?

See this happen when restarts, but I think it will happen when restore entity model from checkpoint.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants