Starts in:
1 DAY
18 HRS
10 MIN
14 SEC
Starts in:
1 D
18 H
10 M
14 S

Activities of "jlavallet"

  • ABP Framework version: v5.3.5
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue:"

I am having the exact same problem as the OP in this post: https://support.abp.io/QA/Questions/1765/Instead-of-opening-edit-popup-modal-screen--how-to-redirect-to-page

I have a razor page called SignUp on the public website that contains a form for a user to sign up for a service offered through our product. When the Save button is clicked, it successfully POSTs to the OnPostAsync handler in my SignUp.cshtml.cs controller. The problem is, no matter what I try, I cannot redirect successfully to my Payment page after the order is created in that handler.

Here is my handler:

  public async Task<IActionResult> OnPostAsync()
  {
    //https://github.com/maliming/reCAPTCHA
    var response = await _siteVerify.Verify(new reCAPTCHASiteVerifyRequest
    {
      Response = Order.Token,
      RemoteIp = HttpContext.Connection.RemoteIpAddress?.ToString()
    });

    if (!response.Success)
    {
      Alerts.Danger("Please check the \"I am not a robot\" checkbox and complete the captcha.");
      return Page();
    }

    var order = await _ordersAppService.CreateAsync(Order);

    //var selfBaseUrl = _configuration["App:SelfUrl"] ?? "~"; // Try 2
    //var payment = selfBaseUrl.EnsureEndsWith('/') + $"Payment?orderId={order.Id}"; // Try 2
    
    var payment = $"/Payment?orderId={order.Id}"; // Try 3

    //var result = RedirectToPage("Payment", new { orderId = order.Id }); // Try 1
    //var result = Redirect(payment); // Try 2
    var result = LocalRedirect(payment); //Try 3 
    
    return result; 
  }

Note that the captcha works just fine, my order is created, and then I actually redirect to the Payment page. That is, my OnGetAsync handler in my Payment.cshtml.cs controller gets called, my order gets looked up and set on my Order property and and then I try to return the Page.

  [HiddenInput]
  [BindProperty(SupportsGet = true)]
  public Guid OrderId { get; set; }

  [BindProperty] public OrderUpdateDto Order { get; set; }


  public async Task<IActionResult> OnGetAsync()
  {
    var order = await _ordersAppService.GetAsync(OrderId);
    Order = ObjectMapper.Map<OrderDto, OrderUpdateDto>(order);

    return Page();
  }

I can step through this method and everything is working, but when it returns, it stays on my SignUp page and does not render my Payment page. As you can see above, I've tried three different ways of redirecting (actually more) and each of them redirect but the rendering my Payment.cshtml page never happens.

Just a note – I can navigate directly to my Payment page by entering /Payment?orderd=… in the address bar of my browser. Everything works great with that page. I'm not getting any kind of error response.

So, what could be going wrong? Why would my SignUp page not redirect fully? Do I need some kind of special JavaScript handler? I've tried playing around with the following code in my SignUp.js file which is included in the script tag on my page:

$(function () {
  console.log('loaded')
  $("#order-form").abpAjaxForm().on('abp-ajax-success', function () {
    //window.location.href = '/Success;
  });

  //$("#order-form").abpAjaxForm().on('abp-ajax-fail', function () {
  //  window.location.href = '/Error';
  //});
});

I could do a client-side redirect, but I really don't want to do that as I might have other clients in the future. Again, why would the redirect not complete?

  • ABP Framework version: v 5.3.5
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue:" We have noticed that the CreateTenant.cshtml, EditTenant.cshtml, CreateUser.cshtml, and EditUser.cshtml files are rendering in strange ways. One example of what we're seeing is the following:

When the Extra Properties are rendered for our New Tenant, and (1) we click the State abp-select, (2) the select expands as expected (albeit without much contrast around its edges to differentiate it from the modal dialog). As long as we have plenty of real estate, the select renders as it should.

However, if the view is constrained, as is shown below, the rendering begins to be problematic:

When the Extra Properties are rendered for our New Tenant, and (1) we click the State abp-select, (2) the select expands at the top of the view.

And when the view is constrained further, as is shown below, the expanded select control is not shown at all:

(1) We click the State abp-select… Nothing is rendered!

What can be done about this?

Also, as is visible in all three screenshots above, the StateId property is rendered as a StateId_Text label and a useless text field.

Why is that?

Can I disable multi-tenancy for the Organizational Unit entity?

I know how to perform queries by using (_dataFilter.Disable<IMultiTenant>()). I created a utility class to do that:

public static class OuHelper
{
  public static async Task<IEnumerable<OrganizationUnit>> GetHostOusAsync(
    IOrganizationUnitRepository ouRepository,
    IDataFilter dataFilter)
  {
    using (dataFilter.Disable<IMultiTenant>())
    {
      return await ouRepository.GetListAsync();
    }
  }
}

