Can't delete Compan...
 

Can't delete Company  

   RSS

0

I receive this error message in CP: There is no such object on the server.
In the AD the OU is deleted. But still visible in CP. The same issue when trying delete the domains in the same company.

In the Log file i see a problem with the DataReader

Log:

2019-10-14 09:43:20,301 [DEBUG] CloudPanel.CPStaticHelpers - Checking if company is enabled for Exchange
2019-10-14 09:43:20,302 [DEBUG] CloudPanel.CPStaticHelpers - Checking if company is enabled for spam filtering
2019-10-14 09:43:20,354 [DEBUG] CloudPanel.ActiveDirectory.ADUsers - Retrieving the PrincipalContext...
2019-10-14 09:43:20,824 [DEBUG] CloudPanel.Modules.CompaniesModule - Retrieving companies from database
2019-10-14 09:43:20,836 [DEBUG] CloudPanel.Modules.CompaniesModule - Found a total of 10 companies
2019-10-14 09:43:22,617 [DEBUG] CloudPanel.ActiveDirectory.ADUsers - Attempting to retrieve user photo for Administrator@internal.mailprofi.ch
2019-10-14 09:43:34,632 [DEBUG] CloudPanel.Modules.CompaniesModule - Preparing to delete company RII
2019-10-14 09:43:34,635 [DEBUG] CloudPanel.Modules.CompaniesModule - Initializing Active Directory class...
2019-10-14 09:43:34,635 [INFO] CloudPanel.Modules.CompaniesModule - Deleting company from Active Directory. Path OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:34,635 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Preparing to delete OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch.
2019-10-14 09:43:34,635 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Retrieving the DirectoryEntry... Path: OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:34,635 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Directory entry retrieved path is LDAP://hex-dc/OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:34,639 [DEBUG] CloudPanel.Modules.CompaniesModule - Clearing users from database for RII
2019-10-14 09:43:34,641 [DEBUG] CloudPanel.Modules.CompaniesModule - Clearing Exchange contacts for RII
2019-10-14 09:43:34,643 [DEBUG] CloudPanel.Modules.CompaniesModule - Clearing Exchange distribution groups for RII
2019-10-14 09:43:34,645 [DEBUG] CloudPanel.Modules.CompaniesModule - Clearing Domains for RII
2019-10-14 09:43:34,648 [ERROR] CloudPanel.Modules.CompaniesModule - Error deleting company: System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at CloudPanel.Modules.CompaniesModule.<.ctor>b__1_6(Object _)
2019-10-14 09:43:37,902 [DEBUG] CloudPanel.Modules.CompaniesModule - Preparing to delete company RII
2019-10-14 09:43:37,903 [DEBUG] CloudPanel.Modules.CompaniesModule - Initializing Active Directory class...
2019-10-14 09:43:37,903 [INFO] CloudPanel.Modules.CompaniesModule - Deleting company from Active Directory. Path OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:37,903 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Preparing to delete OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch.
2019-10-14 09:43:37,904 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Retrieving the DirectoryEntry... Path: OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:37,904 [DEBUG] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Directory entry retrieved path is LDAP://hex-dc/OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch
2019-10-14 09:43:37,904 [ERROR] CloudPanel.ActiveDirectory.ADOrganizationalUnits - Error deleting organizational unit OU=RII,OU=COM,OU=hosting,DC=internal,DC=mailprofi,DC=ch. Exception: System.DirectoryServices.DirectoryServicesCOMException (0x80072030): There is no such object on the server.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectoryEntry.DeleteTree()
at CloudPanel.ActiveDirectory.ADOrganizationalUnits.Delete(String distinguishedName, Boolean safeDelete)
2019-10-14 09:43:37,905 [ERROR] CloudPanel.Modules.CompaniesModule - Error deleting company: System.DirectoryServices.DirectoryServicesCOMException (0x80072030): There is no such object on the server.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectoryEntry.DeleteTree()
at CloudPanel.ActiveDirectory.ADOrganizationalUnits.Delete(String distinguishedName, Boolean safeDelete)
at CloudPanel.Modules.CompaniesModule.<.ctor>b__1_6(Object _)

@comelfex First I would make sure you are on the latest version but also if you deleted it on the backend then it may have to be removed with SQL management studio.

Share:

Please Login or Register