SonarQube analysis link points to wrong project URL for versions >= 5.2

2,463 views
Skip to first unread message

Michael Rüegg

unread,
Feb 26, 2016, 5:50:42 AM2/26/16
to SonarQube
Hi,

As you all know, SonarQube yields a line like the following after a successful analysis:

INFO: ANALYSIS SUCCESSFUL, you can browse http://SERVER/dashboard/index/PROJECT_KEY


This line was generated by the SonarQube runner 2.5. Unfortunately, the URL is not valid anymore for SonarQube versions >= 5.2 because the URL structure for the project dashboard has changed from http://SERVER/dashboard/index/PROJECT_KEY to http://SERVER/overview?id=ID

Is this a known problem?

The same issue also exists in the SonarQube web UI. If I click on the project name in 5.4 RC1, I get "The requested project does not exist. Either it has never been analyzed successfully or it has been deleted." because it still points to dashboard/index/PROJECT_KEY

Best regards,
Michael





nicolas...@sonarsource.com

unread,
Feb 26, 2016, 11:22:32 AM2/26/16
to SonarQube
Hi Michael,

I think we should split your message in two:

URL change from http://SERVER/dashboard/index/PROJECT_KEY to http://SERVER/overview?id=ID.  Is this a known problem?

There's been some URL changes indeed. But that is handled and I don't see any problem on my side. Let's take https://nemo.sonarqube.org as an example: https://nemo.sonarqube.org/dashboard/index/postgresql redirects to https://nemo.sonarqube.org/overview?id=postgresql :)

"The requested project does not exist. Either it has never been analyzed successfully or it has been deleted." because it still points to dashboard/index/PROJECT_KEY

I don't think it's because of the URL change, which as shown above is actually not an issue. It's much more likely because your project really 'has never been analyzed successfully or it has been deleted', or because of another glitch which you are yet to find (with the URL situation now clarified).

Best regards,
Nicolas

Michael Rüegg

unread,
Feb 26, 2016, 12:12:36 PM2/26/16
to nicolas...@sonarsource.com, SonarQube
Hi Nicolas,

Thanks for your feedback. I can confirm that this was a bug in 5.4 RC1 then. With 5.4 RC2 this seams to have been fixed. 5.3 is also OK.
 
All good :-)

Best regards,
Michael


--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/DLQkGvtZBpg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/4ab14f10-8f60-4c8b-a1be-e6d15f0df617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

starwar...@gmail.com

unread,
Apr 8, 2016, 7:45:12 AM4/8/16
to SonarQube, nicolas...@sonarsource.com
Hi @all


Am Freitag, 26. Februar 2016 18:12:36 UTC+1 schrieb Michael Rüegg:
Thanks for your feedback. I can confirm that this was a bug in 5.4 RC1 then. With 5.4 RC2 this seams to have been fixed. 5.3 is also OK.


At the moment we're facing exactly the same issue with SonarQube 5.4. Our Jenkins builds respectively the Sonar analysis looks like this:

