Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,205
Community Members
 
Community Events
168
Community Groups

Is the server or the remote agent used for the timestamp of the build log?

Which host time is used for the timstamp in the build logs?

1 answer

1 accepted

1 vote
Answer accepted

Hi @Steve Holzer,

This is how Bamboo behaves according to my recent tests (6.6.1).

  • Build logs are composed by messages from both server and agent
  • The server receives the agent message with agent timestamp and converts to server's timezone and add them to the build log. This means that agents timezones are irrelevant for the build logs but the correct time is important.
  • If either server or agent are not synced, you will probably see some strange behavior like the following:
    simple 17-Dec-2018 15:16:09 Finished task 'SSH Task' with result: Error
    simple 17-Dec-2018 15:16:09 Running post build plugin 'Docker Container Cleanup'
    simple 17-Dec-2018 15:16:09 Running post build plugin 'NCover Results Collector'
    simple 17-Dec-2018 15:16:09 Running post build plugin 'Clover Results Collector'
    simple 17-Dec-2018 15:16:09 Running post build plugin 'npm Cache Cleanup'
    simple 17-Dec-2018 15:16:09 Running post build plugin 'Artifact Copier'
    simple 17-Dec-2018 15:16:09 Finalising the build...
    simple 17-Dec-2018 15:16:09 Stopping timer.
    simple 17-Dec-2018 15:16:09 Build PROJ-PLAN-JOB-17 completed.
    simple 17-Dec-2018 12:22:32 Running on server: post build plugin 'NCover Results Collector'
    simple 17-Dec-2018 12:22:32 Running on server: post build plugin 'Build Hanging Detection Configuration'
    simple 17-Dec-2018 12:22:32 Running on server: post build plugin 'Clover Delta Calculator'
    simple 17-Dec-2018 12:22:32 Running on server: post build plugin 'Maven Dependencies Postprocessor'
    simple 17-Dec-2018 12:22:32 All post build plugins have finished
    simple 17-Dec-2018 12:22:32 Generating build results summary...
    simple 17-Dec-2018 12:22:32 Saving build results to disk...
    simple 17-Dec-2018 12:22:32 Logging substituted variables...
    simple 17-Dec-2018 12:22:32 Indexing build results...
    simple 17-Dec-2018 12:22:32 Finished building PROJ-PLAN-JOB-17.
    (i) In this case the agent time was configured to ~3h in the future (the time was completely off). Agents messages are the first ones.

I hope that clarifies how Bamboo deal with build log timestamps.

Hello Daniel and Happy New Year for you. 

Thanks for the input on the question.  It does raise another question. 

How to determine server from agent messages in the log. 

Some of your example log entries are easy enough to identify as server but how to do this for the whole log?

Hi Steve,

I don't see an easy way to do this. I think that If I had to do that I would probably run a diff between the build log file and the agent build logs at <Bamboo_Agent>/temp/log_spool/<Plan_Storage_Tag>-<Job_Name>-<Build_Number>.log.
e.g. "Agent_6.7.2/temp/log_spool/plan-9273349-JOB-15.log"

All <Plan_Storage_Tag><Job_Name> and <Build_Number> can be found in the build logs when browsing build results.

Let me know if you have more questions on this. If none show up and you find this answer useful, please set this as an accepted answer.

Hi Daniel,

I was afraid of that. We have a non-typical usage of remote agents. We generate the remote agents dynamically for each job. Upon completion of the job the agent is killed and the agent build logs are also removed when this happens. 

I'll accept your answer to my original question and thanks for working on the second question. I'll pursue the question with our TAM.

 

Regards,

Steve Holzer

Thank you @Steve Holzer,

I hope you can find an easy way to do this. Perhaps you could try transferring the log files using a final task on each job. This would always transfer the log results even if the build fails.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events