but later when I want to do this:

  public async Task HandleEventAsync(EntityCreatedEventData<IdentityUser> eventData)
  {
    var ous = await OuHelper.GetHostOusAsync(_ouRepository, _dataFilter);
    var adminsOu = ous.FirstOrDefault(ou => ou.DisplayName == OrganizationUnitConsts.Admins);
    var agentsOu = ous.FirstOrDefault(ou => ou.DisplayName == OrganizationUnitConsts.Agents);
    var reportersOu = ous.FirstOrDefault(ou => ou.DisplayName == OrganizationUnitConsts.Reporters);

    var user = eventData.Entity;

    if (adminsOu != null)
    {
      var isInAdminOu = await _userManager.IsInOrganizationUnitAsync(user.Id, adminsOu.Id);
      var isInAdminRole = await _userManager.IsInRoleAsync(user, RoleConsts.Admin);

      if (isInAdminOu && !isInAdminRole)
      {
        await _userManager.AddToRoleAsync(user, RoleConsts.Admin);
      }
      else if (!isInAdminOu && isInAdminRole)
      {
        // THIS FAILS
        await _userManager.AddToOrganizationUnitAsync(user.Id, adminsOu.Id);
      }
    }

    if (agentsOu != null)
    {
      var isInAgentOu = await _userManager.IsInOrganizationUnitAsync(user.Id, agentsOu.Id);
      var isInAgentRole = await _userManager.IsInRoleAsync(user, RoleConsts.Agent);

      if (isInAgentOu && !isInAgentRole)
      {
        await _userManager.AddToRoleAsync(user, RoleConsts.Agent);
      }
      else if (!isInAgentOu && isInAgentRole)
      {
        // THIS FAILS
        await _userManager.AddToOrganizationUnitAsync(user.Id, agentsOu.Id);
      }
    }

    if (reportersOu != null)
    {
      var isInReporterOu = await _userManager.IsInOrganizationUnitAsync(user.Id, reportersOu.Id);
      var isInReporterRole = await _userManager.IsInRoleAsync(user, RoleConsts.Reporter);

      if (isInReporterOu && !isInReporterRole)
      {
        await _userManager.AddToRoleAsync(user, RoleConsts.Reporter);
      }
      else if (!isInReporterOu && isInReporterRole)
      {
        // THIS FAILS
        await _userManager.AddToOrganizationUnitAsync(user.Id, reportersOu.Id);
      }
    }
  }

Since it's not my entity and it's built into the Saas module, i can't remove the IMultiTenant interface. Or can I?

The desired behavior is for the Organizational Units to be application scoped and not tenant scoped.

FYI- I am using the commercial module.

  • ABP Framework version: v 5.3.5
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

NOTE: SQL query omitted because Cloudflare thinks I am doing SQL injection and keeps blocking my post!

