Hello there,
one from our developer report very weird issue in Octopus. After some modifications of deployment process, error occurred during save operation.
You should be able to copy the JSON from API endpoint in the browser and save it into a text or JSON file.
Also, are there any step templates from your Library associated with this process? If so, could you get a copy of this from Library > Step Templates > (your template) > Overflow menu (3 dots) > Export:
Lastly, can you also provide me with a server log from around the time the save was performed?
Once you have all of that, you can send the files securely to me via this link, and Iâll take a look at it. Weâll continue troubleshooting from there!
Iâm not to able to get this raw JSON, because It was generated by Octopus. Nothing from external sources was send.
Also, are there any step templates from your Library associated with this process? If so, could you get a copy of this from Library > Step Templates > (your template) > Overflow menu (3 dots) > Export
I try to get this logs and send It privately. I also suggest to change a way, how currently logs are aggregated. Personal data(name and surname) shouldnât be log there - just unique database ID. I need to sanitize this values myself.
Also I provide more details:
Project overview is unreachable after removing Standard Deployment step from Deployment Process. Developer also have a chance to change general settings - changing Multi-tenant Deployments options from Allow deployments with or without a tenant to Require a tenant for all deployments. After that actions We cannot load even main deployment process page.
Weâve seen some similar issues appear recently when steps that are being used as part of the versioning strategy are renamed or removed. This results in the step being unable to be found and the project becoming unavailable.
Essentially, the deployment settings of the project have likely become invalid. We do have a script that has been successful in resolving this issue previously.
The scriptâs purpose is to create a new, temporary project for new deployment settings, modify the deployment settings to match the broken project and then PUT them over the top of the broken deployment settings and delete the temporary project.
It should correct the reference to the missing resource; all youâd have to do afterwards is modify the versioning strategy/release creation back to how youâd like it.
Iâll attach it in-line to avoid any e-mail filtering.
To use the script, replace the following variables with values that match your instance, along with the usual API key and Octopus URL:
$spaceId (The space ID of the broken Project - in this case Spaces-1 ) $projectGroupName (Any currently existing project group that exists in Spaces-1 ) $lifecycleName (Default Lifecycle name for Spaces-1 ) $brokenProjectId (The Projects-ID of the broken Project - in this case Projects-281 )
# Create Script Variables
$octopusUrl = "https://OctopusURL"
$octopusAPIKey = "API-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
# Case Specific Variables | Customise Lifecycle Name and Project Group if necessary.
$spaceId = "Spaces-1"
$newProjectName = "Project_For_Template"
$newProjectDescription = "Project created for version template to fix broken references. Will be deleted after."
$projectGroupName = "Default Project Group"
$lifecycleName = "Default lifecycle"
# BROKEN PROJECT ID
$brokenProjectId = "Projects-XX"
# Get Project Group Id
$projectGroup = (Invoke-RestMethod -Method Get "$octopusURL/api/$($spaceId)/projectgroups/all" -Headers $header) | Where-Object {$_.Name -eq $projectGroupName}
# Get Lifecycle Id
$lifeCycle = (Invoke-RestMethod -Method Get "$octopusURL/api/$($spaceId)/lifecycles/all" -Headers $header) | Where-Object {$_.Name -eq $lifecycleName}
# JSON Payload for template project
$jsonPayload = @{
Name = $newProjectName
ProjectGroupId = $projectGroup.Id
LifeCycleId = $lifeCycle.Id
}
# Create new project
$newProject = Invoke-RestMethod -Method Post -Uri "$octopusURL/api/$($spaceId)/projects" -Body ($jsonPayload | ConvertTo-Json -Depth 10) -Headers $header
# Gather deployment settings template
$depTemplate = Invoke-RestMethod -Method Get -Uri "$octopusURL$($newProject.Links.DeploymentSettings)" -Headers $header
# Copy and modify template to match broken project
$newDepSettings = $depTemplate
$newDepSettings.Id = $newDepSettings.Id.replace($newProject.Id, $brokenProjectId)
$newDepSettings.ProjectId = $newDepSettings.ProjectId.replace($newProject.Id, $brokenProjectId)
# Determine deployment settings URL for broken project
$newUrl = $newProject.Links.DeploymentSettings.replace($newProject.Id, $brokenProjectId)
# Upload newly created default deployment settings to broken project
Invoke-RestMethod -Method Put -Uri "$octopusURL$($newUrl)" -Headers $header -Body ($newDepSettings | ConvertTo-Json -Depth 10)
# Delete Template Project
Invoke-RestMethod -Method Delete -Uri "$octopusURL/api/$($spaceId)/projects/$($newProject.Id)" -Headers $header