Base solution for your next web application
Open Closed

Create Tenant with separate db got errors on hosting #3613


User avatar
0
ultimatemm created

Hi,

I tried to create Tenant with separate DB approach but I got errors and my tenant didn't create. Do I need to ask something to hosting provider? Below is log file errors

INFO 2017-07-26 00:02:38,065 [41 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method MyCompanyName.AbpZeroTemplate.MultiTenancy.TenantAppService.CreateTenant (MyCompanyName.AbpZeroTemplate.Application) with arguments (MyCompanyName.AbpZeroTemplate.MultiTenancy.Dto.CreateTenantInput) - ModelState is Valid ERROR 2017-07-26 00:02:38,190 [12 ] Mvc.ExceptionHandling.AbpExceptionFilter - CREATE DATABASE permission denied in database 'master'. System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary2 parameterValues, Boolean closeConnection) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Create() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrate(AbpTenantBase tenant, Action`1 seedAction) at MyCompanyName.AbpZeroTemplate.MultiTenancy.TenantManager.


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

    Hi,

    It seems like you don't have permisison to create a new database, you can ask it to your provider.

    CREATE DATABASE permission denied in database 'master'.

    Thanks.

  • User Avatar
    0
    ultimatemm created

    Hi,

    This is response from hosting provide " Sorry for the inconvenience. As security consideration, the only way to create database is from Control Panel ---> Databases. ". Is there any way around i can create tenant with this approach?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Yes, but you need to manually create the DB (empty) first and then you can use it's connection string for your new tenant.

    Thanks.

  • User Avatar
    0
    ultimatemm created

    Hi ismcagdas,

    Yeah. that is the way I am thinking too. I need to store tenant connection in host table. right? Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, it is stored in AbpTenants table in host database.