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

CertUtilsTest.loadECPrivateOnlyKey and HttpClientUtilsTest$GetProxyUrl.withNoHttpProxyProvidedReturnsNull #6757

Open
EmilioDeGyves opened this issue Jan 2, 2025 · 2 comments
Labels
Waiting on feedback Issues that require feedback from User/Other community members

Comments

@EmilioDeGyves
Copy link

EmilioDeGyves commented Jan 2, 2025

Describe the bug

I am encountering issues while attempting to build the Kubernetes client and Kubernetes client API from source. The build process is failing with the following errors:

CertUtilsTest.loadECPrivateOnlyKey:207 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

CertUtilsTest.loadECkeys:196 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

HttpClientUtilsTest$GetProxyUrl.withNoHttpProxyProvidedReturnsNull:235 » IllegalArgument Failure in creating proxy URL. Proxy port is required!

Environment Details
Package: io.fabric8:kubernetes-client:6.12.1
Language: Java
Framework: Maven
Build Command: mvn -pl kubernetes-client clean install -Dmaven.test.skip=true
Operating System: Oracle Linux Server 8.8
Compiler/Interpreter: javac
Python Version: 3.12.4
Java Version: 17.0.8
Maven Version: 3.9.4
Gradle Version: 8.2.1
Ant Version: 1.10.14
Node Version: 16.20.2
C++ Version: 8.5.0
Go Version: 1.22.0
Cargo Version: 1.75.0
HTTP Proxy: Private but assigned
HTTPS Proxy: Private but assigned

Fabric8 Kubernetes Client version

6.12.1

Steps to reproduce

  1. Download the image with the specified environment settings.
  2. Check if the environment settings are correct (HTTP proxy, HTTPS proxy, no proxy).
  3. Set JAVA_HOME to /opt/jdk-17.0.8.
  4. Set LANG and LC_ALL to utc-8.
  5. Clone the repository:

git clone https://github.com/fabric8io/kubernetes-client.git -b v6.12.1 /tmp/pkgs_raw/kubernetes-client/6.12.1

  1. Navigate to the cloned directory:

cd /tmp/pkgs_raw/kubernetes-client/6.12.1

Run the build command:

mvn clean install -pl kubernetes-client-api -DskipTests
mvn clean install -pl kubernetes-client -DskipTests

Run the tests:

mvn test -pl kubernetes-client-api
mvn test -pl kubernetes-client

Also tried with "clean test"

  1. Observe the errors:

CertUtilsTest.loadECPrivateOnlyKey:207 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

CertUtilsTest.loadECkeys:196 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

HttpClientUtilsTest$GetProxyUrl.withNoHttpProxyProvidedReturnsNull:235 » IllegalArgument Failure in creating proxy URL. Proxy port is required!

Expected behavior

The build should complete successfully without any errors.

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

other (please specify in additional context)

Fabric8 Kubernetes Client Logs

CertUtilsTest.loadECPrivateOnlyKey:207 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

CertUtilsTest.loadECkeys:196 » KeyStore Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: Cannot find any provider supporting PBEWithHmacSHA256AndAES_256

HttpClientUtilsTest$GetProxyUrl.withNoHttpProxyProvidedReturnsNull:235 » IllegalArgument Failure in creating proxy URL. Proxy port is required!

Additional context

enviroment: Oracle Linux

@shawkins
Copy link
Contributor

shawkins commented Jan 3, 2025

The CertUtil logic changed with #6008 - can you try building 7.0?

For the 6.12 release this test should have been relying on the bouncy castle provider, but that doesn't seem to be happening for you.

The HttpClientUtilsTest failure is unrelated. @manusa @rohanKanojia wasn't there some cleanup related to this done in later releases?

@manusa
Copy link
Member

manusa commented Jan 7, 2025

Run the build command:

mvn clean install -pl kubernetes-client-api -DskipTests
mvn clean install -pl kubernetes-client -DskipTests

Why are you only building these modules?

For the kubernetes-client module, you'll need the httpclient-okhttp (for 6.x)
For the kubernetes-client-api module, you'll need the model modules.

I'm not sure how you're managing to build only these modules without building the rest of dependencies.

For the test issues, it seems they might be environment related.

The proxy test might be picking up some environment variable or system property, in this case, we might want to improve the test by clearing any environment variable that might break it (we do similar things for other tests).

The CertUtilsTest might also be affected by your environment.

The HttpClientUtilsTest failure is unrelated. @manusa @rohanKanojia wasn't there some cleanup related to this done in later releases?

I can't recall anything at the moment.

The latest changes are:

As Steven said:

The CertUtil logic changed with #6008 - can you try building 7.0?

Could you also try building in a different environment?

@manusa manusa added the Waiting on feedback Issues that require feedback from User/Other community members label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting on feedback Issues that require feedback from User/Other community members
Projects
None yet
Development

No branches or pull requests

3 participants