• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

RDJ DB Setup Error: KeyNotFoundException: ... '2.get_Item(Tkey key) at MySql...

Started by DavidEsp, August 06, 2021, 12:30:12 AM

DavidEsp

Newbie RadioDJ User - Database Setup Issue

Installed MariaDB then RadioDJ ok but its Database Setup Utility reported a "Key not found" error
Any advice appreciated.  Details are below.

Windows 10 (latest updates)
MariaDB (latest version, 10.6.3)
RadioDJ (latest stable version, v2.0.0.6)

What I did in RadioDJ's Database Setup Utility (which came up immediately after completion of RadioDJ installation)...
Entered password for MariaDB (latest)
Clicked: [INSTALL DATABASE]

Window reported...
QuoteThe new database was created successfully
Creating database tables and inserting records...
Completed with error(s).System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary  at System.Collections.Generic.Dictionary '2.get_Item(Tkey key)  at MySql.Data.MySqlClient
(text truncated in window)

Exception Log reported...
Quote5 Aug 2021 22:36:37
Cannot find table 0.   at System.Data.DataTableCollection.get_Item(Int32 index)

hypadj33

Quote from: DavidEsp on August 06, 2021, 12:30:12 AM
Newbie RadioDJ User - Database Setup Issue

Installed MariaDB then RadioDJ ok but its Database Setup Utility reported a "Key not found" error
Any advice appreciated.  Details are below.

Windows 10 (latest updates)
MariaDB (latest version, 10.6.3)
RadioDJ (latest stable version, v2.0.0.6)

What I did in RadioDJ's Database Setup Utility (which came up immediately after completion of RadioDJ installation)...
Entered password for MariaDB (latest)
Clicked: [INSTALL DATABASE]

Window reported...
Exception Log reported...

Have a look here https://stackoverflow.com/questions/41930040/net-mysql-error-the-given-key-was-not-present-in-the-dictionary

DavidEsp

Thank you!

I'll try an experiment in that case...
During the MariaDB installation process, in the "User settings" window, I'll choose [Enable UTF8 as default server's character set]...

...because...

...in the discussion you linked, a solution was: "I have solved your same error simply adding the charset to the connection string:", and the associated code stated it as utf8...
...(and because last time I didn't enable it - having left it in its default state of being disabled)

DavidEsp

Sadly that (enabling utf8) made no difference.
Not knowing what else to do, I simply clicked [Continue]
Wondering whether that will lead to some bad consequence later on...

DavidEsp

In RadioDJ's Database Setup Utility, Database Utils tab, I tried [REPAIR DATABASE]
But it reported the same error: "Unhandled Exception ... the given key was not present in the dictionary"

At end of MariaDB data File:DAVIDESP6593.err] it says
2021-08-06 15:59:48 3 [Warning] Access denied for user 'root'@'localhost' (using password: YES)
Don't know if that's relevant or normal.

There is nothing in C:\RadioDJv2\Logs -- empty folder
I will paste the Detail output of the error as a further reply, in case that helps pin down the root cause.
I'm not clear how best to continue to get RadioDJ+MariaDV working.

Could it be worth trying different combinations of earlier version(s) of MariaDB and RadioDJ?
What is the latest known-to-work combination?
Or does "my" combination work for anyone else?

DavidEsp

Detail for the Database Setup (and Repair) error message/prompt...
Quote
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
   at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
   at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
   at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
   at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
   at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlDataReader.Close()
   at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at Database_Setup.MainForm.butRepair_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Database Setup
    Assembly Version: 3.7.3.4
    Win32 Version: 3.7.3.4
    CodeBase: file:///C:/RadioDJv2/Setup/Database%20Setup.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
MySql.Data
    Assembly Version: 8.0.11.0
    Win32 Version: 8.0.11.0
    CodeBase: file:///C:/RadioDJv2/Setup/MySql.Data.DLL
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
MySqlBackup
    Assembly Version: 2.0.12.0
    Win32 Version: 2.0.12.0
    CodeBase: file:///C:/RadioDJv2/Setup/MySqlBackup.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

DavidEsp

I tried the latest beta of RadioDJ, namely File:[SetupRadioDJ2031Beta.exe], but no difference

DavidEsp

I see from https://www.youtube.com/watch?v=8rC_FsQX7xo that, as of Oct 2020...
...neither MySQL nor MariaDB have "real" UFT8 implementations, they only use the first 3 bytes for each character (instead of the proper 4).
This is alien territory for me, I merely repeat here what was presented there.

Continuing..
The presentation recommended to change a line in File:[my.ini] in MariaDB's Folder:[data]
Change: [character-set-server=utf8] to: [character-set-server=utf8mb4]
On restarting the MariaDB service (by right-clicking it in Windows-10's Services window), this tells that service to use the full four bytes for each character.

Made no difference - same error.

Well it was worth a try...

hypadj33

At end of MariaDB data File:DAVIDESP6593.err] it says
2021-08-06 15:59:48 3 [Warning] Access denied for user 'root'@'localhost' (using password: YES)
Don't know if that's relevant or normal.


I can tell you this is a wrong password issue for this bit, don't know if you want to go down this road but I use xampp which is MySQL server but it also has PHPMyAdmin built in so you can create the database yourself and set the passwords etc and have more control over the passwords, what are you based we can set up a teamviwer session if we can time it right, if you like and i can help you set up xampp.

DavidEsp

SOLUTION:
RadioDJ set-up ok with MariaDB's latest in the 10.4 series (10.4.21) and 10.5 series (10.5.12)
(...but not with the 10.6 series)

So, unless anyone advises otherwise, I will stick with MariaDB 10.5.12 for the time being.

DavidEsp

THANK YOU hpadj33,

I took a quick look at XAMPP, just to see broadly what it was.
I discovered that it is a web-development package that includes MariaDB as one component.
I saw that the XAMPP latest version (8.0.9) contains MariaDB version 10.4.20.
I then found that the latest version of MariaDB in its 10.4 series is 10.4.21

So I tried installing MariaDB 10.4.21
And this time, RadioDJ's setup worked with it ok !

I then tried it with MariaDB's latest version in the 10.5 series (10.5.12) and that worked also.
Finally I tried it (again) with the latest in its 10.6 series, namely 10.6.4.  Also with 10.6.3.  But both gave me the same error as reported at the start of this thread.

Thank you for your offer of help getting started with XAMPP
- I would indeed like to find out more about it, sometime later in the near future if that's ok with you.

ghm72


DavidEsp

Thanks Gary',
Just went through your guide at https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html.
One haha moment when not all the screen fitted onto my laptop - fixed, and now I can see the buttons at the bottom!
Getting there.

hypadj33

Quote from: DJ Garybaldy on August 07, 2021, 09:12:16 PM
As I found XAMPP comes with a steep learning curve!

I guess it depends what you use if for, I find it a good all-round package for my needs, as I use the FTP server, MySQL, PHPMyAdmin, and Apache to make changes and testing plugins locally, although NOT ideal I also use it should my site go down, it's not everyone's cup of tea, but I didn't find it that difficult to use apart from where it installs the WordPress package.

Marius

There were some changes on both MySQL and MariaDB. I'm working to correct the error.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.