cli icon indicating copy to clipboard operation
cli copied to clipboard

Version parameter chokes on values with `\r` in `octopus release deploy`

Open cdhunt opened this issue 3 years ago • 2 comments

I hit an annoying edge case bug.

I have a pipeline that builds some software on Windows and as part of that writes the version string to a text file which I consume in a different job that is running in a Linux container.

> "$build" | Set-Content -Path VERSION.txt

What's weird is I consume this to create the release without issue.

$ octopus release deploy --space Default --project project--version $(cat VERSION.txt) --environment Dev --no-prompt

But when I try to deploy the release, it throws an error.

$ octopus release deploy --space Default --project project --version $(cat VERSION.txt) --environment Dev --no-prompt
Octopus API error: Object reference not set to an instance of an object. []

If I trim any newline characters, it works.

$ octopus release deploy --space Default --project project --version $(cat VERSION.txt|tr -d '\n\r') --environment Dev --no-prompt
Successfully started 1 deployment(s)

cdhunt avatar Oct 19 '22 16:10 cdhunt

Hi @cdhunt

I haven't been able to recreate your issue. Would you be able to confirm that you are still having the issue with the latest CLI version?

❯ cat -e version.txt
1.2.4$
$
❯ octopus release create --project 'project 1' --version $(cat version.txt) --no-prompt
Successfully created release version 1.2.4 using channel Default

View this release on Octopus Deploy: https://localhost/app#/Spaces-1/releases/Releases-603
❯ octopus release deploy --project 'project 1' --version $(cat version.txt) --environment dev --no-prompt
Successfully started 1 deployment(s)

View this release on Octopus Deploy: https://localhost/app#/Spaces-1/releases/Releases-603

benPearce1 avatar Jan 06 '23 06:01 benPearce1

I should have included that the version file is created on a Windows system and the octopus release is executed on a Linux system. I'll try to validate this next week (hopefully).

cdhunt avatar Jan 06 '23 13:01 cdhunt