Octopus action output variables do not ignore trailing whitespace in action names

They might be a bug or a feature depending on how you look at it. But it certainly caused hours of confusion for me, and thought it would be useful to share my experience.

Current Octopus Version: Download: 2021.1.7595 - Octopus Deploy

I created an output variable in an action step called 'Publish Cert to AWS S3 '. (notice the trailing space).

In the UI this is almost impossible to notice, and certainly a copy/paste issue. In that step I am outputing a variable called ‘Thumbprint’.

So basically I attempted to reference the variable with the octostache variable #{Octopus.Action[Publish Cert to AWS S3].Output.Thumbprint}. This failed… and failed… and failed some more. After about 4 hours of going through docs I copied and pasted the name into the field again and noticed the trailing space. I removed the trailing space and tried again and everything worked.

My “suggestion”, for what that is worth, would be to remove trailing spaces from action names to prevent this issue, or have the octostash variables somehow magically match on trailing whitespace. As a developer I realize what I am saying, so the only thing I would really ask as a must do is to update the documentation to use more real world examples and maybe a blurb as to trailing whitespace in action names that could cause the variables to not make a match.


Kenneth Garza

Hey Kenneth,

Thanks for all of the information. I just checked in latest and you’re right, it’s impossible for you to actually see whitespace at the end of the step name without going in and highlighting and checking for it. The only other way you would see this is if you had been using variable logging which we don’t recommend having on at all times, only when debugging things like this (and even then it may not have been very noticable at a glance).

I’m going to talk to our developers on if this is something we can trim automatically in future versions, or just not allow you to save it with whitespace. If they think it’s best to leave it as it is, we could definitely put some troubleshooting in about it in our documentation.

I’m guessing that was a love-hate moment when you found that it was the whitespace in the step name, I know it would have been for me. I’m sorry to hear it ate up so much of your time.

In case you hadn’t seen it or need it for the future, here is the documentation on variable logging. As it states in the documentation, it’s not advised to leave it on as it bloats logs and can slow down deployments: How to turn on variable logging and export the task log - Octopus Deploy

Please let me know if you have any other questions or concerns.


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.