Symptoms
When attempting to set versioned settings via the REST API, the following error occurs:
HTTP 500
{"errors":[{"message":"Error has occurred during request processing, status code: 500 (Internal Server Error).\nDetails: jetbrains.buildServer.server.rest.errors.OperationException: Cannot update versioned settings config. Please select VCS root for project settings\nThis is probably a TeamCity bug. Please report it to TeamCity support with the server debug logs."}]}
Cause
A potential cause is that the payload's schema is incorrect. The correct schema should use vcsRootId as outlined in the TeamCity REST API documentation.
If the payload schema is incorrect, the HTTP 500 response code is also incorrect. The server should return a 400 (see REST: Validate VCS root when versioned settings are enabled).
Resolution
Ensure the payload uses the correct schema. Below is an example of the correct payload format:
PUT /app/rest/projects/{locator}/versionedSettings/config
Request body example:
{
"allowUIEditing":"true",
"buildSettingsMode":"alwaysUseCurrent",
"format":"xml",
"showSettingsChanges":"false",
"storeSecureValuesOutsideVcs":"true",
"synchronizationMode":"enabled",
"vcsRootId":"YourVcsRootId"
}
Refer to the documentation for the correct schema and attributes.
Comments
0 comments
Please sign in to leave a comment.