Bad substitution error when running Plan in Bamboo

I'm getting the following error when I try to run tests in Bamboo: /usr/bin/ant: 1: eval: Bad substitution

I've got Jira, Stash, and Bamboo all hooked up together. I also have Bamboo installed. I can do "ant -version" and it shows that ant is installed correctly on the server. I've ensured my ANT_HOME environment variable points to the right place. Ant is installed at "/usr/share/ant" and when I do "echo $ANT_HOME" it returns "/usr/share/ant". I've added "ANT_HOME/bin" to my PATH as well. One thing I have noticed is that the build log in Bamboo does not reflect what my environment variables say in the shell. Is this an issue, and if so how would I go about changing it? Stash is also hosting my repository, and all of the Application Links are pointing to the right place. One more thing to note. When I run the command "ls -al /usr/bin/ant", it returns "/usr/bin/ant -> ../share/ant/bin/ant".

After this Bad Substitution error, there is another error in the build log.

Failing task since return code of [/usr/bin/ant -Djava.io.tmpdir=/opt/atlassian-bamboo-5.7.2/temp/PRED-UT-JOB1 -f build.xml deployEmptyCheckOnly -Dsfdc.username=MYEMAILWASHERE -Dsfdc.password=********zqlYoVSy8ug9sZukIePrpB3DF -Dsfdc.serverurl=${bamboo.sfdc.dev.serverurl}] was 2 while expected 0

I should also note that I am able to run a deployment from the shell, just not through the Bamboo front end.

These two errors may or may not be related. Does anyone know how to fix this error, or have come across this problem before? Any help is greatly appreciated. Thanks.

2 answers

1 accepted

0 vote

Hello Scott,

Please, notice that based on the build log provided you have the following variable declared:

bamboo_sdfc_dev_serverurl='https://login.salesforce.com/'

However, in your Ant task, you are calling ${bamboo.sfdc.dev.serverurl}. Please, notice the following:

sdfc != sfdc

Could you please update your Ant task by calling the as:

${bamboo.sdfc.dev.serverurl}

It is just a mistype you and due to that the substitution is not working.

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

 

 

Yup, it was a typo. Silly error. Thanks for your help, Rafael.

0 vote

Hello Scott,

Thank you for your question.

Since you are running your build on a Linux environment, I would suggest you on running an Script task as per following:

set

This will display all the environment variables and global variables / plan variables you have defined in Bamboo.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Thank you for your quick reply, Rafael. I added a new Script task just before my Ant ask as you suggested. I set the Script Location as Inline, and set the Script body to "set" as you suggested. I ran the new job and it does display values of variables as you said it would. However, this doesn't really resolve my issue. I've put my log into pastebin and have linked it below. http://pastebin.com/uDhTY3va Thank you again for your help.

Thanks again for helping me out with this. Do you have any other ideas of what I could try? Or clarification on what's going on? Thanks.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,827 views 0 6
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