GIT_TRACE2 unique value for each agent
Answered
Out team want to log some git work, but all our agents work on one machine and we cannot use global GIT_TRACE2 to log git work before build steps. We tried to push this env. parameter via build and wrote in buildAgent.properties, but it still does not handle by git. How can we get git log file of work which perform by TeamCity agent itself?
Please sign in to leave a comment.
Hello,
Could you please confirm why getting the Git trace might be helpful for you during checkout phase of the build? Do you need to debug how TeamCity agent calls git executable on the agent machine, or do you need to keep trace because of communication with certain remote repository?
I am asking because trace was not tested with the agents logic; there is a chance it would fail during checkout if trace messages would go to stderr. Further on, the easiest method of passing an environment variable to the git subprocess spawned by agent might be either calling it from a custom command-line step, or starting the agent from an environment with the variable set to 1 in the first place (so that agent process in turn will pass it to the git subprocesses).
If you could describe what is this needed for, maybe I could suggest an approach to do that.
Hello,
Sometimes out builds fail with VCS checkout error (Timeouts on different git steps) before build step. We think that it's problem on our side (Network), but we cannot manually reproduce error (And with out scripts). So we decided to use internal git log, which may help us to detect the issue. The ideal way - logging each build. To do this, need to pass special file path to GIT_TRACE2.
Hello!
I would like to suggest to enable VCS debug logging on the agent(s) then: https://www.jetbrains.com/help/teamcity/viewing-build-agent-logs.html#VCS+Debug+Logging
Once you see an issue reproduce, please feel free to populate a request via "Submit a request" (it allows to attach the files in a private manner) and I will look into it.
Yes, we will create VCS report as soon as possible.