...
13:22:54 [INFO] Analysis report uploaded in 62ms
13:22:54 [INFO] ANALYSIS SUCCESSFUL, you can browse https://xxxxx.yyyyy.zzzzz/dashboard/index/com.jivesoftware.ubs:ubs-sso-plugin
13:22:54 [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
...

But if the link is clicked, SonarQube says as mentioned above: "The requested project does not exist. Either it has never been analyzed successfully or it has been deleted."

But as this analysis is running for nearly two years now, there must be something wrong after the update to the current SonarQube version. On SonarQube itself I can see that the project was analyzed and the report can be viewed without any problem. So the problem is the wrong link created by the Jenkins plugin.

Some details:
SonarQube: 5.4
Jenkins: 1.656
SonarQube Plugin: 2.3
Sonar Maven Plugin: 3.0.1

Please let me know if you need further details.

Kind regards,
Yves

starwar...@gmail.com

unread,
Apr 15, 2016, 1:48:57 AM4/15/16
to SonarQube, nicolas...@sonarsource.com, starwar...@gmail.com
Hi@all


Am Freitag, 8. April 2016 13:45:12 UTC+2 schrieb starwar...@gmail.com:

At the moment we're facing exactly the same issue with SonarQube 5.4.
... 
But if the link is clicked, SonarQube says as mentioned above: "The requested project does not exist. Either it has never been analyzed successfully or it has been deleted."
...  
Some details:
SonarQube: 5.4
Jenkins: 1.656
SonarQube Plugin: 2.3
Sonar Maven Plugin: 3.0.1
 
Updated SonarQube Plugin to 2.4 but the problem still exists. Any ideas on how to solve it? Everybody uses the link on the job page, which leads to the error message. :-(

Any news here?

Simon Brandhof

unread,
Apr 15, 2016, 3:33:53 AM4/15/16
to starwar...@gmail.com, SonarQube, nicolas...@sonarsource.com
Hi Yves,

What's the URL of the dashboard when you view the project online ?

++
--
Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

starwar...@gmail.com

unread,
Apr 15, 2016, 3:51:11 AM4/15/16
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hi Simon,

thx for your response. Details see below.


Am Freitag, 15. April 2016 09:33:53 UTC+2 schrieb Simon Brandhof:
What's the URL of the dashboard when you view the project online ?

URL directly on Sonar dashboard: https://xxxxx.yyyyy.zzzzz/dashboard/index/23412

The plugin is configured with "Server version: 5.3 or higher".

 
++
--
Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

Kind regards,
Yves 

Simon Brandhof

unread,
Apr 15, 2016, 3:56:06 AM4/15/16
to starwar...@gmail.com, SonarQube, nicolas...@sonarsource.com
Do you confirm that https://xxxxx.yyyyy.zzzzz/dashboard/index/com.jivesoftware.ubs%3Aubs-sso-plugin works ? In that case that means that there's an issue with URL escaping in your environment. Is your SonarQube behind a HTTP proxy ?

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/391a3d30-86bc-41d3-9a64-02b1797bc893%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

starwar...@gmail.com

unread,
Apr 15, 2016, 8:26:09 AM4/15/16
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hi Simon


Am Freitag, 15. April 2016 09:56:06 UTC+2 schrieb Simon Brandhof:

No, it works not and that's the problem we have! The jenkins plugin is generating these URLs and they are not working.

If I go to the SonarQube dashboard and hover over the analyzed module, I see a link with some kind of an ID instead of <groupId>:<artifactId> and these links work as expected.
 
 
In that case that means that there's an issue with URL escaping in your environment. Is your SonarQube behind a HTTP proxy ?

Yes I think so but I need to check this in detail with our networking guys.

Kind regards,
Yves

Simon Brandhof

unread,
Apr 16, 2016, 4:58:25 AM4/16/16
to starwar...@gmail.com, SonarQube, nicolas...@sonarsource.com
The problem does not come from the URL displayed in logs but from the web server. 
You should enable tracking of HTTP requests in your browser, for instance with Developer Tools > Network in Chrome, and :
  1. search for your project with the top-right search box and open project. URL should be https://xxx/overview?id=com.jivesoftware.ubs%3Aubs-sso-plugin
  2. replace "overview?id=" by "dashboard/index/". Request should be redirected (302 status).
As you said that you don't have this behaviour, then please send the details of HTTP requests executed during the scenario.
Thanks

starwar...@gmail.com

unread,
Apr 22, 2016, 5:24:29 AM4/22/16
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hi Simon,

thx for your response. 

After digging deeper into this we figured out, that even if we search a project directly on the sonar page, it's created link presented the same error. So your hint regarding a proxy in front of our Sonar installation was inspected in detail and we figured out a misconfiguration there (which was working for years until the change on Sonar itself with one of the last updates). After fixing this, everything works as expected. :-)

Many thx for the hint!

Kind regards,
Yves

Simon Brandhof

unread,
Apr 25, 2016, 3:57:43 AM4/25/16
to starwar...@gmail.com, SonarQube, nicolas...@sonarsource.com
So your hint regarding a proxy in front of our Sonar installation was inspected in detail and we figured out a misconfiguration there (which was working for years until the change on Sonar itself with one of the last updates). After fixing this, everything works as expected. :-)

Good news ! Do you think that this specific proxy configuration deserves to be documented, or at least described in this thread ? It would allow to help people facing the same problem.

Thanks

roman...@fluidtime.com

unread,
Jun 7, 2016, 4:10:00 AM6/7/16
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
as we are experiencing the same issue it would be great if you could share what you've changed here.

roman...@fluidtime.com

unread,
Jun 9, 2016, 3:41:36 AM6/9/16
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com

I've added the bold elements to my existing config:


<VirtualHost *:443>
    ServerAdmin m...@example.com
    ServerName sonar.example.com
   
#... (SSL) config

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
        AllowEncodedSlashes NoDecode
    ProxyPreserveHost on
    ProxyPass / http://localhost:9000/ nocanon

        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-Forwarded-Port "443"

    ErrorLog /var/log/apache2/sonar.example.com-ssl-error.log
    CustomLog /var/log/apache2/sonar.example.com-ssl-access.log common

</VirtualHost>

it works now.

sebasti...@gmail.com

unread,
Jun 14, 2017, 4:14:18 PM6/14/17
to SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hi, I think I'm having the same issue behind nginx proxy.

Any ideas which options should I configure in nginx? The URL: https://my.sonar.com/overview?id=projectid shows a sonarqube page saying the the URL does not exists. Changing "overview" with "dashboard" will show the project, i.e. https://my.sonar.com/dashboard?id=projectid

I can't find any configuration to work. I've set this headers actually:

proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header Proxy "";

Without luck. Is this really related with proxy configuration?

Eric Hartmann

unread,
Jun 15, 2017, 4:07:30 AM6/15/17
to sebasti...@gmail.com, SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hi Sebastian,

If you don't use sonar.web.context.
It seems that the easier way of doing this is to set your configuration proxy without setting the URI (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) :

If proxy_pass is specified without a URI, the request URI is passed to the server in the same form as sent by a client when the original request is processed, or the full normalized request URI is passed when processing the changed URI:

So using something like :

location / {
    proxy_pass http://127.0.0.1;
}

Note the absence of tailing /

Cheers,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Eric HARTMANN | SonarSource

Sebastián Treu

unread,
Jun 15, 2017, 8:45:11 AM6/15/17
to Eric Hartmann, SonarQube, starwar...@gmail.com, nicolas...@sonarsource.com
Hey Eric, thanks for replying :) and yes, that's how I've configured nginx (it's nginx-proxy docker image).

This is actually my full nginx file:

/app # cat /etc/nginx/conf.d/default.conf
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
  default $http_x_forwarded_proto;
  ''      $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
  default $http_x_forwarded_port;
  ''      $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
  default upgrade;
  '' close;
}
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
  default off;
  https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
                 '"$request" $status $body_bytes_sent '
                 '"$http_referer" "$http_user_agent"';
