Error in removing an application from portfolio

In our sonarqube 9.9.1 LTS deployed on Docker we have a portfolio in which we want to remove an application (not a project).

But when we validate Remove in the popup, nothing happens. The firefox dev console show a 404 not found for the call the button does and in the logs we find this line :

[17/Aug/2023:08:05:35 +0000] "POST /api/views/remove_application HTTP/1.1" 404 - "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "AYoChG8/mKtVeMVaAAFR"

I had to do it via an API call : {{SONAR_URL}}/api/views/remove_application?application=calypso%3Aordonnancement_app&portfolio=calypso%3Acalypso_pfo

Is it a know bug ?

1 Like

I’ve found out the (probable) cause : we use a semicolon to separate words in our keys. The same portfolio without a semicolon doesn’t have the problem.

1 Like

Hi @FredericS ,

Are you able to reproduce the scenario? Is the minimal structure to reproduce the issue like this?

  * subportfolio
      * application

I was not able to reproduce your issue. Can you take a screenshot of how the issue was induced?

Hi @Joe

I’m able to reproduce the defect.

I create a simple Portfolio in wich I add 2 applications

MyPortfolio (key=test:myportfolio)

  • App1
  • App2

If i try to remove App1 or App2 or change the branch for the application, I reproduce the bug. I can’t remove the app or change the bug without any return from the web interface.

I see a 404 error in the dev console or the server logs.

In fact the URL called if I edit the portfolio is http://SERVER/project/admin/extension/governance/console?id=test%3Amyportfolio&subPortfolio=test%3Amyportfolio%3Aapp_rdr4-alpha

I don’t see why it contains a subPortfolio.


And this is the headers for the request which have a 404 response.

POST /api/views/remove_application HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
X-XSRF-TOKEN: mkfbok2kmfa2fjttmvkgm6cjoc
Content-Type: application/x-www-form-urlencoded
Content-Length: 41
DNT: 1
Connection: keep-alive
Cookie: _EDITED_

Got it! I was able to replicate your issue. I’ll notify the dev team immediately.

1 Like

We had modified the key of the portfolios for the time being. There’s not hurry to fix it if its difficult.

The same bug on project or applications would have been way harder to workaround.

1 Like

@FredericS : thank you for your patience. Our dev team has confirmed the bug, have a look here: [SONAR-20441] - Jira. There’s no confirmed timeline for implementing the fix, but we appreciate your help in recognizing this issue.

1 Like