无法从Ubuntu上的詹金斯到达Sonarqube

时间:2019-04-03 09:30:45

标签: ubuntu nginx sonarqube ssl-certificate sonarqube-scan

我已经在AWS EC2 CentOS实例上安装了以下工具: -Nginx -Sonarqube服务器 -声纳扫描仪 -名为Jenkins的SSL证书 “我的声纳”安装在端口9000上,以下是在本机上安装SSL证书后可访问它的URL。 https://jenkins.net/sonar/

以下是其他详细信息:

nginx.conf

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;

        return 301 https://$host$request_uri;

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

# Settings for a TLS enabled server.

    server {
        listen       443 ssl http2 default_server;
        listen       [::]:443 ssl http2 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        ssl_certificate "/etc/nginx/ssl/jenkins.crt";
        ssl_certificate_key "/etc/nginx/ssl/jenkins.key";
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location /
        {
        proxy_set_header        Host $host:$server_port;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;

        proxy_read_timeout  90;


      # Required for new HTTP-based CLI
      proxy_http_version 1.1;
      proxy_request_buffering off;

    }

        location /nagios{
        proxy_pass http://127.0.0.1:8093/nagios;
        }

        location /sonar{
           proxy_pass http://127.0.0.1:9000/sonar;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

}

Sonarqube服务器配置文件:

#--------------------------------------------------------------------------------------------------
# WEB SERVER
# The default value is root context (empty value).
sonar.web.context=/sonar
# TCP port for incoming HTTP connections. Default value is 9000.
#sonar.web.port=9000

声纳扫描仪配置文件:

sonar.host.url=https://jenkins.net/sonar

我在这里尝试了以下所有事情:

sonar.host.url=http://jenkins.net/sonar
                and
sonar.host.url=http://<my_ip_addr>/sonar

但是在所有情况下,我都面临以下问题:

[CS_Sonar] $ /opt/sonar_scanner/bin/sonar-scanner -Djavax.net.ssl.trustStore=/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.debug=ssl,handshake -Dsonar.host.url=https://jenkins.net/dde/sonar ******** -Dproject.settings=/home/ubuntu/workspace/CS_Sonar/sonar.properties -Dsonar.projectBaseDir=/home/ubuntu/workspace/CS_Sonar
INFO: Scanner configuration file: /opt/sonar_scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/ubuntu/workspace/CS_Sonar/sonar.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 4.15.0-1032-aws amd64
INFO: User cache: /home/ubuntu/.sonar/cache
ERROR: SonarQube server [https://jenkins.net/dde/sonar] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.333s
INFO: Final Memory: 5M/241M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Caused by: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Caused by: unable to find valid certification path to requested target
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

任何人都可以帮忙。谢谢!

0 个答案:

没有答案
相关问题