Recompute portfolio


(Kévin LEMAIRE) #1


We are currently using the 7.3 version of SonarQube with MSSQL 2014.

I had 2433 portfolio, and I wanted to recompute all my portfolio. I click on “Administration -> Configuration -> Portfolio -> Recompute”.

I have an error that tells me:

2018.12.18 09:14:59 Web ERROR [XXX] [o.s.s.w.WebServiceEngine] Fail to process the request http: // xxxx / api / views / refresh
### Error querying database. Cause: The incoming request contains too many parameters. The server supports a maximum of 2100. Reduce the number of parameters and resend the request.
### The error may exist in org.sonar.db.ce.CeQueueMapper
### The error may involve defaultParameterMap
### The error occurred while setting parameters

So I delete portfolios to reach 2099 but still the same error.

Do you know what to do to no longer have the mistake?
Because we can not recompute the portfolio 1 by 1, it will take too much time.

Thanks in advance.


(G Ann Campbell) #2

Hi KevinL,

You appear to be hitting the maximum size of an in-clause in MSSQL.

Let’s back up, though. Why do you want to manually refresh your portfolios? You do know they’re being recalculated automatically after each relevant project and/or sub-portfolios analysis, right?


(Kévin LEMAIRE) #3

Thank you for your reply.

We need to recalculate portfolios because they are created from webservices.
Which means that they are not analyzed directly and therefore it is empty. We have to calculate the portfolio ourselves

(G Ann Campbell) #4


Okay, so let me back up and give you this ticket to follow: SONAR-11596

Now to a workaround. First, it doesn’t matter how your portfolios are created, they’ll automatically be re-calculated when one of their projects or sub-portfolios is re-calculated. So if you have the patience, waiting will get you what you want.

If you don’t have the patience, then I’m afraid you will have to re-calculate individually. You say they’re created with web services. If you’re making individual calls to api/views/create then it seems a simple matter to add a calculation call to your script. If you’re instead creating them by importing the full XML definition, then you can probably accomplish what you want by recalculating just the root(s).


(Colin Mueller) #5

Purely out of curiosity – what is the use case for 2,433 portfolios? How many projects do you have / how are you slicing up groups of projects?

(Kévin LEMAIRE) #6

Thank you, we will do an update right after the create of our batch.

We need a lot of wallet because we have a lot of applications (300+)
But we also have several lots for each application “group” and version.

We have just moved from 5.6 to 7.3 we still need to clean up the views / portfolio but will get + over time.