Step Template caused project page to break

Hi Team,

We experienced a similar issue as this topic.

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.

image

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.

Thanks,
Fausto

Hi @fausto.ruvalcaba,

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:

You may upload the requested files via this secure upload link.

I look forward to hearing back from you.

Best Regards,
Donny

Hi @donny.bell ,

  • 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.

  • Are you able to generate and share a HAR file on the page generating the error message?
    Uploaded

  • Are you able to generate and share a System Diagnostics Report?
    Uploaded

image

Hi @fausto.ruvalcaba,

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.

Best Regards,
Donny

There is a rule that references one of the steps, ID Channels-2743, name Minor Release. I uploaded the CSV.

Hi @fausto.ruvalcaba,

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.

Best Regards,
Donny

We applied the update, but we still got the error. I do see the same reference on Channels-2744, should we update that too?

We ran:

BEGIN TRAN; 
UPDATE dbo.Channel 
SET JSON = JSON_MODIFY([JSON],'$.Rules',JSON_QUERY('[]')) 
WHERE Id in ('Channels-2744', 'Channels-2743'); 
ROLLBACK TRAN

and that worked!

Hi @fausto.ruvalcaba,

Thank you for getting back to me. I’m glad you here you were able to add the additional Channel and get the script to work for you!

Now you are free to set the Channel Version Rules to an applicable Step in this Project as required, just like you would normally.

If there is anything else we can assist with, please let us know.

Best Regards,
Donny

This was great, thanks Donny!

1 Like

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