mblakeashley / spring-hello-world

0 stars 2 forks source link

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 42, column 25 #1

Closed akamalov closed 6 years ago

akamalov commented 6 years ago

Greetings,

Tried to deploy it but got an error in a pipeline. Don't know if it is related to the fact that environment is behind proxy?

Setting up libqdox2-java (2.0~M3-2) ...
Setting up libplexus-component-metadata-java (1.6-2) ...
Setting up libplexus-containers1.5-java (1.6-2) ...
Setting up libsisu-inject-java (0.3.2-1) ...
Setting up libsisu-plexus-java (0.3.2-1) ...
Setting up libwagon2-java (2.10-3) ...
Setting up libmaven3-core-java (3.3.9-3) ...
Setting up libxom-java (1.2.10-1) ...
Setting up maven (3.3.9-3) ...
update-alternatives: using /usr/share/maven/bin/mvn to provide /usr/bin/mvn (mvn) in auto mode
+ cd spring-hello-world/hellospring
+ mvn clean package
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/1.5.9.RELEASE/spring-boot-dependencies-1.5.9.RELEASE.pom
Downloading: https://repo.maven.apache.org/maven2/com/sap/cloud/s4hana/sdk-bom/1.9.2/sdk-bom-1.9.2.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:1.5.9.RELEASE from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 42, column 25
[ERROR] Non-resolvable import POM: Could not transfer artifact com.sap.cloud.s4hana:sdk-bom:pom:1.9.2 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 50, column 25
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project pcf.scp.spring.hello:hellospring:1.0-SNAPSHOT (/tmp/build/c8ae9eb4/spring-hello-world/hellospring/pom.xml) has 2 errors
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:1.5.9.RELEASE from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 42, column 25 -> [Help 2]
[ERROR]     Non-resolvable import POM: Could not transfer artifact com.sap.cloud.s4hana:sdk-bom:pom:1.9.2 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 50, column 25 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Thanks again!!

akamalov commented 6 years ago

Answering my own question. If you're in a proxied environment like me, you need to add proxy information to your mvn clean package

File: https://github.com/mblakeashley/spring-hello-world/blob/master/ci/tasks/maven-build:

mvn clean package -DproxySet=true -DproxyHost=[PROXY_HOST] -DproxyPort=[PROXY_PORT] -DnonProxyHosts=127.0.0.1

Also, if you're deploying it against your local PCF, your unit-tests will fail due to a hardcoded domain information. Update the task file to reflect your domain name and it will go through.

mblakeashley commented 6 years ago

@akamalov Thanks for sharing your findings in regards to the proxy settings.

As for the hardcoding of hostname/url that is on purpose to simulate a ready to go blue-green deployment. This project is intended for a blog post I wrote some time back, I'll update the readme to reflect this. Cheers!

https://www.levvel.io/our-ideas/CI-CD-Going-Stateless-with-Pivotal-Cloud-Foundry

akamalov commented 6 years ago

By the way @mblakeashley, awesome blog. Loved it!!

mblakeashley commented 6 years ago

@akamalov Awesome, glad you enjoyed it!