Key not present in dictionary

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
11/18/2019 1:52:56 PM
b
Gravatar
Total Posts 13

Key not present in dictionary

MojoPortal has been working wonderfully for me for years.  Thank-you.

Today, however, I am perplexed by the error message below when attempting to just visit my site - www.kbearle.com.  I checked to be sure that the db exists and is still working, the connection string is up to date and no other changes have been made since the last time I visited the site a few weeks ago.  What key is not present?  TKey key seems to be the reference, but no search in the forums came up with such a reference.  

Thanks in advance for providing some pointers on where to look to resolve this issue that is keeping my site from loading.

Brad

 

[KeyNotFoundException: The given key was not present in the dictionary.] System.ThrowHelper.ThrowKeyNotFoundException() +36 System.Collections.Generic.Dictionary`2.get_Item(TKey key) +10402245 MySql.Data.MySqlClient.CharSetMap.GetChararcterSet(DBVersion version, String CharSetName) +58 MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData41() +724 MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData() +72 MySql.Data.MySqlClient.NativeDriver.ReadColumnMetadata(Int32 count) +48 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +383 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1204 MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar() +41 MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters) +170 MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(String connectionString, String commandText, MySqlParameter[] commandParameters) +98 mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress) +312 mojoPortal.Business.BannedIPAddress.IsBanned(String ipAddress) +48 mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e) +678 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

11/18/2019 4:29:46 PM
Gravatar
Total Posts 2239

Re: Key not present in dictionary

Hi,

The error is coming from the mysql data client (MySql.Data.MySqlClient.CharSetMap.GetChararcterSet). A quick search for "mysqlclient.charsetmap key was not present" turned up a few results suggesting that the data client in the application (mojo) is too old for the version of mysql you're connecting to or that the character set specified on the database isn't supported by the data client in the application (mojo).

So, a couple of questions:

  1. What version of mojoPortal are you running?
    If you haven't upgraded in a long time but are running a new version of MySql, you need to upgrade mojoPortal.
  2. What version of MySql are you running?
    If you have upgraded this recently, and you haven't upgraded mojoPortal in a while, you need to upgrade mojoPortal.
  3. What is the character set specified on the mojoportal database?

Thanks,
Joe

11/18/2019 6:23:04 PM
b
Gravatar
Total Posts 13

Re: Key not present in dictionary

MojoPortal version 2.3.3.6 as seen in the schemaversion table --SELECT * FROM `mp_schemaversion`

InnoDBVersion 5.7.28 as seen by running : SHOW VARIABLES LIKE "%version%"

collation on the tables is: utf_general_ci, then ran this sql:

SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME IN ( 'character_set_client', 'character_set_connection', 'character_set_results', 'collation_connection' ) ORDER BY VARIABLE_NAME;

and got this result table:

VARIABLE_NAME                VARIABLE_VALUE

character_set_client            utf8mb4

character_set_connection   utf8mb4

character_set_results          utf8mb4

collation_connection           utf8mb4_unicode_ci

and these others showed up when running: SHOW SESSION VARIABLES LIKE 'character\_set\_%'

character_set_filesystem    binary

character_set_database     utf8mb4

character_set_server         utf8mb4

character_set_system        utf8

11/19/2019 2:39:32 PM
Gravatar
Total Posts 2239

Re: Key not present in dictionary

Hi,

That version of mojoPortal is almost 10 years old and the MySql version you're running is less than 2 months old. I think you need to upgrade mojoPortal so your site will work with this new version of MySql.

Thank you,
Joe

You must sign in to post in the forums. This thread is closed to new posts.