HI I’m having issues related to a package I have uploaded to octopus. I can’t delete the package or add any new packages any project that tries to use the package I am referencing gets an error when I try and create a release. I have tried to delete the package from the file system and restart octopus and do reindexes but the package is not removed. The error you get is below:
I get this error when trying to re index the packages:
== Warning: Remove old packages ==
08:09:59 Info | Removing deleted packages.
08:09:59 Info | Could not find the package PackageName on the file system at D:\Octopus\Packages\Spaces-1\feeds-builtin\PackageName\PackageName.9.3.0.zip, it will be removed from the package repository.
08:09:59 Verbose | Deleting package PackageName.9.3.0.zip.
Unhandled error on request: https://octopus.justaftermidnight.io/api/Spaces-1/packages/raw?replace=true b6ef1c159f2540c1b4ab684ccbef98c3 by : Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Server.Web.Api.ModelRestrictionMap.PackageUsages.<>c__DisplayClass1_0.b__2(PackageReference p) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Api\ModelRestrictionMap\PackageUsages.cs:line 30
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func
2 predicate)
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func
2 predicate)
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func
2 predicate)
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.<DistinctIterator>d__64
1.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Octopus.Server.Web.Api.ModelRestrictionMap.PackageRestriction.CheckPermissionInProjects(IndexedPackage model, ISpacePartitionPrincipal principal, IOctopusQueryExecutor queryExecutor, Permission permissionToCheck) at Octopus.Server.Web.Infrastructure.Security.DocumentRestrictions.CompositeAndRestriction
2.CombineWithAnd(Func2 check) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Security\DocumentRestrictions\CompositeAndRestriction.cs:line 44 at Octopus.Server.Web.Infrastructure.Security.DocumentRestrictions.CompositeAndRestriction
2.CombineWithAnd(Func2 check) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Security\DocumentRestrictions\CompositeAndRestriction.cs:line 44 at Octopus.Server.Web.Infrastructure.Security.AccessChecker
1.<>c__DisplayClass13_0.b__0() in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Security\AccessChecker.cs:line 161
at Octopus.Server.Web.Infrastructure.Security.AccessChecker1.CanDelete(TModel model) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Security\AccessChecker.cs:line 158 at Octopus.Core.Security.Permissions.AccessCheckerExtensions.AssertCanDelete[TModel](IAccessChecker
1 accessChecker, TModel model) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\Security\Permissions\IAccessChecker.cs:line 39
at Octopus.Server.Web.Infrastructure.OctopusQueryExecutor.Delete[TDocument](TDocument instance, Nullable`1 commandTimeout) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\OctopusQueryExecutor.cs:line 236
at Octopus.Core.BuiltInFeed.BuiltInPackageIndex.DeletePackage(IndexedPackage package) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\BuiltInFeed\BuiltInPackageIndex.cs:line 35