Bamboo: Restart TC Server via SSH Task

When I run the script from the terminal, ssh'd into my server, stopping and starting TC Server (tcruntime-ctl.sh) works fine. When I launch this script via an SSH task in a Bamboo deployment, I get a 404. Why would the environment be any different? I have checked the paths and the environment variables. Am at a loss.

3 answers

1 accepted

Accepted Answer
0 votes

The issue was the Aspose.Words.lic license file. I changed how we load the license from pointing to a file on the file system to:

class WordToolService {
License license
  @PostConstruct
  private void init() {

  String licenseString = """
<!--<?xml version="1.0" encoding="utf-8"?>-->
<License>
<Data>..</Data>
<Signature>..</Signature>
</License>
""";
InputStream licenseStream = new ByteArrayInputStream( licenseString.getBytes( "utf-8" ))
license = new License()
license.setLicense(licenseStream)
}
}

 

And now it works.

Thanks,

Andy

0 votes

Hello Andy,

Thank you for your question.

There are two things that come to my mind based on the scenario provided:

  1. you have mentioned you are able to run the script tcruntime-ctl.sh from Terminal but not from Bamboo. In the Terminal, which user was running the script tcruntime-ctl.sh? Is this user the same one running Bamboo?
  2. by mentioning 404, I am tending to believe you are running the SSH task in a Bamboo deployment that is located on a different box where the command is intended to. Please, open up the build log generated by your deployment and have a look at its second line:

    simple	13-Feb-2015 17:48:25	Build Deployment of 'release-x' on '[ENVIRONMENT]' started building on agent [AGENT-NAME]
    simple	13-Feb-2015 17:48:25	Build working directory is [bammboo-home]/xml-data/build-dir/[project-plan-key]

    Please, go to "Build working directory" above mentioned and attempt to run the same script (tcruntime-ctl.sh) from Terminal.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Hi Rafael,

Yes, the user account is the same.

To give some more information, the steps I'm taking in the deployment are:

1) SCP the war file to the web server as the specific user. It does make it to the web server ok.

2) SSH the command to the web server to launch the shell script.

The shell script stops the web server (tcruntime-ctl.sh stop), moves the new war.app to the webapps directory, then starts the web server (tcruntime-ctl.sh start).

If I run this script from the web server, it works fine.

If I run this script from the Bamboo deployment, it does not.

One other thing to note. On another environment, we have a very similar deployment to tomcat v7 that is working fine. 

Thank you very much for your help.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 7 hours ago in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

137 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you