Pulling existing project settings from .teamcity folder in VCS to new TeamCity Server
I've configured our current TeamCity instance to use Versioned Settings and these have been pushed to the .teamcity folder at the root of our repository.
I'm now configuring a new TeamCity instance and would like to set the VCS root of the _Root project to be my current repo and have it synchronise in all the current settings.
I've configured the VCS on the Root Project, and enabled versioned settings which informs me that the repo contains project definitions and would I like to import them. I choose to import them and this results in me getting the following error message.
Current Status:
[13:16:17]:
Failed to apply changes from VCS to project settings (revision 40715d54dc3d66486e90eaec9d105809dfe0224e): Remove of the project where versioned settings are defined via commit is not supported, you can remove the '<Root project>' project in UI. Please fix the errors in VCS and commit again.
Now the message suggests that I should delete the <Root project>, which doesn't seem correct. I'm guess the issue is that the .teamcity folder already contains a definition for the Root Project and somehow this is conflicting with the new Root project.
Is what I'm trying to achieve here possible?
Please sign in to leave a comment.
Hi Grant,
I cannot reproduce it so far. I've put the root project into version control on one server and imported it on another without any problems. Please check if the .teamcity/_Root/project-config.xml file is present in repository. If it is there and TeamCity still doesn't import settings from VCS, please enable 'debug-versioned-settings' logging preset at Administration > Diagnostics, run the import, and provide teamcity-versioned-settings.logs.
Thanks Dmitry.
The project-config.xml file is not present in the VCS folder structure
After trying again the logs are (NB: I renamed some of project, repo names in the output):
[2018-04-26 16:57:32,787] DEBUG - ngs.ConfigChangesCommitterImpl - Versioned settings are not configured for project <Root project> {internalId=_Root, externalId=_Root}, ignore settings change
[2018-04-26 16:58:38,122] INFO - buildServer.VERSIONED_SETTINGS - Import settings from VCS, project: <Root project> {internalId=_Root, externalId=_Root}, root: "monorepo" {instance id=2, parent internal id=1, parent id=Monorepo, description: "https://github.com/org/repo#refs/heads/master"}
[2018-04-26 17:00:22,927] DEBUG - s.VersionedSettingsUpdaterImpl - Run 'Update settings from VCS, root: "monorepo" {instance id=2, parent internal id=1, parent id=Monorepo, description: "https://github.com/org/repo#refs/heads/master"}, revision: 70b92d33b921e376201162d7817a95cd6941e1d4', temp projects dir C:\TeamCity\temp\generated3899029841276414275configs
[2018-04-26 17:00:22,950] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectOne', remove project dir
[2018-04-26 17:00:22,950] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectTwo', remove project dir
[2018-04-26 17:00:22,951] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectThree', remove project dir
[2018-04-26 17:00:22,951] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectFour', remove project dir
[2018-04-26 17:00:22,952] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectFive', remove project dir
[2018-04-26 17:00:22,952] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectSix', remove project dir
[2018-04-26 17:00:22,952] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectSeven', remove project dir
[2018-04-26 17:00:22,953] INFO - s.VersionedSettingsUpdaterImpl - Project config is not found in new project 'ProjectEight', remove project dir
[2018-04-26 17:00:22,964] WARN - s.VersionedSettingsUpdaterImpl - Cannot remove project where versioned settings are defined, project: <Root project> {internalId=_Root, externalId=_Root}
[2018-04-26 17:00:22,968] WARN - s.VersionedSettingsUpdaterImpl - Failed to generate updated settings for revision 70b92d33b921e376201162d7817a95cd6941e1d4: jetbrains.buildServer.serverSide.impl.projects.ConfigGenerationException: Remove of the project where versioned settings are defined via commit is not supported, you can remove the '<Root project>' project in UI
[2018-04-26 17:00:22,970] DEBUG - s.VersionedSettingsUpdaterImpl - Failed to generate updated settings for revision 70b92d33b921e376201162d7817a95cd6941e1d4
jetbrains.buildServer.serverSide.impl.projects.ConfigGenerationException: Remove of the project where versioned settings are defined via commit is not supported, you can remove the '<Root project>' project in UI
at jetbrains.buildServer.serverSide.impl.versionedSettings.VersionedSettingsUpdaterImpl$MultiProjectVcsConfigGenerator.reportRemovedProjects(VersionedSettingsUpdaterImpl.java:112)
at jetbrains.buildServer.serverSide.impl.versionedSettings.VersionedSettingsUpdaterImpl$MultiProjectVcsConfigGenerator.run(VersionedSettingsUpdaterImpl.java:229)
at jetbrains.buildServer.serverSide.impl.projects.ConfigFilesUpdaterImpl$UpdateConfigs.runGenerator(ConfigFilesUpdaterImpl.java:105)
at jetbrains.buildServer.serverSide.impl.projects.ConfigFilesUpdaterImpl$UpdateConfigs.run(ConfigFilesUpdaterImpl.java:252)
at jetbrains.buildServer.serverSide.impl.projects.PersistTaskImpl.run(PersistTaskImpl.java:7)
at jetbrains.buildServer.serverSide.impl.projects.BackgroundPersisterImpl$RunTask.lambda$run$0(BackgroundPersisterImpl.java:3)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71)
at jetbrains.buildServer.serverSide.impl.projects.BackgroundPersisterImpl$RunTask.run(BackgroundPersisterImpl.java:22)
at jetbrains.buildServer.configuration.FilesWatcher.runActionWithDisabledObserver(FilesWatcher.java:229)
at jetbrains.buildServer.serverSide.impl.projects.BackgroundPersisterImpl$FlushOnDisk.run(BackgroundPersisterImpl.java:21)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71)
at jetbrains.buildServer.util.ExceptionUtil$1.run(ExceptionUtil.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
So I'm guess something is wrong with the original TeamCity server and it not having created the project-config.xml file for each project?
Hi Dmitry,
Any thoughts on why the project-config.xml may be missing?
cheers
Grant.
Looks like you enabled versioned settings in the Kotlin format, but importing it in xml format. Please check if using the same format helps.
Thanks Dmitry - missed that dropdown staring me right in the face! Now working as hoped