TeamCity log issues

Hi, everyone.

We are still using TC 6.5.6 version, and I am running into a couple of snags. Most critical right now are logging problems. I have a project that consumes linux rpm artifacts and deployment scripts from one job, and sends the artifacts to another host where it sends commands to deploy the artifacts. I recently discovered that most of the critical script output is disappearing from the logs, and I have no way of knowing the details of the deployment activity, other than the success status. Earlier jobs from this build did contain activity detail; but I am at a loss to discover the changes that resulted in this. The build step is a linux bash script, and I recently added "-x" on the "shebang" line to capture more detail. That did not help (it does work in a test script in another project.)

One other thing I tried using to capture log activity was the "script" command, but it turns out that is effective for only a single line in the build step!

I also would like to attach the log detail (once it is meaningful) to an email sent in the final build step. I understand the build log can be obtained with %system.teamcity.agent.dotnet.build_id% but I am not able to access this propery when defining the build step. Is there some way to reference a partial log (from a previous step) when defining a following step?

Thanks to anyone for help.

1 comment
Comment actions Permalink

I am beginning to get a clue as to what might be blocking my deployment job output. After encountering yet another (mostly) empty log:

[15:52:52]: [Step 1/2] |                                                      |
[15:52:52]: [Step 1/2] ========================================================
[15:52:53]: [Step 1/2] spawn /bin/bash -x /tmp/ /tmp/ /tmp/ mjaffe
[15:52:53]: [Step 1/2] Process exited with code 0
[15:52:53]: Step 2/2: Command Line

I needed to perform the deployment manually. I entered the commands including some common logging details:

./install.exp  <arg1>  <arg2>  2>&1 | tee install_20121030.log

Lo and behold, after spitting out a bunch of expected output, I suddenly got this:

SnR-mongodb-2.0-62backend.r22353.noarch.rpm                                                                                   100%   53MB  53.1MB/s   00:01    
+ ssh -q -t -t mjaffe@tul1cstsrmgdb1 'sudo rpm -ivh SnR-mongodb-2.0-62backend.r22353.noarch.rpm'
[sudo] for mjaffe:
Preparing...                ######tee: standard output: Resource temporarily unavailable
                                                                                        tee: write error

Evidently expect does not play nicely with bash output redirection. The unfortunate side-effect is that these details were masked by TeamCity failing to pass the error back to the invoking process.

Please sign in to leave a comment.