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 -f build.xml deployEmptyCheckOnly -Dsfdc.username=MYEMAILWASHERE -Dsfdc.password=********zqlYoVSy8ug9sZukIePrpB3DF -Dsfdc.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 votes
Accepted answer

Hello Scott,

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


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

sdfc != sfdc

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


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 votes

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:


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. 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
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

237 views 4 1
Join discussion

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