Error: The given key was not present in the dictionary

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
7/15/2020 3:34:53 AM
Gravatar
Total Posts 251

Error: The given key was not present in the dictionary

Hi, suddenly my five mojoportal installs are saying:

The given key was not present in the dictionary.

[KeyNotFoundException: The given key was not present in the dictionary.] System.ThrowHelper.ThrowKeyNotFoundException() +38 System.Collections.Generic.Dictionary`2.get_Item(TKey key) +54 MySql.Data.MySqlClient.CharSetMap.GetCharacterSet(DBVersion version, String CharSetName) +33 MySql.Data.MySqlClient.MySqlField.SetFieldEncoding() +290 MySql.Data.MySqlClient.MySqlField.SetTypeAndFlags(MySqlDbType type, ColumnFlags flags) +691 MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns) +39 MySql.Data.MySqlClient.Driver.GetColumns(Int32 count) +114 MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols) +29 MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols) +59 MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) +170 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +130 MySql.Data.MySqlClient.MySqlDataReader.Close() +69 MySql.Data.MySqlClient.MySqlConnection.Close() +60 MySql.Data.MySqlClient.MySqlHelper.ExecuteReader(String connectionString, String commandText, MySqlParameter[] commandParameters) +137 mojoPortal.Web.WebTaskManager.StartOrResumeTasks(Boolean appWasRestarted) +531 mojoPortal.Web.Global.StartOrResumeTasks() +364 mojoPortal.Web.Global.Application_Start(Object sender, EventArgs e) +325 [HttpException (0x80004005): The given key was not present in the dictionary.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +546 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +171 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +255 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347 [HttpException (0x80004005): The given key was not present in the dictionary.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737

I setup it last year on Windows 10.0.18363.900 (IIS 10 - Windows 10 Pro - not server), it was working fine, but after some automatic update it broke.

.NET version is 4.8 (Release 528040)

Database is MariaDB in docker, https://hub.docker.com/_/mariadb/ - mariadb:latest which is 10.5.4-focal

What can I do to fix this?

Thanks

7/15/2020 6:05:18 AM
Gravatar
Total Posts 251

Re: Error: The given key was not present in the dictionary

I was able to fix the problem by:

  • doing a backup of the files
  • doing a backup of the database
  • deleting all the files except \data and user.config
  • copying files from the latest 2.7.0.0
  • fixing Setup\applications\mojoportal-core\SchemaUpgradeScripts\mysql\2.6.0.4.config for the letter case as mp_SiteSettingsExDef (mysql in docker on windows is case sensitive because it runs on linux)
  • doing the upgrades scripts
You must sign in to post in the forums. This thread is closed to new posts.