lowRISC / opentitan

OpenTitan: Open source silicon root of trust
https://www.opentitan.org
Apache License 2.0
2.53k stars 753 forks source link

Error when running verilator simulation in docker environment #23299

Open kidonglee opened 4 months ago

kidonglee commented 4 months ago

Description

Hello, I am trying to run verilator simulation in docker environment. Meanwhile, I got an error related to SSL certification. So, as below, I got certificate from github.com and added it to java. And there is no problem with the test using SSLPoke. However, I still have the problem. Please help. Thanks.

[Add certificates] java -cp ./ InstallCert github.com:443 // and select 2 sudo keytool -exportcert -keystore jssecacerts -storepass changeit -file output.cert -alias github.com-2 sudo keytool -importcert -keystore ${JAVA_HOME}/lib/security/cacerts -storepass changeit -file output.cert -alias github.com-2 java InstallCert github.com:443

[Test connection to github] dev@eda8443d26d6:~/src$ java SSLPoke github.com 443 Successfully connected

[Verilator sim and error log]

dev@eda8443d26d6:~/src$ $REPO_TOP/bazelisk.sh test --test_output=streamed --disk_cache=~/bazel_cache //sw/device/tests:uart_smoketest_sim_verilator
INFO: Invocation ID: 0b814ea8-5e18-48dd-88b1-b03582a2fe5f
INFO: Repository bazel_skylib instantiated at:
  /home/dev/src/WORKSPACE:12:19: in 
  /home/dev/src/third_party/skylib/repos.bzl:15:14: in bazel_skylib_repos
  /home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
  /home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in 
WARNING: Download from https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz failed: class javax.net.ssl.SSLHandshakeException PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: An error occurred during the fetch of repository 'bazel_skylib':
   Traceback (most recent call last):
        File "/home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz] to /home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_skylib/temp11444270604561518003/bazel-skylib-1.5.0.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: /home/dev/src/WORKSPACE:12:19: fetching http_archive rule //external:bazel_skylib: Traceback (most recent call last):
        File "/home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz] to /home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_skylib/temp11444270604561518003/bazel-skylib-1.5.0.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Error computing the main repository mapping: no such package '@bazel_skylib//': java.io.IOException: Error downloading [https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz] to /home/dev/.cache/bazel/_bazel_dev/3d83422381937a86b10787a3f52f4c40/external/bazel_skylib/temp11444270604561518003/bazel-skylib-1.5.0.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

hcallahan-lowrisc commented 2 months ago

Hi @kidonglee,

Sorry to take a while to get back to you. Is this still an issue?

Are you using the OpenTitan development container Dockerfile? If so, as it is derived from Ubuntu I believe you should not have to add any more certificates to allow bazel to work correctly. It might be something to do with your external environment, which is a bit hard for me to debug. For example, are you behind any sort of forwarding-proxy that might require it's own certificate?

Thanks