I am trying to restore a quality profile on a fresh installation of SonarQube v.5.6.4 over Web API using curl.
In c:\temp I have an exported "Sonar way" profile from running Sonar and I have renamed it to test.xml (inside, the name was also changed to test so that both profiles are "different").
From the c:\temp location, I used the following curl command:
curl -v -X POST -u admin:admin --header "Content-Type: application/xml" "http://localhost:9000/api/qualityprofiles/restore" -d backup=test.xml
The response was:
500 Internal Server Error If you are the administrator of this website, then please read this web application's log file to find out what went wrong.
No matter how I changed the curl-command (with different content-types, with -F paramter, with @ before file name), I could not manage to fix this problem.
Moreover, I checked Sonar logs which look like this:
2017.01.30 14:13:14 ERROR web[rails] /!\ FAILSAFE /!\ Mon Jan 30 14:13:14 +0100 2017 Status: 500 Internal Server Error undefined method `name' for nil:NilClass C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/xml_mini/rexml.rb:29:in `merge_element!' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/xml_mini/rexml.rb:18:in `parse' org/jruby/RubyKernel.java:2227:in `send' C:1:in `parse' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/core_ext/hash/conversions.rb:171:in `from_xml' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:34:in `parse_formatted_parameters' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:11:in `call' file:/C:/bin/sonarqube-5.6.4/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call' C:/bin/sonarqube-5.6.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call' file:/C:/bin/sonarqube-5.6.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails' file:/C:/bin/sonarqube-5.6.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call' file:/C:/bin/sonarqube-5.6.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'
Is there something wrong with version 5.6.4?
Thanks in advance for any feedback.