Error accessing a project I want to delete

Hi,

Please help, I get an error when trying to access a project and all I want to do is delete it.

I’m on version 2020.5.1 and the project in question is just a test project so it isn’t in use. This is the only project that I’m having problems with.

The project just had two process which were running child projects.

I’m not sure when this would of started and since the last time I access this project, I have changed license, upgraded Octopus server, migrated to a new Windows machine and made a bunch of changes to other projects so a backup restore isn’t an option.

If the easiest thing to do is hack the records out of the SQL database, I’m happy to do but I would like guidance on what tables I should be adjusting.

The error I get is:

Unhandled error on request: GET http://octopus.cx.local:80**/api/Spaces-1/projects/Projects-361/summary 8000003d-0001-fa00-b63f-84710c7967bb by C***** S : Error reading row 1, column 4. Unexpected token while deserializing object: PropertyName. Path ‘Steps[0].Actions[0].Packages[0].AcquisitionLocation’, line 1, position 605…
Compiled reader expression:

(DbDataReader reader, DocumentReaderContext context) =>
{
Type deserializeAsType = Octopus.Core.Model.Projects.DeploymentProcess
context.Column = 0
String temp0 = IIF(reader.IsDBNull(0), null, reader.GetString(0))
context.Column = 1
String temp1 = IIF(reader.IsDBNull(1), null, reader.GetString(1))
context.Column = 2
Boolean temp2 = IIF(reader.IsDBNull(2), default(Boolean), Convert(reader.GetValue(2), Boolean))
context.Column = 3
Int32 temp3 = reader.GetInt32(3)
context.Column = 4
DeploymentProcess deserializedFromJson = context.DeserializeText(reader, 4, deserializeAsType)
context.Column = 5
ReferenceCollection temp5 = Convert(value(Octopus.Core.RelationalStorage.TypeHandlers.UntypedReferenceCollectionTypeHandler).ReadDatabase(reader, 5), ReferenceCollection)
context.Column = 6
String temp6 = IIF(reader.IsDBNull(6), null, reader.GetString(6))
DeploymentProcess result = deserializedFromJson
if (result != null)
{
result.Id = temp0
result.OwnerId = temp1
result.IsFrozen = temp2
result.Version = temp3
result.SpaceId = temp6
}

result

}

Thanks,
Charlie

Hi @charlie.salmon,

Thanks for reaching out.

Did you upgrade from version 3.x or was it a later version?

We have recently noted that there is an issue when upgrading to 2020.5.x from some legacy versions due to some JSON being incorrectly updated.

If this is the case, the best solution at the moment would be to roll back to the previous version by restoring a database backup from before the upgrade and re-installing the previous version of Octopus on the server.
Once that is done and everything is working as expected, upgrading to an earlier version of 2020.x, such as 2020.2.x and then once that upgrade is complete moving on to 2020.5.x should avoid this issue from re-occurring.

Please let me know if that’s the case or we need to dig in a bit further.

Thanks,
Jeremy

Hi @jeremy.miller,

Thanks for replying so quickly.

I upgraded from 2018.8.2 straight to 2020.5.1, all the projects that need to work are OK.

Downgrading would undo hours of work for a project I just want to remove, is there another option?

Thanks,
Charlie

Hey @charlie.salmon,

It’s a long shot but can we try it via API first?

Invoke-RestMethod -Uri http://octopus.cx.local:80**/api/Spaces-1/projects/Projects-361 -Method Delete -Headers @{'X-Octopus-ApiKey'='API-KEY'}

Can you give that a shot and please let me know if it works or if it throws a similar error? We really try to stay away from manual DB changes if at all possible.

Thanks,
Jeremy

Thanks @jeremy.miller for the API suggestion; I do forget about the API sometimes as I use the nice UI 99% of the time.

I used the Swagger UI for the API calls, but that returned the same error.

I’ve overcome this within the database.

While playing around with the API I got the same error when looking at the DeploymentProcess, so I tried adjusting the dbo.DeploymentProcess table in the Octopus SQL database. On testing a new project I spotted it just deletes the records out of this table when the project deletes. I also swapped the steps between two projects and the error followed the processes within the dbo.DeploymentProcess table and not the project.

I’ve overcome getting access to the project via the UI by doing these steps so I could delete it:

  1. Just in case backed upDatabase
  2. Deleted all but one record in the dbo.DeployementProcess for the owner project in question, the only one left had ID ‘deploymentprocess-Projects-361’
  3. Updated the JSON column for this record to {“Steps”:[{}]} which matched a empty projects column.
  4. Then I could access the project via the Octopus UI and I deleted from there and I comfirmed that last dbo.DeployementProcess record I updated got delete.
1 Like

Hi @charlie.salmon,

You’re very welcome!

Thanks for the update and the workaround for people if they find themselves in a similar situation in the future. You’ve done post testing and everything seems to be in working order?

Thanks,
Jeremy

Yep, everything looks OK, I’ve created new projects, added new processes in new and old projects, edited existing process step, created new releases, and all projects are deploying to my build and test environments perfectly.

Thanks again,
Charlie

1 Like

You’re very welcome! Thanks for the confirmation.

I hope you have a great rest of your week and please reach out to us if you hit any bumps in the future.

Best,
Jeremy