Base solution for your next web application

Activities of "omkarchoudhari"

I Understand. However , our web application is hosted on azure . Shared space. As such we do not have access to the server where these DB's are located . That is the reason we need to automate this process through code.

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

We would like to know how hangfire is implemented in a multi-tenant application ? Scenario 1:

  1. Does hangfire create tables in each tenant or only in the host Database
  2. In our application the hangfire tables are created in only Host DB and in the Hangfire.Job table , we are passing tenantId.
  3. Strangely its working fine foe sometime and stops sending emails at other times. its uncertain.
  4. Hangfire enqueues jobs properly but emails are not sent from some tenants. Hard to figure out what is going wrong. We are currently using free version of Hangfire. Do you think that purchasing the licensed version would help ?
  5. Its mentioned in the ABP documentation that , the Backgroundjobmanager is single.threaded. Is the isuu we are facing with sending emails because of that ? If so what can we do to make it multithreaded ?

LOOKING FORWARD TO AN URGENT RESPONSE. Thanks.

PROBLEM SOLVED. Issue was that "Web server was on HTTP and SQL was on HTTPS ". So the calls were blocked. I think that was what meant by"No such host was found". So added code for redirecting to HTTPS in Global.asax

Anyways . Thanks for your support.

AZURE :

All other pages and functionality is working fine on Azure application. Only problem is with tenant creation. Tenant DB is created ok , but tables in the DB and stored procedures are not created.

Even local application creates tenant and DB and its tables fine. However on Azure , its simply gives "An internal error occurred". Log files give away the error pasted above.

Requesting your continued help. Thanks .

  1. We also tried creating a tenant in the Host DB (Use Host DB) , but get the error :

"An exception of type 'System.Data.SqlClient.SqlException' occurred in EntityFramework.dll but was not handled in user code: Additional information: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization=570; handshake=1415; [Login] initialization=0; authentication=0; [Post-Login] complete=256;"

  1. Tried your suggested solution for timeout in dbcontext, but does not work. Here is the updated log file. ========================================================== DEBUG 2017-02-10 06:20:30,358 [36 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:20:56,517 [39 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:20:56,954 [35 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:21:28,134 [39 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"5a6f5d0d-1078-4cf5-9735-11a9fec8be23","IpAddress":"114.143.194.198","TenantId":null,"UserId":1,"ConnectTime":"2017-02-10T06:21:28.1192798Z","Properties":{}} DEBUG 2017-02-10 06:21:28,728 [35 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: 5a6f5d0d-1078-4cf5-9735-11a9fec8be23 DEBUG 2017-02-10 06:21:28,791 [39 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:21:28,853 [44 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: 5a6f5d0d-1078-4cf5-9735-11a9fec8be23 DEBUG 2017-02-10 06:21:31,031 [35 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:21:31,416 [36 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() DEBUG 2017-02-10 06:22:45,719 [46 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() ERROR 2017-02-10 06:23:26,999 [36 ] nHandling.AbpApiExceptionFilterAttribute - ComponentActivator: could not instantiate C2C.EntityFramework.C2CDbContext Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate C2C.EntityFramework.C2CDbContext ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext1 c) at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn) at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.<UsingConnection>b__32() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action1 act) at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action1 act) at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable1 commandTimeout, StoreItemCollection storeItemCollection) at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable1 commandTimeout, StoreItemCollection storeItemCollection) at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func3 createMigrator, ObjectContext objectContext) at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) at System.Data.Entity.CreateDatabaseIfNotExists1.InitializeDatabase(TContext context) at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<CreateInitializationAction>b__e() at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) at System.Data.Entity.Internal.RetryAction1.PerformAction(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action1 action) at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes() at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext() at Abp.EntityFramework.AbpDbContext.RegisterToChanges() at C2C.EntityFramework.C2CDbContext..ctor(String nameOrConnectionString) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type implType, Object[] arguments, ConstructorCandidate constructor) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType) --- End of inner exception stack trace --- at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context) at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden) at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally) at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy) at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context) at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy) at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) at Castle.Windsor.WindsorContainer.Resolve[T](Object argumentsAsAnonymousType) at Abp.Dependency.IocManager.Resolve[T](Object argumentsAsAnonymousType) at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver, Object argumentsAsAnonymousType) at Abp.Zero.EntityFramework.AbpZeroDbMigrator2.CreateOrMigrate(AbpTenantBase tenant) at Abp.Zero.EntityFramework.AbpZeroDbMigrator`2.CreateOrMigrateForTenant(AbpTenantBase tenant) at C2C.MultiTenancy.TenantManager.

Yes !! Updated the abp.zero.entityframework , deleted the temp folder, and cleaned and built the solution again. Now the error is gone and application runs. However , getting this error now after login page .

Getscripts Error :

<a class="postlink" href="http://localhost:6248/AbpScripts/GetScripts?v=636211105834908395">http://localhost:6248/AbpScripts/GetScr ... 5834908395</a>

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Referring to other threads , checked the logs for the web project and found the following error:

Method not found:System.String Abp.Application.Navigation.User MenuItem.get_Target()

Not able to resolve this one . Please advise on the solution.

No. I want this link to appear on tenant side. It should appear the way it does for PhoneBook application. i.e

The link you have provided for reference is not working. Getting page not found error.

yes !! Got it. Thank you so much.

Showing 61 to 69 of 69 entries