We have a step template, let’s call it Deploy Package and it’s used in our project called Reporting as Step 1. Later we added another step, Step 2, using Deploy Package.
We disabled Step 1 and configured Step 2.
Then we go the below error.
We tried updating the Octopus DB to remove the disabled step, but still got the same error.
In the meantime we have cloned the project and that allowed us to continue, but we lost history of deploys.
Thank you for contacting Octopus Support. I’m sorry to hear you ran into this issue.
Generally we don’t recommend editing the Octopus SQL DB as a first step to resolve error messages as there are dependencies and cascaded operations that must happen for most changes to be made. That said, we’ll still do our best to assist with this issue.
I have a few questions/requests to get better context around the issue:
Were any Steps renamed when disabling this Step?
I don’t know the order of how it happened, but a step was disabled and a duplicate step was renamed.
If so, was the renamed Step referenced by Release Versioning?
It’s not referenced by Release Versioning, another step is
Can you describe what change was made in the Octopus SQL DB?
I went to the DB to get the previous version of the json for the deployment steps, and compared with the latest, broken json. I saw that the difference and wanted to bring it back to the previous working item. I’ll upload the Jsons.
Thank you for getting back to me and for providing the requested information as well as the JSON files.
Did you, by chance, have any Channel Version Rules that referenced the Step in question? We have a recent bug that may be applicable as the patch for this doesn’t “heal” the issue, it simply prevents it from happening in the first place.
We can also confirm what’s in the SQL DB via the following query:
SELECT * FROM dbo.Channel WHERE ProjectId = (SELECT Id FROM dbo.Project WHERE Name = 'EXACT_PROJECT_NAME_HERE' and SpaceId = 'Spaces-XX')
Just be sure to replace EXACT_PROJECT_NAME_HERE and Spaces-XX with the appropriate values. For instance, if this is occurring in a Project named Test Project in Spaces-1 (you can see the Space Id your browser’s address bar when viewing the Project), the query would look like this:
SELECT * FROM dbo.Channel WHERE ProjectId = (SELECT Id FROM dbo.Project WHERE Name = 'Test Project' and SpaceId = 'Spaces-1')
If you can run the query above, export the results in .CSV format, then upload that via the previously provided secure link, that would be very helpful in our investigation.
Thank you for the speedy response. It looks like Channels-2743 is the culprit based on what I’m seeing in your .CSV. If you are happy to reset the Channel Version Rule for this Channel, you can do that via the query below.
Please be sure to take a fresh SQL backup and change the ROLLBACK to COMMIT once you are ready:
BEGIN TRAN;
UPDATE dbo.Channel
SET JSON = JSON_MODIFY([JSON],'$.Rules',JSON_QUERY('[]'))
WHERE Id = 'Channels-2743';
ROLLBACK TRAN
Let me know if that works for you once you have a chance to try it.