Index was outside the bounds of the array - Attempting to connect to SQL Azure DB

Aug 25, 2011 at 4:16 PM

I've been using the v3.6 Migration wizard but have started getting an Index was outside the bounds of the array when simply attempting to connect to SQL Azure DB through the Migration Wizard. I have now upgraded to 3.7.7 but still receive the error below:

===================================

Index was outside the bounds of the array. (Microsoft.SqlServer.Smo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
   at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
   at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
   at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
   at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
   at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name)
   at SQLAzureMW.ScriptWizard.DisplayDatabases(Server& dbServer, ListBox lb)

 Followed by the error:

************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
   at System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
   at SQLAzureMW.ScriptWizard.btnConnectToServer_Click(Object sender, EventArgs e)
   at SQLAzureMW.ScriptWizard.DisplayNext()
   at SQLAzureMW.ScriptWizard.btnNext_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)

 

Coordinator
Aug 25, 2011 at 5:32 PM

Hi, this is sad news.

 

I have a few questions:

 

1)    Are you using SQL Azure as your source database or your target database?

2)    If you use SQL Server as your source and use SQL Server as your target, do you get the same error?

3)    Are you running SQLAzureMW on top of SQL Server 2008 R2?

 

I had a friend who had the same kind of error, and he ended up reinstalling SQL Server 2008 R2 bits on his machine and then he was up and running.  Not a good answer I know.  So, we can try a few things first.

 

If you want, contact me through codeplex and we can take this offline and see if we can resolve.

 

Thanks,

George 


Coordinator
Aug 25, 2011 at 5:36 PM

Oh, as a side note, I have seen this error if you are targeting SQL Denali level server.  This required a new build of SQLAzureMW on SQL Denali bits.  If that is the case, just let me know and I can build you a version of SQLAzureMW that works with SQL Denali.

 

Regards,

George 


Aug 26, 2011 at 12:20 PM
Edited Aug 26, 2011 at 12:29 PM

i'm having the same issue since yesterday. Two weeks ago I used v 3.6.2 without any problems and I have now upgraded to 3.7.7 and I'm testing with the source code and visual studio but I' getting the same "Index was outside the bounds of the array." (edit: in both versions)

===================================
Índice fuera de los límites de la matriz. (Microsoft.SqlServer.Smo)
------------------------------Ubicación del programa:
   en Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)   en Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)   en Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()   en Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()   en Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()   en Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()   en Microsoft.SqlServer.Management.Smo.SmoCollectionBase.InitializeChildCollection(Boolean refresh)   en Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetEnumerator()   en SQLAzureMW.ScriptWizard.DisplayDatabases(Server& dbServer, ListBox lb) en C:\Users\Victor\Downloads\SQLAzureMigration v3.7.7 Source\SQLAzureMW\ScriptWizard.cs:línea 1196

seems it doesn't be able to retrieve database info. Im running sql azure as target database.

Aug 26, 2011 at 4:40 PM

Hi George,

I has posted on your codeplex site that I had an issue connecting to the Azure DB and if you don't mind I'd like to take up your offer of contacting you through this?

In answer to your questions:

1)    Are you using SQL Azure as your source database or your target database?

A) I am using Azure as my Source. I wish to back up all of the contents. I only get as far as putting in the Azure DB credentials then press Next - The error generates immeadiately after.

2)    If you use SQL Server as your source and use SQL Server as your target, do you get the same error?

A) If I select an SQL Server database on my local it works without issue. If I try to connect to SQL Azure, that is when I get the Index array error. I tried getting the Migration Wizard to list all DBs but this also failed (same error message).

3)    Are you running SQLAzureMW on top of SQL Server 2008 R2?

I have SQL Server 2008 R2 Express and have done so for the past 3 months without issue.
 
4) SQL Denali

A) I must be honest, I have no idea what SQL Denali is?! I've seen it mentioned on forums after I googled the Error message I was getting and attempted some fixes that it mentioned but none of them worked. I am only trying to connect to SQL Azure and my local PC and vice versa.

I think this is a great tool and a very good answer to disaster recovery for SQL Azure!

Kind Regards,
Cavan Arrowsmith

Coordinator
Aug 26, 2011 at 6:12 PM

Hi Cavan and Victorrt,

 

Can you all do me a favor and download SQLAzureMW v3.7.6 Release Binary and test with that?  The real difference between 3.7.6 and 3.7.7 is that I installed SQL Server 2008 R2 SP1 on my machine and built v3.7.7 on the new bits.  So, v3.7.6 is pre SP1.  So let me know.

 

