Unable to open a release in Octopus

Hi,
An issue was brought to my attention.

We are not able to open a particular octopus release . It fails with the below error. However, we can navigate to the deployments of this release on a tenant directly from the overview page.
The other releases for SVR and the other projects works fine. We have not seen similar issues in other releases so far.

image

variableset-Projects-55-s-139-ZRTG8 ” is the project variable snapshot id for the release 4.9.330.1.

Any ideas of what’s going on here?
Please let me know if you need any more information.

Kind regards,
Micheal Power

Hi Micheal,

Thank you for contacting Octopus support. We are sorry you are experiencing this issue.
Was this project cloned, by any chance? We suspect it might be an issue with the duplicate varset ids in the database.
Also, can you try to run a “System Integrity Check” in the Configuration/Diagnostics:

Thank you.
Sergei

Hi @sergei.dubovsky,

Thanks for the reply.
I ran system integrity check and all passed.

image

Not sure if the project was cloned, I will have to get back to you on that.

Kind Regards,
Micheal Power

Thank you for the update.

In a meantime, is it an option to delete and re-create the failing release? Or to update its variables snapshot?

Sergei

It is possible to create another release(4.9.330.2 ) with the same package. But it is not very straightforward. Because now the release (4.9.330.1) has been reached the last environment in the life cycle. As per the process, we need to deploy the new release (4.9.330.2 ) in all other environments in the life cycle before we deploy the new release (4.9.330.2) in the last environment.

We cannot update the variable snapshot through UI because we are not able to open the release.

I see only one row for the below query on Octopus database.
select * from dbo.Release r
where r.ProjectVariableSetSnapshotId = ‘variableset-Projects-55-s-139-ZRTG8’
So I assume there are no duplicate varset ids.

Moreover, we are trying to find the root cause of this issue to avoid this issue in the future.

It may be possible to update the variable snapshot for this release directly via the API.

This script should hopefully do the job.

$ErrorActionPreference = "Stop";

# Define working variables
$octopusURL = "https://youroctourl"
$octopusAPIKey = "API-YOURAPIKEY"
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$projectName = "MyProject"
$releaseVersion = "1.0.0.0"
$channelName = "Default"
$spaceName = "default"

# Get space
$space = (Invoke-RestMethod -Method Get -Uri "$octopusURL/api/spaces/all" -Headers $header) | Where-Object {$_.Name -eq $spaceName}

# Get project
$project = (Invoke-RestMethod -Method Get -Uri "$octopusURL/api/$($space.Id)/projects/all" -Headers $header) | Where-Object {$_.Name -eq $projectName}

# Get channel
$channel = (Invoke-RestMethod -Method Get -Uri "$octopusURL/api/$($space.Id)/projects/$($project.Id)/channels" -Headers $header).Items | Where-Object {$_.Name -eq $channelName}

# Get release
$release = (Invoke-RestMethod -Method Get -Uri "$octopusURL/api/$($space.Id)/projects/$($project.Id)/releases" -Headers $header).Items | Where-Object {$_.Version -eq $releaseVersion -and $_.ChannelId -eq $channel.Id}

# Update the variable snapshot
Invoke-RestMethod -Method Post -Uri "$octopusURL/api/$($space.Id)/releases/$($release.Id)/snapshot-variables" -Headers $header

Hi Paul,

We tried this script using 2 accounts (one was a space manager and the other one was an Octopus administrator).
Unfortunately it failed with below error.

Invoke-RestMethod : The remote server returned an error: (405) Method Not Allowed.
At line:23 char:1
+ Invoke-RestMethod -Method Post -Uri "$octopusURL/api/$($space.Id)/rel …
*+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException*
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand*

This above error was due to the api paging and the api was not pulling all the releases.
I tried updating the script and I get the below error.
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.

I tried with some other release which does not show any issue in the UI and it is working fine. But the POST call fails with an error for the release “4.9.330.1” . :frowning:

Hi @Falcon_Francis,

At this point, the easiest option we have is to ask you for the Octopus DB backup. We understand if that option is not acceptable for you due to privacy/security reasons.
But if that is acceptable, Here is the link for the secure upload.

Please do not send us a Master Key. We will scrub all the sensitive data from the DB before trying to reproduce the issue.

Thank you.
Sergei.

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