nopcommerce dead all of the sudden

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hey Guys,

I just realized my nopcommerce is not able to start. I see a recurring error which I haven't been able to tackle it. Any insights would be helpful on how to solve it:


Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Nop.Core.Domain.Common.CommonSettings -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
---> System.Collections.Generic.KeyNotFoundException: The given key '24941' was not present in the dictionary.
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlField.set_CharacterSetIndex(Int32 value)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlDataReader.Close()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at FluentMigrator.Runner.Processors.MySql.MySqlProcessor.Exists(String template, Object[] args)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at FluentMigrator.Runner.Processors.MySql.MySqlProcessor.TableExists(String schemaName, String tableName)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at FluentMigrator.Runner.VersionLoader.get_AlreadyCreatedVersionTable()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at FluentMigrator.Runner.VersionLoader.LoadVersionInfo()
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at FluentMigrator.Runner.VersionLoader..ctor(IProcessorAccessor processorAccessor, IConventionSet conventionSet, IMigrationRunnerConventions conventions, IVersionTableMetaData versionTableMetaData, IMigrationRunner runner)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]: --- End of stack trace from previous location where exception was thrown ---
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance[T](IServiceProvider provider, Object[] parameters)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Microsoft.Extensions.DependencyInjection.FluentMigratorServiceCollectionExtensions.<>c.<AddFluentMigratorCore>b__0_6(IServiceProvider sp)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass3_0.<Register>b__0(IComponentContext context, IEnumerable`1 parameters)
May  5 18:49:31 hci-app-lon-1 hikingclubireland-4.30[1454005]:    at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
:    at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
:    --- End of inner exception stack trace ---
:    at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
:    at Autofac.Core.Resolving.InstanceLookup.<>c__DisplayClass7_0.<Execute>b__0()
:    at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
:    at Autofac.Core.Resolving.InstanceLookup.Execute()
2 years ago
I have the very same issue, seems to be something related to MySql connector, but I don't know how to fix it.
2 years ago
As far as I'm aware I didn't update the machines. That's what's bothering me.
Could be something else?
2 years ago
Same here, I disabled unattended upgrades on ubuntu which I am using, exactly because some update might crash the app, but I have no idea why this is happening now all of a sudden.
2 years ago
Does anyone have a hint or clue about what might be causing this?
2 years ago
After some digging I found out that this started happening first:

May  6 01:00:16 :       Start processing HTTP request POST https://www.m-shop.ba/scheduletask/runtask
May  6 01:00:16 : #033[40m#033[32minfo#033[39m#033[22m#033[49m: System.Net.Http.HttpClient.default.ClientHandler[100]
May  6 01:00:16 :       Sending HTTP request POST https://www.m-shop.ba/scheduletask/runtask
May  6 01:00:16 : #033[40m#033[32minfo#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Hosting.Diagnostics[1]
May  6 01:00:16 :       Request starting HTTP/1.1 POST http://www.m-shop.ba/scheduletask/runtask application/x-www-form-urlencoded 69
May  6 01:00:16 : #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
May  6 01:00:16 :       An unhandled exception has occurred while executing the request.
May  6 01:00:16 : Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Framework.WebWorkContext -> λ:Nop.Core.Security.CookieSettings.
May  6 01:00:16 :  ---> System.NotSupportedException: Character set 'utf8mb3' is not supported by .Net Framework.
May  6 01:00:16 :    at MySql.Data.MySqlClient.CharSetMap.GetCharacterSet(DBVersion version, String charSetName)
May  6 01:00:16 :    at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
May  6 01:00:16 :    at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
May  6 01:00:16 :    at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
May  6 01:00:16 :    at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
May  6 01:00:16 :    at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
May  6 01:00:16 :    at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
May  6 01:00:16 :    at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
May  6 01:00:16 :    at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
May  6 01:00:16 :    at MySql.Data.MySqlClient.MySqlDataReader.Close()
May  6 01:00:16 :    at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
May  6 01:00:16 :    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
May  6 01:00:16 :    at LinqToDB.Data.DataConnection.ExecuteReader(CommandBehavior commandBehavior)
2 years ago
Now, whatever I try to do (was trying to adjust some setting on the db side), I get :

Unhandled exception. Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Nop.Core.Domain.Common.CommonSettings -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
May 07 14:41:31:  ---> System.Collections.Generic.KeyNotFoundException: The given key '24941' was not present in the dictionary.
May 07 14:41:31:    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlField.set_CharacterSetIndex(Int32 value)
May 07 14:41:31:    at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
May 07 14:41:31:    at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
May 07 14:41:31:    at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
May 07 14:41:31:    at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
May 07 14:41:31:    at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
May 07 14:41:31:    at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlDataReader.Close()
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
May 07 14:41:31:    at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
May 07 14:41:31:    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
May 07 14:41:31:    at FluentMigrator.Runner.Processors.MySql.MySqlProcessor.Exists(String template, Object[] args)
May 07 14:41:31:    at FluentMigrator.Runner.Processors.MySql.MySqlProcessor.TableExists(String schemaName, String tableName)
May 07 14:41:31:    at FluentMigrator.Runner.VersionLoader.get_AlreadyCreatedVersionTable()
May 07 14:41:31:    at FluentMigrator.Runner.VersionLoader.LoadVersionInfo()
May 07 14:41:31:    at FluentMigrator.Runner.VersionLoader..ctor(IProcessorAccessor processorAccessor, IConventionSet conventionSet, IMigrationRunnerConventions conventions, IVersionTableMetaData versionTableMetaData, IMigrationRunner runner)
May 07 14:41:31: --- End of stack trace from previous location where exception was thrown ---
2 years ago
I have the same issue with the same KEY code.
Anyone from nopcommmerce developers or expert users reading this?
2 years ago
Yidna ? @Yidna ? How to reference a username?
2 years ago
What version of nopCommerce ?

I've never seen these errors before and I am a windows / SQL person so other than searching google i am not much help

So there was no changes to the operating system on the server ?
And you say you did not customise or change any code ?
Then it seems there must be something wrong with the database ?

I found this on google
https://stackoverflow.com/questions/68645324/system-notsupportedexception-character-set-utf8mb3-is-not-supported-by-net-f

Another option is you setup a development environment and use a copy of the database and see if you get the error and maybe you can debug it
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.