Base solution for your next web application
Open Closed

Cannot create tenant with its own database (internal server error) #10061


User avatar
0
SBJ created
  • What is your product version? 8.7.0./.*.
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .NET Core

Hi,

When trying to create a new tenant with its own connection string, it shows a popup with "internal server error". This does not happen when trying to create one with the host connection string. The specified database connection string is an empty database (no tables), but the error happens when I try it with a database that has tables in it already as well.

Upon debugging TenantManager.cs, it happens specifically when executing _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant)inside CreateWithAdminUserAsync(...).

It happens specifically inside CreatOrMigrateForTenant(...), because it never arrives at the using (...) that follows. I cannot debug this part because it is considered external code. The code hasn't been altered in any way, so it is the one that was provided with version 8.7.0.

When the popup shows up, the database is filled with entities, so it must happen sometime later inside that method, but before the using(...). <br>

// Create tenant database
_abpZeroDbMigrator.CreateOrMigrateForTenant(tenant); // <-- during this the pop-up shows up in the UI and then the next breakpoint at using won't happen

//We are working entities of new tenant, so changing tenant filter
using (_unitOfWorkManager.Current.SetTenantId(tenant.Id))
{
    //Create static roles for new tenant
    ...
}

Any help would be appreciated.

1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SBJ

    Could you check server side log file for error details ? Probably your SQL Server user doesn't have database creation right.