Library variable set link not removed (beta01)

To support tenants in previous release I had 7 different projects for different clients which all references same 6 library variable sets.
When now converting to new tenant structure I was cleaning up the old variable sets and removed 5 of them. At the start I got a warning that they were linked to a project, so I had to remove the link first. However, I didnt remove the link in one project (the main project that I want to keep). I was still able to remove the variable sets though. Now I can’t save any variable changes in my main project as it says the referenced variable set does not exist. I dont know how it allowed me to do it, but it is in a faulted state at the moment because it allowed me to remove variable sets that were linked to a project.

Hi Terje,
Its great to see that you have started trying out the new multi-tenancy feature as a replacement to your existing multi-project architecture. Im sorry to hear that you have appear to have hit a bug in the beta build. I have just been able to reproduce a related bug locally and created a github ticket to track its progress. It will likely be included in the upcoming beta002 release in the next week or so.

In the meantime it sounds like you will need to remove the, now non-existent, library variable set Id from the project entity. The simplest way to do that is probably through the Octopus.Client library. As a bit of a sample script that I just threw together here:

Add-Type -Path 'C:\Program Files\Octopus\bin\Octopus.Client.dll'

$baseUri = "http://localhost:8065"
$apiKey = "API-FXFM1BCNSO9RI6SZBODOBTTIPN4"

$projectId = "Projects-12";
$libraryVariableSetId = "LibraryVariableSets-2";

$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $baseUri, $apiKey
$repository = New-Object Octopus.Client.OctopusRepository $endpoint
$project = $repository.projects.Get($projectId)
$projects.IncludedLibraryVariableSetIds.Remove($libraryVariableSetId);
$repository.Projects.Modify($project);

Give this a try and let me know how it goes.
Thanks again for trying out 3.4.0-beta001, we how you enjoy some if its new features, and keep an eye out for the second beta which should include this fix.
Cheers,
Rob

Hi, Thanks for fix. I managed to get around it by removing the references in the Projects table in database yesterday. So I was able to proceed with testing.