Error upgrading components on server

needbrewneedbrew Posts: 5
edited July 20, 2007 11:17AM in SQL Backup Previous Versions
I was trying to do an upgrade and keep getting hte following error.

System.InvalidCastException: Object cannot be cast from DBNull to other types.
at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at _16._1(SqlConnection , _17 , Int32& , String& , Int32& )
at _16._1(SqlConnection , Int32& , String& )
at _16._1(Server , Int32& , String& )
at RedGate.SQLBackup.Engine.Server._10()
at RedGate.SQLBackup.Engine.Server.RefreshServerInformation()
at RedGate.SQLBackup.Engine.Server.OpenConnection()

What can I do to connect the client to this server without the error?

Comments

  • Eddie DEddie D Posts: 1,780 Rose Gold 5
    Hi

    Sorry that you are getting this error.

    I have a few questions for you:

    1. What version of SQL Backup are you upgrading from?

    2. Is this error occurring during GUI installation or during the server components installation?

    3. At what point of the installation does the error occur?

    Many Thanks
    Eddie

    Eddie Davis
    Red Gate Software Ltd
    Technical Support
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Hi,

    I am upgrading from 4.x to the latest. I have 9 other servers that had no problem. The error occurs when the upgraded client tries to connect to the server. I right clicked the server and did an install/upgrade components. Once completed I cannot connect to that server from the client anymore. The client is not on the server.

    Thanks

    Mike
  • I'm getting the exact same error in SQL Backup 5.1. The instances I'm trying to upgrade have 4.6 installed but I continue to get the

    System.InvalidCastException: Object cannot be cast from DBNull to other types.
    at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ToInt32(Object value)
    at _16._1(SqlConnection , _17 , Int32& , String& , Int32& )
    at _16._1(SqlConnection , Int32& , String& )
    at _16._1(Server , Int32& , String& )
    at RedGate.SQLBackup.Engine.Server._10()
    at RedGate.SQLBackup.Engine.Server.RefreshServerInformation()
    at RedGate.SQLBackup.Engine.Server.OpenConnection()

    when trying to make a connection to these instances from my 5.1 client. However, not all instances on this server get the error. The defualt and one instance on the same server upgraded without a problem.

    The server these SQL Instances reside on is a Virtual server with 5 SQL instances, but the OS for this virtual instance is a 64 bit version, not 32. Not sure if this is the problem since two instances work just fine.

    Kevin Z.
  • Eddie DEddie D Posts: 1,780 Rose Gold 5
    Hi

    I’ve discussed your issue with the development team, and the reason the issue is occurring is because one of the two sources of backup/restore history – the v5 datastore (which wouldn’t apply to a v4.6 server components installation) or the msdb tables (which are imported when a server is first registered in the v5 GUI) is returning an unexpected value (a NULL instead of an int32), which will cause the problem described.



    Ideally, from a testing/development perspective, the following information would be useful to try and diagnose where the issue is arising from:



    · A profiler trace, which contains an “attempt” to connect to the server (that is, a server refresh in the GUI), to identify what is and isn’t being called.

    · If possible a copy of the output of the following queries (the backup and restore tables from the msdb database):



    SELECT * FROM msdb..backupfile;

    SELECT * FROM msdb..backupfilegroup;

    SELECT * FROM msdb..backupmediafamily;

    SELECT * FROM msdb..backupmediaset;

    SELECT * FROM msdb..backupset;



    SELECT * FROM msdb..restorefile;

    SELECT * FROM msdb..restorefilegroup;

    SELECT * FROM msdb..restorehistory;

    If you are not willing to do this, that’s understandable (confidentiality reasons etc etc), but the quickest workaround is to remove the backup and restore history from the database (DELETE FROM for each of the 8 databases above, may have to repeat them multiple times in turn to eliminate any key dependencies – obviously take a backup first etc etc).

    If you are willing to perform the above, can you please send the requested information to support@red-gate.com and title the message Call F0004534.

    If that doesn’t fully resolve it, they may need to also remove the GUI cache data files (with the GUI closed) from C:\Documents and Settings\<user_name>\Local Settings\Application Data\Red Gate\SQL Backup\Server Data\ - this will require the GUI to refetch any backup and restore information from the relevant SQL Server instances when the GUI next starts (but the customer will not need to re-register the servers, that’s stored elsewhere).

    Many Thanks
    Eddie

    Eddie Davis
    Red Gate Software Ltd
    Technical Support
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • I am receiving this error after upgrading to 5.1 in the GUI engine.

    System.InvalidCastException: Object cannot be cast from DBNull to other types.
    at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ToInt32(Object value)
    at _16._1(SqlConnection , _17 , Int32& , String& , Int32& )
    at _16._1(SqlConnection , Int32& , String& )
    at _16._1(Server , Int32& , String& )
    at RedGate.SQLBackup.Engine.Server._10()
    at RedGate.SQLBackup.Engine.Server.RefreshServerInformation()
    at RedGate.SQLBackup.Engine.Server.OpenConnection()


    Have followed the steps outlined in this posting with no success. (
    1): Deleting records in msd tables
    (2) removing entries from my documents folder

    It appears that this error is only related to the GUI tool and not the master..sqlbackup procedure. All of our scheduled jobs which use this procedure are working. Our GUI is the one having issues with this error. Some of instances have this error and siome do not. Any idea what could be the issue? Any other work arounds?
  • Eddie DEddie D Posts: 1,780 Rose Gold 5
    Looks like it failed to update the xp_sqlbackup.dll from the 4.6 to the 5.0 dll. Restarting the SQL Servers and immediately installing SQL Backup 5 solves the problem – the problem is actually down to SQL Server not playing nicely when we run DBCC xp_sqlbackup(FREE) in that it doesn’t actually release the DLL.

    Many Thanks
    Eddie Davis
    Red Gate Software Ltd
    Technical Support
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.