Please validate views.def against schema at <sonar.host.url>/static/governance/views.xsd

  • SonarQube Enterprise Edition Version 7.9.3 (build 33349)

We’ve been using portfolios successfully for some months now.
Yesterday someone created a new portfolio through the web UI.
For some reason this person entered a description for the portfolio that was 328 characters long.
And SonarQube allowed this person to do so.

Now since then, we are getting this error for most actions we try to do with portfolios:

Could not load views definition file. Please validate views.def against schema at <sonar.host.url>/static/governance/views.xsd

It seems like the xsd available at that URI sets a limit of 256 characters.
<simpleType name="descType">
<restriction base="string">
<maxLength value="256"/>
</restriction>
</simpleType>

We have tried deleting it through the API, and we have tried too what is suggested here (to update the definition by posting a new one with api/views/define) Api/views/list returns Could not load views definition file error

None of them have worked. We keep getting the same error.

Any help or guidance is welcome.

By the way, we believe this is a bug (you can enter a decription longer than 256 char for portfolio and then you break the portfolios feature). Not sure if it was reported earlier.

1 Like

This bug also make basically edit definition portfolio broken. Try to edit other portfolio will raise same error, like sonar loaded all data before rendering it.

1 Like

Hi @dbejar.

I’m very surprised that you were able to create a portfolio with the UI with a description higher than 256, because I’ve tried on my side and it was not possible (The error raised is “description’ length (300) is longer than the maximum authorized (256)”).
After some investigation, I’ve discover that this check has been added in 7.3. Before that version, it was possible to encounter your issue.

Could you please describe to me exactly which button was used to create the portfolio?

Regards

Hi @julienlancelot this was with 7.9.3 so not related with 7.3 version.

The person that introduced such long description was doing so by copy-pasting. Browser was Chrome.

This is where and how the long description was created (not actual text):

Anyway, more than a way to reproduce it, I am looking for a way out: How to revert back this, so we can use portfolios again.