Hi,
It happened again yesterday. The site was down again and we got same error. I am attaching logs, please have a look.
https://smartlayer-my.sharepoint.com/:t:/g/personal/hsharma_smartlayer_ca/ERsniNssRPtLvf1zpYxv4JwBlSGp_YXL_XEhsrg6gsae4A?e=XDbME7
Thanks.
Hi,
Sorry for the delay. But i think its working now. We got issue only one time after upgrading version. I will keep monitoring and if found any issues i will post again.
Hi,
Please check the attached link for startup.cs file.
https://smartlayer-my.sharepoint.com/:u:/g/personal/hsharma_smartlayer_ca/EaPgevyTiQVBg05sqQgJpFMBMb234iDFIAWnSQPico6-Kg?e=1VirsC
Hi,
We upgraded the nuget package to 6.4 but still we are getting issue.
ERROR 2024-09-12 13:43:04,524 [179 ] 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, TaskCompletionSource
1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(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, Func
3 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](Nullable
1 multiTenancySide, String name)
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetDbQueryTable() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.GetQueryable()
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllIncluding(Expression
1[] propertySelectors)
at WeiglCentralSystemDemo.Web.Controllers.TASubscriptionController.Index(String SclGuid, String SubGuid, String Categoryid, String bookid, String title, String bookcode, String toc, String QuotID, String QuoteCategoryid, Boolean IsRead, String PairedStatus) in C:\himsProj\Weigl Central System\src\WeiglCentralSystemDemo.Web.Mvc\Controllers\TASubscriptionController.cs:line 319
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) 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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 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>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 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>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 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, IBackChannelLogoutService backChannelLogoutService) at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.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 --- at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) ERROR 2024-09-12 13:43:04,588 [68 ] Mvc.ExceptionHandling.AbpExceptionFilter - 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. 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, TaskCompletionSource
1 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(TaskCompletionSource
1 retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(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, Func
3 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.EfCoreRepositoryBase
3.GetDbQueryTable()
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetQueryable() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.GetAllIncluding(Expression1[] propertySelectors) at WeiglCentralSystemDemo.Web.Controllers.TASubscriptionController.Index(String SclGuid, String SubGuid, String Categoryid, String bookid, String title, String bookcode, String toc, String QuotID, String QuoteCategoryid, Boolean IsRead, String PairedStatus) in C:\himsProj\Weigl Central System\src\WeiglCentralSystemDemo.Web.Mvc\Controllers\TASubscriptionController.cs:line 319 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Thanks
Hi,
Anything on this. Please let me know.
Hi, We want to use Task<IActionResult> because the function returns view as in most of the conditions. I am attaching the actual function. I hope it will help you to understand the case.
<br>
<br>
public async Task<IActionResult> Index(string SclGuid, string SubGuid, string Categoryid, string bookid, string title, string bookcode, string toc, string QuotID, string QuoteCategoryid, bool IsRead)
{
if (QuotID != null && QuoteCategoryid != null && Categoryid == null)
{
Categoryid = QuoteCategoryid;
}
bool isTokenAccessExpired = false;
var AccessTokenId = "";
bool isQuoteSetting = false;
// isQuoteSetting = await isQuoteData(SubGuid);
//** This id done for user Access when user login from Openlightbox.com *//
var SubsId = SubGuid.Split("|");
if (SubsId.Length > 1)
{
try
{
AccessTokenId = HttpContext.Session.GetString("AccessTokenId").ToString();
isTokenAccessExpired = AccessTokenId == null ? true : false;
}
catch
{
return Redirect("https://openlightbox.com");
}
}
int? subscriptionId = await _entity_SchoolSubscriptionsMaster.GetAll()
.Where(x => x.SubscriptionGuid_Id == SubsId[0]).Select(x => x.SubscriptionId_FK)
.FirstOrDefaultAsync();
bool IsForTeacher = await _entity_SubscriptionMaster.GetAll().WhereIf(subscriptionId != null, x => x.Id == subscriptionId).Select(x => x.IsForTeacher).FirstOrDefaultAsync();
if (IsForTeacher && !User.Identity.IsAuthenticated)
{
return Redirect("/Account/Login?returnUrl=" + HttpContext.Request.Path.Value);
}
if (!isTokenAccessExpired)
{
TASubscriptionModel model = new TASubscriptionModel();
// model.IsQuoteSetting = isQuoteSetting;
model.IsTeacherView = IsForTeacher;
AdminQuoteSettingController quoteSetting = await QuoteSetting(SubGuid);
if (quoteSetting == null)
model.IsQuoteSetting = false;
else
{
isQuoteSetting = model.IsQuoteSetting = true;
model.Discount = quoteSetting.Discount;
var QuoteInfo = await _entity_QuoteInfo.GetAll()
.Where(x => x.QuoteSettingIDFK == quoteSetting.Id)
.WhereIf(QuotID != null && QuotID.Trim() != "", x => x.Id == Convert.ToInt32(QuotID))
.FirstOrDefaultAsync();
Tuple<int, Double> BookCountPrice = await GetBookCountPrice(model.Discount, QuoteInfo == null ? 0 : QuoteInfo.Id);
model.BookCount = BookCountPrice.Item1;
model.BookQuoteAmount = BookCountPrice.Item2.ToString();
}
try
{
string ActiveSubscriptionMessage = await _taSubscriptionAppService.IsSubscriptionActive(SubsId[0], isQuoteSetting);
if (ActiveSubscriptionMessage == "" || isQuoteSetting == true)
{
if (ActiveSubscriptionMessage != "")
{
model.SubscriptionStatus = "Past";
}
if ((Categoryid == null || Categoryid.Contains("Filter-") == true) && bookid == null)
{
if (SubsId[0] != null)
{
//model.sliderList = await _taSubscriptionAppService.GetSlidersinfo(SubGuid);
//model.tasubscriptionBooksInfo = await _taSubscriptionAppService.GetBookDataForTASubscription(SclGuid, SubGuid, "", "", "%", "-", "-", "-", 1, false, false, false);
model.advanceSearchGrades = await _taSubscriptionAppService.GetSubscriptionAdvanceFilters(SubsId[0], isQuoteSetting);
model.SchoolGuidId = SclGuid;
model.SubscriptionGuidId = SubsId[0];
model.bookResources = await _taSubscriptionAppService.GetBookResourcesIcons(SclGuid, SubsId[0]);
model.isFilterActive = false;
if (Categoryid != null)
{
string FilterToken = Categoryid.Split("Filter-")[1];
if (FilterToken.Trim() != "")
{
HttpContext.Session.Clear();
if (!string.IsNullOrWhiteSpace(AccessTokenId))
{
HttpContext.Session.SetString("AccessTokenId", AccessTokenId);
}
model.ActivefilterValues = await _taSubscriptionAppService.GetActiveFiltersdata(FilterToken);
}
}
}
return View(model);
}
else
{
var url = HttpContext.Request.GetDisplayUrl();
await TAsubscriptionBookView(Convert.ToInt32(Categoryid), Convert.ToInt32(bookid), SclGuid, SubsId[0], title, bookcode, toc, url, isQuoteSetting, QuotID, IsRead);
model.ValidsubscriptionMsg = ActiveSubscriptionMessage;
return View(model);
}
}
else
{
System.Text.RegularExpressions.Match match = Regex.Match(ActiveSubscriptionMessage, @"[A-Za-z]{3}\s\d{2},\s\d{4}");
string date = match.Value;
if (!string.IsNullOrEmpty(date))
{
var dateTime = CommonClass.GlobelDateFormat(System.DateTime.ParseExact(date, "MMM dd, yyyy", CultureInfo.CurrentCulture));
//--- Future
if (dateTime > CommonClass.GlobelDateFormat(System.DateTime.Now.Date))
{
model.SubscriptionStatus = "Future";
model.booksThumbnailsData = await _taSubscriptionAppService.GetBooksCoverImagesBySubscription(SubGuid);
}
else if (dateTime < CommonClass.GlobelDateFormat(System.DateTime.Now.Date))
{
model.SubscriptionStatus = "Past";
}
model.SubscriptionStatusDate = dateTime;
}
if (model.SubscriptionStatus == "Past")
model.ValidsubscriptionMsg = Convert.ToDateTime(model.SubscriptionStatusDate).ToString("MMMM dd, yyyy") + "| ";
else
model.ValidsubscriptionMsg = ActiveSubscriptionMessage;
return View(model);
}
}
catch (Exception ex)
{
CommonClass.Writelogs1("Error: " + ex.Message);
return View(model);
}
}
else
{
return Redirect("https://openlightbox.com");
}
}
Hi,
Our work is specifically with the action method. If you can resolve the issue for the Index action method, that would be helpful.
Hi,
Can you please send again. I did not receive any email.
Hi,
Sent project in email. Please have a look.
Thanks
Hi,
We tried this but it did not work.
Thanks