elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.93k stars 24.74k forks source link

[CI] org.elasticsearch.common.settings.KeyStoreWrapperTests unrecognized algorithm name: PBEWithMD5AndDES #72466

Closed albertzaharovits closed 2 years ago

albertzaharovits commented 3 years ago

Tests failing: testBackcompatV1 testBackcompatV2

Looks related: https://github.com/elastic/elasticsearch/issues/72359 . most likely a race bug in the latest build of JDK 8.

Build scan: https://gradle-enterprise.elastic.co/s/s4i32zznnh2wo

Repro line:

./gradlew ':server:unitTest' -Dtests.seed=AE81A1EBD6430146 -Dtests.class=org.elasticsearch.common.settings.KeyStoreWrapperTests -Dtests.method="testBackcompatV1" -Dtests.security.manager=true -Dtests.locale=es-GT -Dtests.timezone=Europe/Chisinau -Dcompiler.java=11 -Druntime.java=8

Reproduces locally?: Probably (sporadically - race)

Applicable branches: 6.8

Failure history: https://gradle-enterprise.elastic.co/scans/failures?failures.failureClassification=all_failures&failures.failureMessage=Execution%20failed%20for%20task%20%27:server:unitTest%27.%0A%3E%20There%20were%20test%20failures:%201229%20suites%20(1%20ignored),%208350%20tests,%20*%20ignored%20*%20assumptions)%20%5Bseed:%20*&search.relativeStartTime=P7D&search.timeZoneId=Europe/Bucharest

Failure excerpt:

Suite: org.elasticsearch.common.settings.KeyStoreWrapperTests   
  1> [2021-04-29T14:53:03,985][INFO ][o.e.c.s.KeyStoreWrapperTests] [testUpgradeAddsSeed] before test   
  1> [2021-04-29T14:53:05,290][INFO ][o.e.c.s.KeyStoreWrapperTests] [testUpgradeAddsSeed] after test    
  1> [2021-04-29T14:53:05,293][INFO ][o.e.c.s.KeyStoreWrapperTests] [testLegacyV3] before test  
  1> [2021-04-29T14:53:05,344][INFO ][o.e.c.s.KeyStoreWrapperTests] [testLegacyV3] after test   
  1> [2021-04-29T14:53:05,346][INFO ][o.e.c.s.KeyStoreWrapperTests] [testBackcompatV1] before test  
  1> [2021-04-29T14:53:05,356][INFO ][o.e.c.s.KeyStoreWrapperTests] [testBackcompatV1] after test   
  2> REPRODUCE WITH: ./gradlew ':server:unitTest' -Dtests.seed=AE81A1EBD6430146 -Dtests.class=org.elasticsearch.common.settings.KeyStoreWrapperTests -Dtests.method="testBackcompatV1" -Dtests.security.manager=true -Dtests.locale=es-GT -Dtests.timezone=Europe/Chisinau -Dcompiler.java=11 -Druntime.java=8  
ERROR   0.03s J7  | KeyStoreWrapperTests.testBackcompatV1 <<< FAILURES! 
   > Throwable #1: java.security.KeyStoreException: Key protection  algorithm not found: java.security.NoSuchAlgorithmException: unrecognized algorithm name: PBEWithMD5AndDES  
   >    at __randomizedtesting.SeedInfo.seed([AE81A1EBD6430146:22D54C63382512CC]:0) 
   >    at sun.security.pkcs12.PKCS12KeyStore.setKeyEntry(PKCS12KeyStore.java:677)  
   >    at sun.security.pkcs12.PKCS12KeyStore.engineSetEntry(PKCS12KeyStore.java:1396)  
   >    at java.security.KeyStore.setEntry(KeyStore.java:1557)  
   >    at org.elasticsearch.common.settings.KeyStoreWrapperTests.testBackcompatV1(KeyStoreWrapperTests.java:322)   
   >    at java.lang.Thread.run(Thread.java:748)    
   > Caused by: java.security.NoSuchAlgorithmException: unrecognized algorithm name: PBEWithMD5AndDES   
   >    at sun.security.x509.AlgorithmId.get(AlgorithmId.java:448)  
   >    at sun.security.pkcs12.PKCS12KeyStore.setKeyEntry(PKCS12KeyStore.java:645)  
   >    ... 40 more
elasticmachine commented 3 years ago

Pinging @elastic/es-security (Team:Security)

martijnvg commented 3 years ago

Three more instances of this failure:

I suspect this failure is related to jdk8 problem:

@albertzaharovits Can you confirm this (^)?

albertzaharovits commented 3 years ago

I fail to reproduce this locally with JAVA_HOME=$JAVA12_HOME RUNTIME_JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home ./gradlew ':server:unitTest' -Dtests.class=org.elasticsearch.common.settings.KeyStoreWrapperTests

=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version        : 5.4.1
  OS Info               : Mac OS X 10.16 (x86_64)
  Compiler JDK Version  : 12 (Oracle Corporation 12.0.2 [OpenJDK 64-Bit Server VM 12.0.2+10])
  Compiler java.home    : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
  Runtime JDK Version   : 1.8 (Azul Systems, Inc. 1.8.0_292 [OpenJDK 64-Bit Server VM 25.292-b10])
  Runtime java.home     : /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
  Gradle JDK Version    : 12 (Oracle Corporation 12.0.2 [OpenJDK 64-Bit Server VM 12.0.2+10])
  Gradle java.home      : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
  Random Testing Seed   : 8D065E2C597692
=======================================

But it does fail regularly on CI. Maybe the MacOS build is not exhibiting the same problem. The JDK bug https://bugs.openjdk.java.net/browse/JDK-8266261?jql=project%20%3D%2010100%20AND%20labels%20%3D%20webbug is serious and it is introduced in a build candidate (25.292-b10) so hopefully it will be fixed soon.

Mutting for all JDK8s ...

jkakavas commented 2 years ago

This is only applicable to 6.8 and is already muted. Closing this as won't fix since 6.8 is EOL