TW-2796 |
Deleting directory before running build |
|
0
|
|
Every time I run my build (newly created with version 2.1) I get this error:
[10:22:56]: Checking for changes
[10:22:56]: Building in /build/teamcity/agent/work/Server/4.1_Builds
[10:22:56]: Getting project sources
[10:22:57]: Loading changed files from server...
[10:22:57]: Updating directory /build/teamcity/agent/work/Server/4.1_Builds
[10:22:57]: Clean directory /build/teamcity/agent/work/Server/4.1_Builds
[10:22:59]: jetbrains.buildServer.RunBuildException: java.io.IOException: Cannot find build file by path specified in build configuration settings: '/build/teamcity/agent/work/Server/4.1_Builds/test.xml' (absolute path on agent). Please check that specified path is correct.
It seems like TeamCity is getting project sources and then deleting the directory. This same build works fine with version 2.0. I do not have the "clean all files before build" checked, but if I do it appears to do the more correct ordering of clean and then get latest.
I am using Peforce for the VCS and have one vcs root defined for this build. If it matters, I'm not using a specific client but using a custom client mapping with Perforce (the mapping is typed into the edit box in the TeamCity Web UI).
As for the files on disk, I have watched the agent working directory and it seems like the messages above match what is happening on disk. I see new files being gotten from Perforce, and then everything is deleted, and then the build fails because it can't find a file it just deleted.
Environment: Ubuntu Linux
Issue wasresolved
[10:22:56]: Checking for changes
[10:22:56]: Building in /build/teamcity/agent/work/Server/4.1_Builds
[10:22:56]: Getting project sources
[10:22:57]: Loading changed files from server...
[10:22:57]: Updating directory /build/teamcity/agent/work/Server/4.1_Builds
[10:22:57]: Clean directory /build/teamcity/agent/work/Server/4.1_Builds
[10:22:59]: jetbrains.buildServer.RunBuildException: java.io.IOException: Cannot find build file by path specified in build configuration settings: '/build/teamcity/agent/work/Server/4.1_Builds/test.xml' (absolute path on agent). Please check that specified path is correct.
It seems like TeamCity is getting project sources and then deleting the directory. This same build works fine with version 2.0. I do not have the "clean all files before build" checked, but if I do it appears to do the more correct ordering of clean and then get latest.
I am using Peforce for the VCS and have one vcs root defined for this build. If it matters, I'm not using a specific client but using a custom client mapping with Perforce (the mapping is typed into the edit box in the TeamCity Web UI).
As for the files on disk, I have watched the agent working directory and it seems like the messages above match what is happening on disk. I see new files being gotten from Perforce, and then everything is deleted, and then the build fails because it can't find a file it just deleted.
Environment: Ubuntu Linux
Issue wasresolved
Thanks!
Sorry for the confusion.
is it possible to attach logs (now I mean the same logs as in issue description) for the build which runs for some time, more than several seconds?
As I can see from logs
[10:22:57]: Loading changed files from server...
[10:22:57]: Updating directory /build/teamcity/agent/work/Server/4.1_Builds
changes were loaded for 0 seconds it means there were no changes.
And attach please agent logs, they also might contain something useful.
Thanks!
Here is what I did. We have a mostly functional 2.0 system, so I stopped the 2.0 server and started the 2.1 server (after removing all old logs from the server and agent) using the same directories for the .BuildServer and agent working dir and temp dirs and everything.
After starting 2.1, the agent working dir contained all files from VCS because of build running in 2.0 server. I started the build in 2.1 server and it immediately delete the directory and started getting everything from VCS. This seems reasonable.
After getting all from VCS, the build ran and failed "normaly" (due to a quirk in our build process, the first time it gets all from VCS is will fail. Thereafter, everything works fine).
I restarted the build in 2.1 server and saw it immediately delete all files from the agent working directory. One file had been changed by a developer after the previous build, and I saw this file get put into the agent working directory. Build then failed, because the only file in the directory was the one file changed by a developer since the last build.
I then stopped the 2.1 server and grabbed the log files that are attached. You should see both server and agent log files.
You can send it to me by email if you don't want to attach it here.
Thanks!
Please do clean sources for the agent and run the build. It has to get all sources and fail. After this
add system property agent.save.patch=true to the build configuration, change some file in vcs and run it. Loaded changed sources in temp file won't be deleted. Please attach (or send to me) this temp file also. I wont to check if delete working directory command is in patch. (Content of changed file will be inside temp file so please be sure the file does not contain any security information).
Thanks!
I followed the specified procedure, but the patch file was not left on the server. Just to repeat:
1) Do clean sources for the build
2) Run the build and let it fail (takes a while because it gets all from Perforce)
3) Add system property to build configuration called "agent.save.patch" set to value "true"
4) Change a file in Perforce and run the build
After this I do not have a patch file left on the machine. I then left the system property in place and did another build (which gets all files from Perforce again, apparently TeamCity knows that it deleted them) and I watched the patch file grow larger and larger, and then the patch file was deleted.
Here is a screenshot of the system property in the build configuration screen.
It seems we found the problem. As a workaround you can configure perforce client with this mapping and use it instead of mapping. Please let us know if it helps.
Thanks for the help!
Using a normal perforce client instead of specifying the mappings in TeamCity did indeed work around the problem. Thanks.