2023-01-30 13:33:20.755 -06:00 [ERR] Failed executing DbCommand (30,014ms) [Parameters=[@__ef_filter__p_0='?' (DbType = Boolean), @__id_0='?' (DbType = Guid)], CommandType='"Text"', CommandTimeout='30']
*[Omitted SQL was querying the SaasTenants table]*
2023-01-30 13:33:20.781 -06: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__188_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(AsyncEnumerator enumerator, 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:76fa3bd3-3eac-4581-93ee-466bddd36e60
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__188_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(AsyncEnumerator enumerator, 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)
ClientConnectionId:76fa3bd3-3eac-4581-93ee-466bddd36e60
Error Number:-2,State:0,Class:11
2023-01-30 13:33:20.784 -06: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.<>c.<ExecuteDbDataReaderAsync>b__188_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(AsyncEnumerator enumerator, 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 BlueSpot.Data.BlueSpotTenantDatabaseMigrationHandler.MigrateAndSeedForTenantAsync(Guid tenantId, String adminEmail, String adminPassword) in D:\Century\Internal\BlueSpot\BlueSpot\src\BlueSpot.Domain\Data\BlueSpotTenantDatabaseMigrationHandler.cs:line 107
ClientConnectionId:76fa3bd3-3eac-4581-93ee-466bddd36e60
Error Number:-2,State:0,Class:11
2023-01-30 13:33:20.788 -06:00 [ERR] ---------- Exception Data ----------
HelpLink.ProdName = Microsoft SQL Server
HelpLink.ProdVer = 15.00.2095
HelpLink.EvtSrc = MSSQLServer
HelpLink.EvtID = -2
HelpLink.BaseHelpUrl = https://go.microsoft.com/fwlink
HelpLink.LinkId = 20476
  • Steps to reproduce the issue:"

I am getting the above exception when I attempt to create a tenant. From the UI perspective, the tenant is created successfully - no error messages and the new tenant appears in the list - but the tenant admin account is not created. Strangely, this works just fine on my development machine.

Given that the problem seems to be a command timeout, I have tried setting the command timeout to something like 5 minutes using the connection string:

{
 "ConnectionStrings": {
   "Default": "Server=SQL-SERVER-VM;Initial Catalog=BlueSpot;Uid=BlueSpotUser;Pwd=######;Command Timeout=300"
 },
 ...
}

That does increase the command timeout - the log error message shows a command timeout of '300' instead of '30' - but the result is the same, albeit very delayed.

2023-01-30 14:56:08.000 -06:00 [ERR] Failed executing DbCommand (300,037ms) [Parameters=[@__ef_filter__p_0='?' (DbType = Boolean), @__id_0='?' (DbType = Guid)], CommandType='"Text"', CommandTimeout='300']

During this long delay I tried to query the [SaasTenants] table. The query did not complete until the original request timed out.

That was strange. I thought maybe I needed to configure MARS. So I gave that a try:

{
  "ConnectionStrings": {
    "Default": "Server=SQL-SERVER-NDR;Initial Catalog=BlueSpot.Dev;Uid=BlueSpotUser;Pwd=#BS#bs#;Command Timeout=300;MultipleActiveResultSets=True"
  },
  ...
}

Same result. No difference. What could be happening? Why does it work when I run locally?

FYI - I do have some tenant data seeding code.

Here is my SaasDataSeedContributor:

namespace BlueSpot.Saas;

public class SaasDataSeedContributor : IDataSeedContributor, ITransientDependency
{
  private readonly ICurrentTenant _currentTenant;
  private readonly IEditionDataSeeder _editionDataSeeder;
  private readonly IOrganizationUnitDataSeeder _ouDataSeeder;
  private readonly ITenantDataSeeder _tenantDataSeeder;

  public SaasDataSeedContributor(
    IEditionDataSeeder editionDataSeeder,
    IOrganizationUnitDataSeeder ouDataSeeder,
    ITenantDataSeeder tenantDataSeeder,
    ICurrentTenant currentTenant)
  {
    _editionDataSeeder = editionDataSeeder;
    _ouDataSeeder = ouDataSeeder;
    _tenantDataSeeder = tenantDataSeeder;
    _currentTenant = currentTenant;
  }

  [UnitOfWork]
  public virtual async Task SeedAsync(DataSeedContext context)
  {
    using (_currentTenant.Change(context?.TenantId))
    {
      await _editionDataSeeder.CreateStandardEditionsAsync();
      await _ouDataSeeder.CreateOrganizationUnitsAsync();
      await _tenantDataSeeder.CreateTenantAsync();
    }
  }
}

And here is my ITenantDataSeeder implementation:

namespace BlueSpot.Saas;

public class TenantDataSeeder : ITenantDataSeeder, ITransientDependency
{
  private readonly ICurrentTenant _currentTenant;
  private readonly ILocalityDataSeeder _localityDataSeeder;
  private readonly ILogger&lt;TenantDataSeeder&gt; _logger;
  private readonly IPhotoDataSeeder _photoDataSeeder;
  private readonly IRejectionReasonDataSeeder _reasonDataSeeder;

  private readonly IRoleDataSeeder _roleDataSeeder;
  private readonly IStateDataSeeder _stateDataSeeder;
  private readonly IViolationStatusDataSeeder _statusDataSeeder;
  private readonly IUserDataSeeder _userDataSeeder;
  private readonly IViolationDataSeeder _violationDataSeeder;

  public TenantDataSeeder(
    IStateDataSeeder stateDataSeeder,
    IRejectionReasonDataSeeder reasonDataSeeder,
    IViolationStatusDataSeeder statusDataSeeder,
    IRoleDataSeeder roleDataSeeder,
    IUserDataSeeder userDataSeeder,
    IPhotoDataSeeder photoDataSeeder,
    IViolationDataSeeder violationDataSeeder,
    ILocalityDataSeeder localityDataSeeder,
    ICurrentTenant currentTenant,
    ILogger&lt;TenantDataSeeder&gt; logger)
  {
    _stateDataSeeder = stateDataSeeder;
    _reasonDataSeeder = reasonDataSeeder;
    _statusDataSeeder = statusDataSeeder;
    _roleDataSeeder = roleDataSeeder;
    _userDataSeeder = userDataSeeder;
    _photoDataSeeder = photoDataSeeder;
    _violationDataSeeder = violationDataSeeder;
    _localityDataSeeder = localityDataSeeder;
    _currentTenant = currentTenant;
    _logger = logger;
  }

  public async Task CreateTenantAsync()
  {
    try
    {
      await _stateDataSeeder.CreateStatesAsync();
      await _reasonDataSeeder.CreateRejectionReasonsAsync();
      await _statusDataSeeder.CreateViolationStatusesAsync();
      await _roleDataSeeder.CreateRolesAsync();
      await _userDataSeeder.CreateUsersAsync();
      await _photoDataSeeder.CreatePhotosAsync();
      await _violationDataSeeder.CreateViolationsAsync();
      await _localityDataSeeder.CreateLocalitiesAsync();
    }
    catch (ApplicationException e)
    {
      _logger.LogException(e, LogLevel.Warning);
    }
  }
}

As you can see, there's a lot going on when a tenant is created. But I do not understand why it is timing out. Please advise. Do you see something wrong?

  • ABP Framework version: v 5.3.5
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
Volo.Abp.Http.Client.AbpRemoteCallException: Internal Server Error
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.ThrowExceptionForResponseAsync(HttpResponseMessage response)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync(ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments)
   at Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies.AbpApplicationConfigurationClientProxy.GetAsync()
   at Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.<GetAsync>b__14_0()
   at Volo.Abp.Caching.DistributedCache`2.GetOrAddAsync(TCacheKey key, Func`1 factory, Func`1 optionsFactory, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
   at Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.GetAsync()
   at Volo.Abp.AspNetCore.Mvc.Client.RemoteLanguageProvider.GetLanguagesAsync()
   at Microsoft.AspNetCore.RequestLocalization.DefaultAbpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync()
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
  • Steps to reproduce the issue:"

This is occurring when I run the Web project on my development machine – it does not occur in production. I have been using multiple startup projects. I thought it might be a timing thing. However, I ran the IdentityServer project and the HttpApi.Host first and I still got this problem when I ran the Web project. Please advise. There are no exceptions in the HttpApi.Host log.

  • ABP Framework version: v 5.3.5
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

 D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.DbMigrator\bin\Release\net6.0\publish master ≡  ?6 ~10 -30 ➜ .\BlueSpot.DbMigrator.exe [15:26:47 INF] Started database migrations... [15:26:47 INF] Migrating schema for host database... [15:26:51 ERR] Failed executing DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CREATE TABLE [AbpAuditLogs] ( [Id] uniqueidentifier NOT NULL, [ApplicationName] nvarchar(96) NULL, [UserId] uniqueidentifier NULL, [UserName] nvarchar(256) NULL, [TenantId] uniqueidentifier NULL, [TenantName] nvarchar(64) NULL, [ImpersonatorUserId] uniqueidentifier NULL, [ImpersonatorUserName] nvarchar(256) NULL, [ImpersonatorTenantId] uniqueidentifier NULL, [ImpersonatorTenantName] nvarchar(64) NULL, [ExecutionTime] datetime2 NOT NULL, [ExecutionDuration] int NOT NULL, [ClientIpAddress] nvarchar(64) NULL, [ClientName] nvarchar(128) NULL, [ClientId] nvarchar(64) NULL, [CorrelationId] nvarchar(64) NULL, [BrowserInfo] nvarchar(512) NULL, [HttpMethod] nvarchar(16) NULL, [Url] nvarchar(256) NULL, [Exceptions] nvarchar(max) NULL, [Comments] nvarchar(256) NULL, [HttpStatusCode] int NULL, [ExtraProperties] nvarchar(max) NULL, [ConcurrencyStamp] nvarchar(40) NULL, CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id]) ); Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'AbpAuditLogs' in the database. at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at Microsoft.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, Boolean isInternal, String endMethod) at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult) at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) at BlueSpot.EntityFrameworkCore.EntityFrameworkCoreBlueSpotDbSchemaMigrator.MigrateAsync() in D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.EntityFrameworkCore\EntityFrameworkCore\EntityFrameworkCoreBlueSpotDbSchemaMigrator.cs:line 40 at BlueSpot.Data.BlueSpotDbMigrationService.MigrateDatabaseSchemaAsync(Tenant tenant) in D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.Domain\Data\BlueSpotDbMigrationService.cs:line 103 at BlueSpot.Data.BlueSpotDbMigrationService.MigrateAsync() in D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.Domain\Data\BlueSpotDbMigrationService.cs:line 60 at BlueSpot.DbMigrator.DbMigratorHostedService.StartAsync(CancellationToken cancellationToken) in D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.DbMigrator\DbMigratorHostedService.cs:line 41 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at BlueSpot.DbMigrator.Program.Main(String[] args) in D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.DbMigrator\Program.cs:line 35 at BlueSpot.DbMigrator.Program.<Main>(String[] args) ClientConnectionId:df8ce6da-e222-4fc1-a5d7-9c800aad5d1f Error Number:2714,State:6,Class:16  15:26:55  ﮫ 45.824s   D:\Century\Internal\BlueSpot\BlueSpotWorking\src\BlueSpot.DbMigrator\bin\Release\net6.0\publish master ≡  ?6 ~10 -30 ➜

  • Steps to reproduce the issue:"

I decided start afresh with a new database and as I am still in the early phases of development I decided to reset my migrations.

  1. I first deleted my Local DB database.
  2. Then I deleted the Migrations folder and the TenantMigrations folder in my EntityFrameworkCore project.
  3. After deleting these folders, I ran the DbMigrator using Visual Studio by right clicking on the BlueSpot.DbMigrator project and selecting Debug > Start New Instance. The migration started and ran for a bit and then generated the error above.
  4. I decided to try it from the command line, so I published to a folder and then navigated into that folder to run the BlueSpot.DbMigrator.exe. I got the same error message.

My intention is to use a shared host/tenant database and my suspicions are that the tenant database initial migration is also being run. Both initial migrations have code to create the ABP tables. The first table and each migration is AbpAuditLogs. It sure looks like it's trying to do the table creation a second time without regard to the existing table.

Why is this happening, and what can I do about it?

  • ABP Framework version: v 5.3.5

  • UI type MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Steps to reproduce the issue: I am replying to your message from a year ago because I have returned to this project and I’m still trying to work out the reason why I’m having trouble with the custom login solution. I have zipped up a project with two files added to the IdentityServer project. I believe the issue is that all the examples I have found are for the blended solution and not the tiered solution. Could you look at the attached – specifically the code in the AbpTest.IdentityServer’s Pages\Account folder that I added and suggest how to implement this for the tiered solution. AbpTest.zip

Thanks, From: ABP <noreply@abp.io>  Sent: Wednesday, February 16, 2022 6:42 PM Subject: Problem implementing Custom Login Model (#2572) Answered by maliming. — hi You can also send me your project and I'll download and check for issues. liming.ma@volosoft.com

You are receiving this because you are subscribed to this question. Do not reply to this email. Click here to view #2572 in browser.

  • ABP Framework version: v5.3.0

  • UI type:Blazor

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): Microservices

  • Exception message and stack trace:

PowerShell 7.2.4
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

Loading personal and system profiles took 516ms.
 passp    ~    ﮫ0ms⠀   abp suite update --p                                   pwsh   100  09:30:32 
[09:31:26 INF] ABP CLI (https://abp.io)
[09:31:27 INF] Version 5.3.0 (Stable)
[09:31:27 INF] Updating ABP Suite to the latest preview version...
Tool 'volo.abp.suite' was successfully updated from version '5.2.2' to version '5.3.0'.
 passp    ~    ﮫ23.854s⠀   abp suite                                                                             pwsh   100  09:31:45 
[09:33:41 INF] ABP CLI (https://abp.io)
[09:33:41 INF] Version 5.3.0 (Stable)
Starting Suite v5.3.0 ...
Opening http://localhost:3000
Press Ctrl+C to shut down.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated uppy@1.24.0: @uppy/image-editor was missing from package.json, fixed in v1.24.1
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 510 packages, and audited 511 packages in 50s

11 packages are looking for funding
  run `npm fund` for details

24 vulnerabilities (5 moderate, 16 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 411 packages, and audited 412 packages in 30s

11 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (2 moderate, 12 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 409 packages, and audited 410 packages in 23s

11 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (2 moderate, 11 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web-public\src\PWADC.GoRPMS.PublicWebGateway/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web-public\src\PWADC.GoRPMS.PublicWebGateway\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_42_57_122Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web\src\PWADC.GoRPMS.WebGateway/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web\src\PWADC.GoRPMS.WebGateway\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_02_325Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\administration\src\PWADC.GoRPMS.AdministrationService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\administration\src\PWADC.GoRPMS.AdministrationService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_07_481Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\identity\src\PWADC.GoRPMS.IdentityService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\identity\src\PWADC.GoRPMS.IdentityService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_12_615Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_17_751Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.Web/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.Web\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_22_930Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\saas\src\PWADC.GoRPMS.SaasService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\saas\src\PWADC.GoRPMS.SaasService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_27_869Z-debug-0.log

  • Steps to reproduce the issue:"

I am running into an issue after using the ABP Suite to generate a microservices solution. During the generation of the solution, I get several errors that indicate that their is no package.json in several of the projects. I have confirmed that these files are missing. I have tried to generate the solution using both ABP Suite v 5.2.2 and ABP Suite v 5.3.0 after upgrading ABP to v 5.3.0 (it should be noticed that I had to use the preview flag to force ABP Suite to upgrade to v5.3.0).

See my Discord post: https://discord.com/channels/951497912645476422/953000230142496789/987375732621717646

ABP Framework version: v5.2 UI type: Blazor DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): Microservice Exception message and stack trace:

Either:

AbpException: Could not find the bundle file '/libs/abp/core/abp.css' for the bundle 'Lepton.Global'! Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService<TTagHelper, TService>.ProcessAsync(TagHelperContext context, TagHelperOutput output) Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, int i, int count) …

Or:

AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception) System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions) System.Net.Security.SslStream.ForceAuthenticationAsync<TIOAdapter>(TIOAdapter adapter, bool receiveFirst, byte[] reAuthenticationData, bool isApm) System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, bool async, Stream stream, CancellationToken cancellationToken)

Show raw exception details HttpRequestException: The SSL connection could not be established, see inner exception. System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, bool async, Stream stream, CancellationToken cancellationToken) System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request) System.Threading.Tasks.TaskCompletionSourceWithCancellation<T>.WaitWithCancellationAsync(CancellationToken cancellationToken) System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken) System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, bool async, CancellationToken cancellationToken) System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, bool disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync(ClientProxyRequestContext requestContext)

Show raw exception details AbpRemoteCallException: An error occurred during the ABP remote HTTP request. (The SSL connection could not be established, see inner exception.) See the inner exception for details. Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync(ClientProxyRequestContext requestContext) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync<T>(ClientProxyRequestContext requestContext) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync<T>(string methodName, ClientProxyRequestTypeValue arguments) Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies.AbpApplicationConfigurationClientProxy.GetAsync() Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.<GetAsync>b__14_0() Volo.Abp.Caching.DistributedCache<TCacheItem, TCacheKey>.GetOrAddAsync(TCacheKey key, Func<Task<TCacheItem>> factory, Func<DistributedCacheEntryOptions> optionsFactory, Nullable<bool> hideErrors, bool considerUow, CancellationToken token) Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.GetAsync() Volo.Abp.AspNetCore.Mvc.Client.RemoteLanguageProvider.GetLanguagesAsync() Microsoft.AspNetCore.RequestLocalization.DefaultAbpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync() Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Steps to reproduce the issue:

Admittedly I am new to microservices, Docker, WSL, NPM, and Tye. My development experience has been with tiered MVC deployed to IIS. But I have carefully followed the microservices template getting started guide (which still refers to a up.ps1 file instead of the run-tye.ps1 file) and I cannot get the projects to work when accessed.

I have executed the run-tye.ps1 file. Dependencies seemed to be downloaded and the apps and services started.

Upon encountering the certificate error, I tried multiple things offered on stack overflow including the the following:

  • Running etc\dev-cert\create-certificate.ps1
  • Running dotnet dev-certs https --clean
  • Running dotnet dev-certs https --trust
  • Copying the certificate to the Trusted Route Certification Authorities > Certificates folder in the Certificate Manager
  • Restarting several times
  • Abandoning the Tye configuration and setting up multiple startup projects in Visual Studio 2022 and trying to run the apps and services that way

None of these things have helped resolve the certificate error. I am performing all these actions on a brand-new laptop so this is the first solution I have tried to work with on this machine.

As far as the AbpException: Could not find the bundle file '/libs/abp/core/abp.css' for the bundle 'Lepton.Global'! goes, I have tried the following:

  • Running yarn and abp install-libs in the root directory.

Neither of these two commands solved the problem, though the yarn command did download some packages. The abp install-libs command resulted in a warning that I did not have NPM Installed though I have confirmed that I do have it installed by running npm -v right after the warning. Unfortunately I did not think about This at first and so I uninstalled and reinstalled Node and played with my path for a couple of hours thinking that this was part of the problem.

So I am in a bit of a loss at this point. What should I try to do next to resolve these two issues?

Thank you.

PS:Just a few more details:

  • I do have Docker Desktop installed
  • I am using the Alpine distro
  • I have not done any configuration of Alpine other than installing it through the Microsoft Store
  • I have gone to Settings > Resources > WSL Integration in the Docker Desktop application and Enabled integration with Alpine
  • I have run wsl.exe --set-default Alpine (I've lost my page describing this but I think that is the proper command)
Please scroll to the bottom for updates!
  • ABP Framework version: v5.1.3

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace: Line 29 (see attached image): 'LoginModel' does not contain a constructor that takes 3 arguments. Line 35, 47, 48, 60, and 61: Cannot resolve the symbol 'LoginInput'.

  • Others appear to be the result of subclassing the wrong base class.

  • Steps to reproduce the issue: I have been trying to override the login page to implement the ideas expressed in these posts:

    https://community.abp.io/posts/hide-the-tenant-switch-of-the-login-page-4foaup7p https://community.abp.io/articles/how-to-customize-the-login-page-for-mvc-razor-page-applications-9a40f3cd

I have been especially trying to follow the second article since it is coming from ABP. Because I am using the commercial product, it looks like I don't have access Volo.Abp. Account.Web or it is not available because that namespace has been replaced. I feel like I am probably missing a reference. Please advise.

UPDATE 2022/02/14

I was able to get my code to compile my borrowing the CustomLoginModel class from the abp-samples/SignInWithoutSpecifyingTenant project. This project is based on version 4.3.2, however, and as I noticed later, it does not have a separate IdentityServer project for authentication.

When I noticed the Identity Server difference, it dawned on me that I was probably overriding the wrong Login page!

Because we are using a multitier separated tenant model with a separate Identity Server site for authentication, overriding the Login.cshtml file in the BlueSpot.Web project has no effect. Now I’m trying to figure out now how to override the Login page of the BlueSpot.IdentityServer project instead.

Please advise!

Here is my latest code:

From the BlueSpot.Web.BlueSpotWebModule:

public override void ConfigureServices(ServiceConfigurationContext context)
{
  var hostingEnvironment = context.Services.GetHostingEnvironment();
  var configuration = context.Services.GetConfiguration();
 
  ConfigureBundles();
  ConfigurePages(configuration);
  ConfigureCache(configuration);
  ConfigureDataProtection(context, configuration, hostingEnvironment);
  ConfigureUrls(configuration);
  ConfigureAuthentication(context, configuration);
  ConfigureImpersonation(context, configuration);
  ConfigureAutoMapper();
  ConfigureVirtualFileSystem(hostingEnvironment);
  ConfigureNavigationServices(configuration);
  ConfigureSwaggerServices(context.Services);
  ConfigureMultiTenancy();
  ConfigureBackgroundJobs();
  ConfigureTenantResolver(context);
}
 
private static void ConfigureTenantResolver(ServiceConfigurationContext context)
{
  context.Services.Configure<AbpTenantResolveOptions>(options =>
  {
    options.TenantResolvers.Clear();
    options.TenantResolvers.Add(new CurrentUserTenantResolveContributor());
  });
}

And from my BlueSpot.Web.Pages.Account.CustomLoginModel.cs file:

using System.Threading.Tasks;
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Owl.reCAPTCHA;
using Volo.Abp.Account.ExternalProviders;
using Volo.Abp.Account.Public.Web;
using Volo.Abp.Account.Security.Recaptcha;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Security.Claims;
using Volo.Saas.Tenants;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
 
namespace BlueSpot.Web.Pages.Account;
 
[ExposeServices(typeof(IdentityServerSupportedLoginModel))]
public class CustomLoginModel : IdentityServerSupportedLoginModel
{
  private readonly ITenantRepository _tenantRepository;
 
  public CustomLoginModel(
    IAuthenticationSchemeProvider schemeProvider,
    IOptions<AbpAccountOptions> accountOptions,
    IAccountExternalProviderAppService accountExternalProvider,
    IIdentityServerInteractionService interaction,
    IClientStore clientStore,
    IEventService identityServerEvents,
    ICurrentPrincipalAccessor currentPrincipalAccessor,
    IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,
    IOptions<IdentityOptions> identityOptions,
    IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions,
    ITenantRepository tenantRepository)
    : base(schemeProvider, accountOptions, accountExternalProvider, interaction, clientStore, identityServerEvents,
      currentPrincipalAccessor, recaptchaValidatorFactory, identityOptions, reCaptchaOptions)
  {
    _tenantRepository = tenantRepository;
  }
 
  public override async Task<IActionResult> OnPostAsync(string action)
  {
    var user = await FindUserAsync(LoginInput.UserNameOrEmailAddress);
    using (CurrentTenant.Change(user?.TenantId))
    {
      return await base.OnPostAsync(action);
    }
  }
 
  public override async Task<IActionResult> OnGetExternalLoginCallbackAsync(string returnUrl = "",
    string returnUrlHash = "", string remoteError = null)
  {
    var user = await FindUserAsync(LoginInput.UserNameOrEmailAddress);
    using (CurrentTenant.Change(user?.TenantId))
    {
      return await base.OnGetExternalLoginCallbackAsync(returnUrl, returnUrlHash, remoteError);
    }
  }
 
  protected virtual async Task<IdentityUser> FindUserAsync(string uniqueUserNameOrEmailAddress)
  {
    IdentityUser user = null;
    using (CurrentTenant.Change(null))
    {
      user = await UserManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ??
             await UserManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress);
 
      if (user != null)
      {
        return user;
      }
    }
 
    foreach (var tenant in await _tenantRepository.GetListAsync())
    {
      using (CurrentTenant.Change(tenant.Id))
      {
        user = await UserManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ??
               await UserManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress);
 
        if (user != null)
        {
          return user;
        }
      }
    }
 
    return null;
  }
}

Note that I had to modify the constructor to support the IdentityServerSupportedLoginModel base class constructor.

And here is my Login.cshtml file:

@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using Volo.Abp.Account.Settings
@using Volo.Abp.Settings
@model BlueSpot.Web.Pages.Account.CustomLoginModel
@inject IHtmlLocalizer<AccountResource> L
@inject Volo.Abp.Settings.ISettingProvider SettingProvider
<div class="card mt-3 shadow-sm rounded">
    <div class="card-body p-5">
        <h4>@L["Login"]</h4>
        @if (await SettingProvider.IsTrueAsync(AccountSettingNames.IsSelfRegistrationEnabled))
        {
            <strong>
                @L["AreYouANewUser"]
                <a href="@Url.Page("./Register", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})" class="text-decoration-none">@L["Register"]</a>
            </strong>
        }
        @if (Model.EnableLocalLogin)
        {
            <form method="post" class="mt-4">
                <div class="mb-3">
                    <label asp-for="LoginInput.UserNameOrEmailAddress" class="form-label"></label>
                    <input asp-for="LoginInput.UserNameOrEmailAddress" class="form-control"/>
                    <span asp-validation-for="LoginInput.UserNameOrEmailAddress" class="text-danger"></span>
                </div>
                <div class="mb-3">
                    <label asp-for="LoginInput.Password" class="form-label"></label>
                    <input asp-for="LoginInput.Password" class="form-control"/>
                    <span asp-validation-for="LoginInput.Password" class="text-danger"></span>
                </div>
                <abp-row>
                    <abp-column>
                        <abp-input asp-for="LoginInput.RememberMe" class="mb-4"/>
                    </abp-column>
                    <abp-column class="text-end">
                        <a href="@Url.Page("./ForgotPassword", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})">@L["ForgotPassword"]</a>
                    </abp-column>
                </abp-row>
                <div class="d-grid gap-2">
                    <abp-button type="submit" button-type="Primary" name="Action" value="Login" class="btn-lg mt-3">@L["Login"]</abp-button>
                    @if (Model.ShowCancelButton)
                    {
                        <abp-button type="submit" button-type="Secondary" formnovalidate="formnovalidate" name="Action" value="Cancel" class="btn-lg mt-3">@L["Cancel"]</abp-button>
                    }
                </div>
            </form>
        }
 
        @if (Model.VisibleExternalProviders.Any())
        {
            <div class="mt-2">
                <h5>@L["OrLoginWith"]</h5>
                <form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post">
                    @foreach (var provider in Model.VisibleExternalProviders)
                    {
                        <button type="submit" class="btn btn-primary m-1" name="provider" value="@provider.AuthenticationScheme" title="@L["LogInUsingYourProviderAccount", provider.DisplayName]">@provider.DisplayName</button>
                    }
                </form>
            </div>
        }
 
        @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
        {
            <div class="alert alert-warning">
                <strong>@L["InvalidLoginRequest"]</strong>
                @L["ThereAreNoLoginSchemesConfiguredForThisClient"]
            </div>
        }
 
    </div>
</div>
UPDATE 2022-02-15

This morning I checked to see if there was any response to this post. I am now going on four days without a response. If I am a paying customer, then why am I not getting a response?! I am on almost exactly the opposite side of the globe so each day I don't get a response means that I lose a full day waiting. I made the recommendation to go with ABP.IO Commercial and now I'm getting heat from my boss because the product is not being supported. Please advise!

Since last night, I was able to find the following post on your website: https://gist.github.com/ebicoglu/ce0f0425bab806d0ee1a87d0073af96b. Using that and the documentation here: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface, I was able to make changes to my implementation, moving the Account folder to the Identity Server project and updating the code so that I am now able to replace the Login functionality. The Login page works as it should now!

However, as soon I try to log out, I now get the following error:

An unhandled exception occurred while processing the request.
ComponentNotRegisteredException: The requested service 'Volo.Abp.Account.Public.Web.Pages.Account.LogoutModel' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable<Parameter> parameters)

I believe this problem probably has something to do with clearing the TenantResolvers in the BlueSpotIdentityServerModule. I am doing so because I want to follow the original post and use the email address of the user to resolve the tenant instead of requiring the user to select the tenant or use a subdomain/A record to do so.

According to my theory, I set a breakpoint so I could look at the default set of resolvers:

I was hoping to see some kind of Logout resolver that I could add back in. Instead I see all the multitenant resolvers and I have no idea whether to add one of these back into the mix.

Another approach I tried was to create a CustomLogoutModel and Logout.cshtml file:

using Volo.Abp.Account.Public.Web.Pages.Account;

namespace BlueSpot.Pages.Account;

public class CustomLogoutModel : LogoutModel { }

@page "/Account/Logout"
@model BlueSpot.Pages.Account.CustomLogoutModel

But that did not seem to help. Again, please advise!

Showing 1 to 10 of 13 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06