Special chars in service name

I’m just getting started using Octopus, and moving some existing service deployments to it. We’ll end up deploying multiple environments to the same server for hosting services so I’ve been using [Environment Name]ServiceName when creating them. This works fine for the first deployment, but will fail on subsequent deployments. Octopus seems to have trouble finding the service, the log says “service doesn’t exist yet…” and then of course an error occurs when trying to create it because it does actually exist.

If I remove the bracket characters it does work as expected. sc.exe doesn’t seem to have issue with the bracket characters, is this an octopus issue that could be fixed or should I just change my naming convention?

the logs go something like this…

The [XYZ]ImportService service does not exist yet

The [XYZ]ImportService service does not exist. It will be created.

[SC] CreateService FAILED 1073:

The specified service already exists.


Thanks for getting in touch. That is annoying, I reproduced the issue, and it looks like it’s a limitation of our code, but the line is only Start-Service $ServiceName. It will need some extra logic to escape the opening square bracket [ along with any others that may cause an issue.

I’ve raised an issue as my testing was painful to try and work out that it required a back tick to escape it (backslash escaping didn’t help). So it’ll take us a little time to create a good fix and test it well, you can follow along with the issue here if you like : https://github.com/OctopusDeploy/Issues/issues/3515

In the mean time, yes please pick a new naming convention that doesn’t use the [ I tested with round brackets and it looks to work fine so (XYZ)ImportService


Thanks a lot for looking into this. I’ll keep an eye out for a patch for this but it’s no big deal to just change the names I’m using.

Thanks again,