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

Email sends from tenants fail due to EntityNotFoundException #2816


User avatar
0
omkarchoudhari created

In our Multi-tenant application using angularJS and MVC5 (Database per Tenant) our email send feature goes through following steps :

Login to tenant : Switch to HostDB to get Tenant ID Authenticate Send Email from UI Creates Job in Hangfire.Job in HostDB Queue Job Switch to Tenant DB get email configuration and summary Switch to Host DB Execute Job to send Email

However , we are getting the Abp.Domain.Entities.EntityNotFoundException after few emails are sent from a perticular tenant. Our initial guess is that because of the number of swithches between HostDB and TenantDB, we are getting this error. We have now switched to Hangfire Pro for background job processing.

========================================================================================== There is no such an entity. Entity type: C2C.Email.EmailConfiguration, id: 19

Abp.Domain.Entities.EntityNotFoundException: There is no such an entity. Entity type: C2C.Email.EmailConfiguration, id: 19 at Abp.Domain.Repositories.AbpRepositoryBase2.Get(TPrimaryKey id) at Castle.Proxies.EfRepositoryBase3Proxy_24.Get_callback(Int64 id) at Castle.Proxies.Invocations.AbpRepositoryBase2_Get_28.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.EfRepositoryBase3Proxy_24.Get(Int64 id) at C2C.Email.EmailAppService.GetEmailConfiguration(getSessionTenantId sessionObj) at Castle.Proxies.EmailAppServiceProxy.GetEmailConfiguration_callback(getSessionTenantId sessionObj) at Castle.Proxies.Invocations.IEmailAppService_GetEmailConfiguration.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Auditing.AuditingInterceptor.PerformSyncAuditing(IInvocation invocation, AuditInfo auditInfo) at Abp.Auditing.AuditingInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Runtime.Validation.Interception.ValidationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.EmailAppServiceProxy.GetEmailConfiguration(getSessionTenantId sessionObj) at C2C.Email.SendEmailJob.getEmailConfigurationSummary(getSessionTenantId sessionObj) at C2C.Email.SendEmailJob.Execute(getSessionTenantId sessionObj)

==========================================================================================

Is there a way to resolve this ? Looking forward to your continuous support.


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

    Hi,

    Did you modified your code which you send to us ? If so, can you share it's latest version ?

    Thanks.

  • User Avatar
    0
    omkarchoudhari created

    Yes . All relevant code files are attached. email.zip