access_log off;
include /etc/nginx/proxy.conf;
server {
    server_name _; # This is just an invalid value which will never trigger on a real hostname.
    listen 80;
    access_log /var/log/nginx/access.log vhost;
    return 503;
}
# my.sonarqube.com
upstream my.sonarqube.com {
                ## Can be connect with "sonarqube_sonarnet" network
            # sonarqube_sonarqube_1
            server 172.18.0.3:9000;
}
server {
    server_name my.sonarqube.com;
    listen 80 ;
    access_log /var/log/nginx/access.log vhost;
    return 301 https://$host$request_uri;
}
server {
    server_name my.sonarqube.com;
    listen 443 ssl http2 ;
    access_log /var/log/nginx/access.log vhost;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
    ssl_prefer_server_ciphers on;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/my.sonarqube.com.crt;
    ssl_certificate_key /etc/nginx/certs/my.sonarqube.com.key;
    add_header Strict-Transport-Security "max-age=31536000";
    include /etc/nginx/vhost.d/my.sonarqube.com;
    location / {
        proxy_pass http://my.sonarqube.com;
    }
}


And files: /etc/nginx/proxy.conf

# HTTP 1.1 support

proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;

# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";


/etc/nginx/vhost.d/my.sonarqube.com

client_max_body_size 20M;
large_client_header_buffers 8 16k;


proxy_pass is just like you said. Also I've tried someghint like: proxy_pass http://my.sonarqube.com$request_uri and a bunch of things I've found googling (like increasing the header buffer) without luck.



To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages