Base solution for your next web application
Open Closed

Some stranger errors in Asp.Net Zero #4282


User avatar
0
VuCA created

Dear admin,

I found some exceptions in the log file, please help me figure out this error and how to fix it:

  1. The first one is: I do not customize class Role : AbpRole<User>

Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not proxy Abp.EntityFramework.Repositories.EfRepositoryBase2[[Abp.Zero.EntityFramework.AbpZeroCommonDbContext2[[MyNamespace.Authorization.Roles.Role, MyNamespace.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null],[MyNamespace.Authorization.Users.User, MyNamespace.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]], Abp.Zero.EntityFramework, Version=2.1.3.0, Culture=neutral, PublicKeyToken=null],[Abp.Localization.ApplicationLanguage, Abp.Zero.Common, Version=2.1.3.0, Culture=neutral, PublicKeyToken=null]] ---> System.ArgumentException: Unable to obtain public key for StrongNameKeyPair. ......

  1. The second one is: The website is running but sometime throw this exception. (note: the connection string is correct & db server working fine) ERROR ComponentActivator: could not instantiate MyNamespace.EntityFramework.MyDbContext Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate MyNamespace.EntityFramework.MyDbContext ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkId=386386">http://go.microsoft.com/fwlink/?LinkId=386386</a> for information on DbContext and connections. See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> Oracle.ManagedDataAccess.Client.OracleException: Connection request timed out at OracleInternal.ConnectionPool.PoolManager3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OracleConnectionDispenser3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword) at Oracle.ManagedDataAccess.Client.OracleConnection.Open() at Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices.GetDbProviderManifestToken(DbConnection connection) at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) --- End of inner exception stack trace --- at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) --- End of inner exception stack trace --- at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.<>c__DisplayClass1.<ResolveManifestToken>b__0(Tuple3 k) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection) at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) at System.Data.Entity.Internal.RetryLazy2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() 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 MyNamespace.EntityFramework.MyDbContext..ctor(String nameOrConnectionString) .... Please help me! Thanks in advance!

12 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    System.ArgumentException: Unable to obtain public key for StrongNameKeyPair.

    You need full access for one of these:

  • User Avatar
    0
    VuCA created

    <cite>aaron: </cite>

    System.ArgumentException: Unable to obtain public key for StrongNameKeyPair.

    You need full access for one of these:

    Thanks @aaron, But my iis-user is already have permission on this "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" folder :cry:

  • User Avatar
    0
    aaron created
    Support Team

    How about the user that runs the site?

  • User Avatar
    0
    VuCA created

    <cite>aaron: </cite> How about the user that runs the site?

    What do you mean aaron? Sorry I don't understand your question, can you explain more?

  • User Avatar
    0
    aaron created
    Support Team

    I mean the current user that builds and executes the application.

  • User Avatar
    0
    VuCA created

    <cite>aaron: </cite> I mean the current user that builds and executes the application.

    Dear @aaron, by default everyone have read / write permission on this folder and I checked. The strange thing is when I run on single server it doesn't throw exception but when I add to IIS-Farm the error will occurs.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @VuCA,

    Could it be a database access problem ? Maybe caused by a firewall ?

  • User Avatar
    0
    VuCA created

    <cite>ismcagdas: </cite> Hi @VuCA,

    Could it be a database access problem ? Maybe caused by a firewall ?

    Hi ismcagdas,

    How to finalize this issue? Can you tell me how to check this?

    Notes: The website is working, I don't know sometime it's throw these exception and keep the CPU resource of the servers, until I restart app pool. I checked each server telnet to db successful.

    Thanks!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I'm not sure if this is related to AspNet Zero or Oracle. Can you try to increase connection timeout as suggested in here <a class="postlink" href="https://stackoverflow.com/a/32712423/6681451">https://stackoverflow.com/a/32712423/6681451</a> ?

  • User Avatar
    0
    VuCA created

    <cite>ismcagdas: </cite> Hi,

    I'm not sure if this is related to AspNet Zero or Oracle. Can you try to increase connection timeout as suggested in here <a class="postlink" href="https://stackoverflow.com/a/32712423/6681451">https://stackoverflow.com/a/32712423/6681451</a> ?

    Dear ismcagdas,

    I'll try to increase connection timeout as you suggested but I think it's not a reason in this case. Because when I run this website in single IIS Server everything is ok but when I join to IIS-Web Farm (include 5 server) then the issue will come. Do you have any ideal about it?

    Thanks!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @VuCA,

    No, unfortunately nothing comes to my mind on AspNet Zero side. Have you checked if there are any configuration on Oracle side ?

  • User Avatar
    0
    VuCA created

    <cite>ismcagdas: </cite> Hi @VuCA,

    No, unfortunately nothing comes to my mind on AspNet Zero side. Have you checked if there are any configuration on Oracle side ?

    <cite>ismcagdas: </cite> Hi @VuCA,

    No, unfortunately nothing comes to my mind on AspNet Zero side. Have you checked if there are any configuration on Oracle side ?

    :( :( :( :( So sad! Can you suggest some tools to check this problem, I'm sure there no any configuration on Oracle need, because many we use oracle in many site and no issue with this.