Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "huntethan89"

Hi,

Just checking, Any update on this?

Hi @ismcagdas,

Project sent on email.

Thanks.

Hi,

Issue is not resolved yet. We tried with ASP.net Core 5.0 application without ABP and tested there with ASPNETCore.Proxy. It is working fine there but when using with ABP net zero it was not working.

Hi,

We upgraded the nuget package to 6.4 and in that process we faced lot of issues. So we upgraded lot of other dlls as well and that lead to one more issue as follows:

Basically what we are trying to do is fetch data from URL and showing at our end. We are passing URL in following CreateProxyHttpRequest and getting the data without any issue in version 5.10 but getting above attached image error after upgrading to 6.4.

var request = HttpContext.CreateProxyHttpRequest(new Uri(_url));
var response = await _client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, HttpContext.RequestAborted);
await HttpContext.CopyProxyHttpResponse(response);

Following is the code which we are using for Proxy request:

`public static class ProxyRequest { public static HttpRequestMessage CreateProxyHttpRequest(this HttpContext context, Uri uri) { var request = context.Request;

    var requestMessage = new HttpRequestMessage();
    var requestMethod = request.Method;
    if (!HttpMethods.IsGet(requestMethod) &&
        !HttpMethods.IsHead(requestMethod) &&
        !HttpMethods.IsDelete(requestMethod) &&
        !HttpMethods.IsTrace(requestMethod))
    {
        var streamContent = new StreamContent(request.Body);
        requestMessage.Content = streamContent;
    }

    // Copy the request headers
    foreach (var header in request.Headers)
    {
        if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()) && requestMessage.Content != null)
        {
            requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
        }
    }

    requestMessage.Headers.Host = uri.Authority;
    requestMessage.RequestUri = uri;
    requestMessage.Method = new HttpMethod(request.Method);

    return requestMessage;
}
public static async Task CopyProxyHttpResponse(this HttpContext context, HttpResponseMessage responseMessage)
{
    if (responseMessage == null)
    {
        throw new ArgumentNullException(nameof(responseMessage));
    }

    var response = context.Response;

    response.StatusCode = (int)responseMessage.StatusCode;
    foreach (var header in responseMessage.Headers)
    {
        response.Headers[header.Key] = header.Value.ToArray();
    }

    foreach (var header in responseMessage.Content.Headers)
    {
        response.Headers[header.Key] = header.Value.ToArray();
    }

    // SendAsync removes chunking from the response. This removes the header so it doesn't expect a chunked response.
    response.Headers.Remove("transfer-encoding");

    using (var responseStream = await responseMessage.Content.ReadAsStreamAsync())
    {
        await responseStream.CopyToAsync(response.Body, 1000000, context.RequestAborted);
    }
}

}`

Hi @ismcagdas,

The Abp NuGet package version is 5.10.1.

Hi @gryphon644,

No, our database is not azure, it's on Premises.

Thanks

Hi,

I have my application in MVC asp.net core. My site is published on IIS. It keeps stop working after 1 or 2 days. After that i have to restart my IIS and site starts working again. I checked my logs and found the following error. Can someone please help me with this error:

ERROR 2024-05-15 08:21:59,482 [340 ] e.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred while executing the request. System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at Microsoft.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.BeginTransaction(DatabaseFacade databaseFacade, IsolationLevel isolationLevel) at Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.CreateDbContext[TDbContext](String connectionString, IDbContextResolver dbContextResolver) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext[TDbContext](Nullable1 multiTenancySide, String name) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.get_Table() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.Insert(TEntity entity) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.InsertAsync(TEntity entity) at Castle.Proxies.Invocations.IRepository2_InsertAsync_29.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.ProceedInfo.Invoke() at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Auditing.AuditingHelper.SaveAsync(AuditInfo auditInfo) at Abp.AspNetCore.Mvc.Auditing.AbpAuditActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) at IdentityServer4.Hosting.MutualTlsTokenEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Hi @ismcagda, Thank you for providing the solution, But I have noticed that, when I am using base URL so for authentication its going on LogIn method inside my application after that microsoft logIn page is opening, but when I am using any relative URL other than base URL, it's not going on Login method for authentication, by default its opening microsoft login page. So how we can configure that, every URL will go on LogIn method inside my application first if not authenticated.

Any insights or suggestions would be greatly appreciated.

Thanks,

Hi @ismcagdas No, This is the only error we can able to see.

Thanks,

Hello team,

Our base URL is set to 'http://localhost:6240', and I have encountered a problem when attempting to access URLs beyond the base, such as 'http://localhost:6240/Mpa/Timesheet'. The issue manifests as an infinite loop, preventing successful navigation to the desired URLs.

To provide more context, our authentication and authorization are implemented using Azure AD OpenID Connect. I have reviewed our configuration settings and code, but the problem persists.

I have attached an image of the issue that I am encountering every time while trying to login

Could you kindly assist in troubleshooting this issue or guide me on potential areas to investigate further? Any insights or suggestions would be greatly appreciated.

Error1.png

Hi, I am using BatchDeleteAsync() to delete multiple rows in table based on the condition in predicate, but it will hard delete all rows. Please check the below screenshot.

I want to soft-delete the same by setting IsDeleted = 1. I can use DeleteAsync method but it's for the single entity and needs loop for the condition-based deletion. I found the method BatchUpdateAsync() which can be used to update multiple rows based on predicate. So, I just want to know how it can be implemented in place of the above attached query. I am getting issues while setting the predicate and update expression in its parameters.

Showing 11 to 20 of 202 entries