Octopus project not found after updating deployment process

Good morning,

I have updated a deployment process in the UI, and now I am unable to access the project. This project is NOT configured to use the EAP Config-as-Code feature. Using DevTools I am able to see that the API request is returning 404.

image

I’ve also attempted to access aspects of the project using the API, but the same error message is returned in many cases. All endpoints that error return a 404, for example -

  • /api/Spaces-182/projects/Projects-1736
  • /api/Spaces-182/projects/Projects-1736/deploymentsettings
  • /api/Spaces-182/projects/Projects-1736/releases
{
    "ErrorMessage": "The resource '' was not found."
}

Interestingly, I am also unable to list projects using the API when (presumably) the faulty project is in the list of projects to retrieve.

  • /api/Spaces-182/projects?take=10 - Same error as described above
  • /api/Spaces-182/projects?skip=10&take=10 - Works fine as Projects-1736 is not one of the projects returned by the query.

I think I know what the issue is… a step that was being used as the package versioning step for “Use the version number from an included package” was disabled, and now there are no steps with packages in the project. Usually the UI prevents a step from being disabled if it’s used in this way, but on this occasion there was no such warning/error.

One of the API endpoints that I could access was /api/Spaces-182/projects/Projects-1736/deploymentprocesses and I’ve enabled all steps. However, the error still persists.

The trouble though is that I’m unable to change that setting back to “Generate version numbers using a template” as that setting (VersioningStrategy) is managed via the endpoint /api/Spaces-182/projects/Projects-1736, or /api/Spaces-182/projects/Projects-1736/deploymentsettings, both of which are failing.

Is there a way I can fix this issue?

Thanks,
David

Hi @dgard1981,

Thanks for reaching out!
Sorry to hear you’ve run into this issue.

As this is on your cloud instance, do you mind if I run a couple of SQL queries against the database so that we can find out what resource is missing and work with you to correct it?

They’re simple SELECT queries and should cause no disruption to your instance.

Please let me know if this is alright!

Kind Regards,
Adam

Hi Adam,

I’ve literally just managed to fix this. While a GET to /api/Spaces-182/projects/Projects-1703/deploymentsettings didn’t work, my Hail Mary PUT to that endpoint did.

As you can see below, the VersioningStrategy property is now set to use the default Template, rather then a DonorPackage.

I’ve no idea how the UI managed to save the deployment process with the step from DonorPackageStepId - I’ve accidently tried to do it several times and typically a warning appers, but this time it did not.

So thanks for the reply, but happily on this occasion I’ve managed to undo my mistake myself!

{
    "Id": "deploymentsettings-Projects-1736",
    "SpaceId": "Spaces-182",
    "ProjectId": "Projects-1736",
    "ConnectivityPolicy": {
        "SkipMachineBehavior": "None",
        "TargetRoles": [],
        "AllowDeploymentsToNoTargets": true,
        "ExcludeUnhealthyTargets": false
    },
    "DefaultGuidedFailureMode": "EnvironmentDefault",
    "VersioningStrategy": {
        "Template": "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}",
        "DonorPackage": null,
        "DonorPackageStepId": null
    },
    "ReleaseNotesTemplate": null,
    "DefaultToSkipIfAlreadyInstalled": false,
    "DeploymentChangesTemplate": null,
    "Links": {
        "Self": "/api/Spaces-182/projects/Projects-1736/deploymentsettings"
    }
}
1 Like

Hi @dgard1981,

It’s great to see you’ve managed to resolve it, thanks for letting me know!

Typically, when the deployment settings have an issue my first troubleshooting step is to create a blank project and take the deployment settings JSON from the fresh project, modify it to match the broken project and do as you did - place them over the broken project via API PUT.

Hopefully, you don’t run into this issue again but if you do then please let us know, it’s always better to know about issues so that we can work to preventing them.

Kind Regards,
Adam

1 Like