Hi, I’ve made a copy of the Sonar Way Java profile using the backup option in the in the quality profiles page. This results in a file I've named java-test.xml. Next, I opened the file in a text editor and changed the name to copy2, like this <name>copy2</name>.
Then I tried to import the profile using Postman with a POST to this URL: ‘localhost:9000/api/qualityprofiles/restore’ and a ‘backup’ parameter pointing to the file I previously exported. Import fails with an error message in Postman
{ "errors": [ {
"msg": "An error has occurred. Please contact your administrator"
}]}
and a stacktrace (java.lang.IllegalStateException: Fail to restore Quality profile backup) in SonarQube’s logs, see image:
Next I tried importing the same java-test.xml file in SonarQube’s management page, using the ‘restore profile’ option on the ‘quality profiles’ tab. This works without errors.
Am I using the correct api call or is something wrong in the api itself?
I’m using version 6.3.1 of the Docker container from https://hub.docker.com/_/sonarqube/
Then I tried to import the profile using Postman with a POST to this URL: ‘localhost:9000/api/qualityprofiles/restore’ and a ‘backup’ parameter pointing to the file I previously exported