Open Closed

Can't log in as new tenant #1386


User avatar
0
davidc@educlarity.com created
  • ABP Framework version: v4.3.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

I am very frustrated.

I have yet to able to create a new commercial abp.io app, create a new tenant and log in as that new tenant. No errors.

I am very frustrated because this is BASIC functionality that should be DOCUMENTED. This is the second time I had a fundamental, getting started question, and because there wasn't documentation, I've wasted my support allotments on this fundamental stuff.

Please help

--Dave


18 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the steps that you tried? I will try to reproduce the problem.

  • User Avatar
    0
    davidc@educlarity.com created
    1. I created a new MVC/SQL Server EF/Public Website Project
    2. I did Data Migrations
    3. I ran the Web Project
    4. I created a new tenant in the SAAS module, "TEST", "myemail@myemail.com", "mypa$$word"
    5. logged out
    6. Clicked LOG IN
    7. changed tenant to TEST
    8. put in username/email as myemail@myemail.com
    9. put in password as mypa$$word
    10. response message appears is INVALID USERNAME or PASSWORD
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi davidc

    I create a new project that use 4.3.1 and can't reproduce your problem.

    Can you share your app logs?

  • User Avatar
    0
    davidc@educlarity.com created

    Sorry, im not sure how. This textbox limits the amount of text I can copy/paste into here. Please advise, --Dave

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    HI

    Send it to my email. liming.ma@volosoft.com

  • User Avatar
    0
    davidc@educlarity.com created

  • User Avatar
    0
    davidc@educlarity.com created

    log file emailed as requested

    Many thanks,

    --Dave

  • User Avatar
    0
    davidc@educlarity.com created

    I went into the AbpUser table and select *

    It seems as if when the tenant is created, the tenant admin userid/password isn't created in the AbpUser table.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    If you using the new project without any changes, this is not normal.

    Can you check the logs when create a tenant?

  • User Avatar
    0
    davidc@educlarity.com created

    I did. Saw a SQL Server error,

    I emailed you the error part of the logs

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try another database? For example, localdb or another computer.

  • User Avatar
    0
    davidc@educlarity.com created

    this is the same error that numerous other people are receiving.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try another database? For example, localdb or another computer.

    We have confirmed that this is a database problem.

    2021-05-25 00:02:25.621 -04:00 [ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Saas.EntityFrameworkCore.SaasDbContext'.
    Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
     ---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
       at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__169_0(Task`1 result)
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
    ClientConnectionId:318dd45e-1a6a-4adf-a78b-234090768c78
    Error Number:-2,State:0,Class:11
    Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
     ---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
       at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__169_0(Task`1 result)
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
       at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
    ClientConnectionId:318dd45e-1a6a-4adf-a78b-234090768c78
    Error Number:-2,State:0,Class:11
    2021-05-25 00:02:25.712 -04:00 [ERR] Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
     ---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
       at Microsoft.Data.SqlClient.SqlCommand.&lt;&gt;c.&lt;ExecuteDbDataReaderAsync&gt;b__169_0(Task`1 result)
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
       at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
       at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`3.FindAsync(TKey id, Boolean includeDetails, CancellationToken cancellationToken)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.Saas.Tenants.TenantStore.GetCacheItemAsync(Nullable`1 id, String name)
       at Volo.Saas.Tenants.TenantStore.FindAsync(Guid id)
       at SSFMAnalytics.Data.SSFMAnalyticsTenantDatabaseMigrationHandler.MigrateAndSeedForTenantAsync(Guid tenantId, String adminEmail, String adminPassword) in SSFMAnalyticsTenantDatabaseMigrationHandler.cs:line 92
    ClientConnectionId:318dd45e-1a6a-4adf-a78b-234090768c78
    Error Number:-2,State:0,Class:11
    2021-05-25 00:02:25.715 -04:00 [ERR] ---------- Exception Data ----------
    HelpLink.ProdName = Microsoft SQL Server
    HelpLink.ProdVer = 15.00.2000
    HelpLink.EvtSrc = MSSQLServer
    HelpLink.EvtID = -2
    HelpLink.BaseHelpUrl = http://go.microsoft.com/fwlink
    HelpLink.LinkId = 20476
    
  • User Avatar
    0
    m.duecker created

    Hi,

    I had the same issue.

    By default the MS SQL Server will lock entries when they are updated until the transaction is committed. Hence you can create deadlocks that will eventually let your query run into a timeout.

    The option Read Committed Snapshot On can solve this issue as you will always get the latest commit. I changed the settings in my SQL Server and afterwards the creation of tenants works fine.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    @m.duecker Many thanks. 👍

  • User Avatar
    0
    talhazengin created

    I can confirm that the problem still exists and changing the database option "Is Read Committed Snapshot On" does not solve the problem.

    There was no such problem before versions 4.3.* of ABP. What could be the change?

    WE STILL NEED HELP!

  • User Avatar
    0
    talhazengin created

    I see this now :) applying the stuff in below article solves the problem. https://support.abp.io/QA/Questions/1360/Cannot-create-a-new-tenant-after-migrating-to-430

  • User Avatar
    0
    davidc@educlarity.com created

    yep that solved the issue.

    For other people:

    In the Domain project go to <ProjectName>TenantDatabaseMigrationHandler.cs

    under the private async Task MigrateAndseedForTenantAsync method

    // Create database tables if needed using (var uow = _unitOfWorkManager.Begin(requiresNew:** false** /*<- change me to false */, isTransactional: false))

    // Seed data using (var uow = _unitOfWorkManager.Begin(requiresNew: false /*<- change me to false */, isTransactional: true))

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11