Bug in API creating release

I run this command on our build server:

octo.exe create-release --server http://localhost:9000 --apikey SECRET --project FieldCap --enableservicemessages --version 3.5.19.24 --deployto Test --progress --tenant Dev3519 --tenanttag FieldCap/3.5.19 --packageversion 3.5.19.24 --deploymenttimeout 03:00:00 --tenant dev

As you can see I explicitly tell it a tenanttag, a package version and even a specific tenant.

But the result of this action is:

[10:46:46]Creating Octopus Deploy release
[10:46:46]Octopus CLI, version 9.1.3
[10:46:46]
[10:46:47]Detected automation environment: "TeamCity/2022.10.2"
[10:46:47]Space name unspecified, process will run in the default space context
[10:46:47]Handshaking with Octopus Server: http://localhost:9000
[10:46:47]Handshake successful. Octopus version: 2022.4.8423; API version: 3.0.0
[10:46:47]Authenticated as: API (a service account)
[10:46:47]Found tenants: Dev3519 (Tenants-1667), Dev (Tenants-362)
[10:46:47]Found environment: Test (Environments-3)
[10:46:47]This Octopus Server supports channels
[10:46:47]Found project: FieldCap (Projects-545)
[10:46:47]Automatically selecting the best channel for this release...
[10:46:48]Building a release plan for Channel 'Default'...
[10:46:48]Finding deployment process...
[10:46:48]Finding release template...
[10:46:48]Selected the release plan for Channel 'Default' - it is a perfect match
[10:46:48]Using version number provided on command-line: 3.5.19.24
[10:46:48]Release plan for FieldCap 3.5.19.24
[10:46:48]Channel: 'Default' (this is the default channel)
[10:46:48]  #   Name          Version     Source           Version rules      
[10:46:48]  --- ------------- ----------- ---------------- -------------------
[10:46:48]  1   Deploy Site   3.5.19.24   User specified   Allow any version  
[10:46:48]
[10:46:48]Creating release...
[10:46:48]Release 3.5.19.24 created successfully!
[10:46:48]Found environment: Test (Environments-3)
[10:46:48]Found tenants: Dev3519 (Tenants-1667), Dev (Tenants-362)
[10:46:49]Deploying FieldCap "3.5.19.24" to: Test for Dev3519 (Guided Failure: Not Enabled)
[10:46:49]Deploying FieldCap "3.5.19.24" to: Test for Dev (Guided Failure: Not Enabled)
[10:46:49]Only progress of the first task (Deploy) will be shown
[10:46:49]Waiting for 2 deployment(s) to complete....

As you can see, 2 deployments were created! It created it for Dev as expected, but also for the tenant named Dev3519.

Hey @rogerversluis,

Thanks for posting your issue to the community, and I’m sorry to hear you’re hitting that unexpected behavior.

I might be misunderstanding here, but it looks like you have the following arguments specified in your create-release command after the --deployto argument:

--tenant Dev3519
--tenant dev

The --tenant Dev3519 argument is a bit earlier in the command, so I’m wondering if maybe that was unintentional.

Because of those two arguments, Octopus is picking up both of those tenants:

[10:46:47]Found tenants: Dev3519 (Tenants-1667), Dev (Tenants-362)

Does that help explain the behavior you’re seeing? Let me know if not!

Best,
Patrick

Hi Patrick, I stand corrected. For some reason there was a custom parameter --tenant defined in the extra options in TeamCity, which wasn’t obvious because it was at the end of the text input! Thanks for pointing that out, saved me a few hours of head scratching!

1 Like

Hey @rogerversluis,

Ah yep, that would do it! I’m glad to hear that helped lead you to figure out the root cause.

Thanks very much for following up with your solution and letting me know - it goes a long way toward helping others in the community.

Best,
Patrick

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