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
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 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.
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?
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
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).