SQL Denali is the next version of SQL Server.  It is currently available to the public via CTP 3 (http://www.microsoft.com/sqlserver/en/us/future-editions.aspx).  SQL Server Books Online for SQL Denali has some good information (http://msdn.microsoft.com/en-us/library/ms130214(v=SQL.110).aspx).

 

Thanks,

George

Aug 29, 2011 at 8:05 AM
Edited Aug 29, 2011 at 10:09 AM

Same problem with 3.7.6

 

EDIT: Maybe this could help:

http://img819.imageshack.us/img819/849/errormigrationw.jpg

Aug 29, 2011 at 10:59 AM

Hi, I had the same issue as well.

I suspect it was affected by Service Update on SQL Azure.

Coordinator
Aug 29, 2011 at 12:10 PM

Hi All,

I am running SQL Azure out of the North Europe and I don't have any issues.   What datacenters are you all using?

Thanks,
George

Aug 29, 2011 at 12:13 PM
I am using Southeast asia dc.
I refer to batch backup project inside the solution. I found similar error when running the project.

Regards,
Wely

On Aug 29, 2011, at 7:10 PM, "ghuey" <notifications@codeplex.com> wrote:

From: ghuey

Hi All,

I am running SQL Azure out of the North Europe and I don't have any issues. What datacenters are you all using?

Thanks,
George

Aug 29, 2011 at 12:20 PM
Edited Aug 29, 2011 at 12:22 PM

Solved!

It looks since july 2011 update, applications needs sp1 in sql server.

http://blogs.msdn.com/b/windowsazure/archive/2011/07/13/announcing-sql-azure-july-2011-service-release.aspx

http://social.msdn.microsoft.com/Forums/zh/ssdsgetstarted/thread/adcf34ed-7542-4677-8501-8d62bacfca03

Use windows update to upgrade Sql Server 2008

Thanks for your help

Coordinator
Aug 29, 2011 at 12:25 PM

Ok, that would explain why I couldn't reproduce the issue.  Wely and Caven, can you apply SP1 and then retry?  Let me know if that works.

Thanks Victorrt!

George

Aug 29, 2011 at 12:27 PM

I have the same problem with v3.4.1  since about a week and the with  v3.7.7 .

Any help is welcome

Aug 29, 2011 at 12:58 PM
I am actually running the engine on worker role to perform autobackup daily.

I thought as PAAS, azure should take care of applying patch and service pack as well.

Regards,
Wely

On Aug 29, 2011, at 7:26 PM, "ghuey" <notifications@codeplex.com> wrote:

From: ghuey

Ok, that would explain why I couldn't reproduce the issue. Wely and Caven, can you apply SP1 and then retry? Let me know if that works.

Thanks Victorrt!

George

Coordinator
Aug 29, 2011 at 6:56 PM

Hi All,

 

It looks like SQL Azure now requires SP1 (for all applications that use SMO which SQLAzureMW does) to be installed on your machines.  Check out this announcement: http://social.msdn.microsoft.com/Forums/en-CA/ssdsgetstarted/thread/3dd65548-cf58-41e8-804d-3f6873132a7b

 

Preparing for the Service Release: Download updated management tools

As the datacenters get upgraded, the version number of the database engine will increase, which will result in errors when connecting with the SQL Server Management Studio (SSMS) management tool.

 

To prevent experiencing any connectivity issues with management tools, we encourage you to immediately download and install the latest updates to the SQL Server Management Studio (SSMS) tools for managing your SQL Server and SQL Azure databases. The links to get the latest updates available in SQL Server 2008 R2 SP1 are:

·         SQL Server Management Studio

·         SQL Server Management Studio Express

 

Applications that utilize SQL Server Management Objects (SMO) will need to apply the Cumulative Update Package 7 for SQL Server 2008 R2.

If you encounter connectivity issues with SSMS over the next few weeks, please double-check that you have the latest updates. To verify you have the latest version of SSMS, open the tool, click on the help menu, and select ‘About’. You’ll get a dialog box listing version numbers of various SQL Server components. The first row, “Microsoft SQL Server Management Studio” should have a version greater or equal to 10.50.1777.0 once you’ve installed the updates.

 

Regards,

George

Aug 30, 2011 at 2:25 PM

Hi George,

I have downloaded the SQL Server 2008 R2 SP1 Express update and delighted to report that the Migration Wizard is now working once again.

Thankyou George, Wely and Victorrt!