[ https://issues.apache.org/jira/browse/AMBARI-22643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ferenc Schneider updated AMBARI-22643: -------------------------------------- Description: The following curl will result in 500 if post it more than once: {noformat} curl -vvv -u admin:admin -k -H "X-Requested-By:ambari" -X POST https://$AMBARI_SERVER/api/v1/version_definitions -d '{ "VersionDefinition": { "version_url": "http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-235.xml" } }' {noformat} The http response is: {noformat} { "status" : 500, "message" : "An internal system exception occurred: Base url http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0 is already defined for another repository version. Setting up base urls that contain the same versions of components will cause stack upgrade to fail." } {noformat} It would be better, if in this case the http response status would be {noformat}409 - Conflict{noformat} was: The following curl will result in 500 if post it more than once: {noformat} curl -vvv -u admin:admin -k -H "X-Requested-By:ambari" -X POST -d '{ "VersionDefinition": { "version_url": "http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-235.xml" } }' {noformat} The http response is: {noformat} { "status" : 500, "message" : "An internal system exception occurred: Base url http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0 is already defined for another repository version. Setting up base urls that contain the same versions of components will cause stack upgrade to fail." } {noformat} It would be better, if in this case the http response status would be {noformat}409 - Conflict{noformat} > AmbariServer will throw internal server error in case of post existing > version_definition > ----------------------------------------------------------------------------------------- > > Key: AMBARI-22643 > URL: https://issues.apache.org/jira/browse/AMBARI-22643 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.6.0 > Reporter: Ferenc Schneider > > The following curl will result in 500 if post it more than once: > {noformat} > curl -vvv -u admin:admin -k -H "X-Requested-By:ambari" -X POST > https://$AMBARI_SERVER/api/v1/version_definitions -d '{ > "VersionDefinition": { > "version_url": > "http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-235.xml" > } > }' > {noformat} > The http response is: > {noformat} > { > "status" : 500, > "message" : "An internal system exception occurred: Base url > http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0 is > already defined for another repository version. Setting up base urls that > contain the same versions of components will cause stack upgrade to fail." > } > {noformat} > It would be better, if in this case the http response status would be > {noformat}409 - Conflict{noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)