locked
Value cannot be null in 2008 R2 SSMS / Studio Package failed to load. RRS feed

  • Question

  • SSMS now gives me this error when I start it in 2008 R2 x64 on windows 7 x64 (possibly caused by installing windows live, or the latest windows security updates):

    Additionally, I am unable to open any databases, or even see them in SSMS explorer.

    (NOTE: Repair does NOT correct.)

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

    Value cannot be null.
    Parameter name: viewInfo (Microsoft.SqlServer.Management.SqlStudio.Explorer)

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

       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ExplorerViewDescriptor..ctor(IFactoryService factoryService, INavigationViewInfo viewInfo, String urnPath, IDictionary`2 allEntities)
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.GetView(String urnPath)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.<GetColumnsFromNavigationService>d__f.MoveNext()
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.AddFields(List`1 list, IEnumerable`1 fields, IDictionary`2 allValidFields, AddFieldsFlags flags)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.GetParentFields(INodeInformation source, Dictionary`2& allValidColumns)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)

     

    • Edited by TechVsLife2 Monday, October 18, 2010 12:21 AM
    Sunday, October 17, 2010 3:46 AM

Answers

  • So i digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the missing directory causes the "Value cannot be null" error.

    My missing file name was:
    C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
    But the file name changes on every startup.
    So my missing directory name was:
    C:\Users\<username>\AppData\Local\Temp\2
    After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.

    I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"

    Hope this helps other people to solve their issues too.
    • Proposed as answer by Naomi N Wednesday, December 1, 2010 2:13 PM
    • Marked as answer by Naomi N Tuesday, July 8, 2014 3:53 PM
    Wednesday, December 1, 2010 10:42 AM
  • It sounds to me you may be left to re-installing SQL Server from scratch :( First you'll need a clean un-install, then re-install.
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    • Marked as answer by TechVsLife2 Monday, October 18, 2010 6:10 AM
    Monday, October 18, 2010 3:22 AM
  • Uninstalling and reinstalling sql server solved the problem.  Fortunately a "dirty" uninstall was enough: all I had to do was uninstall and reinstall SSMS only (not the engine or any other feature).  (I also reapplied CU3, but it worked even without CU3.)

    • Marked as answer by TechVsLife2 Monday, October 18, 2010 11:45 PM
    Monday, October 18, 2010 6:10 AM

All replies

  • Whats the operation done in SSMS to get this error? I would put profiler and check the query being fired. There is some property which is not expected to be null but returned as null (such as database owner)

    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Sunday, October 17, 2010 5:38 AM
  • No query is being fired.  This is an error when starting SSMS.
    Sunday, October 17, 2010 5:48 AM
  • even before connecting to SQL engine?


    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Sunday, October 17, 2010 6:10 AM
  • No, it's right after pressing "connect" in the dialog box that pops up whenever you start SSMS.  (I think it's an SSMS issue, not an engine issue, because no other program gives an error connecting, e.g. MS Access can connect and open up tables in the sql server database via odbc.)

    Profiler doesn't seem to show anything of note, things look normal there--how would I check to see if nulls were returned. 

     

    Note that profiler/tracer does NOT add any new listings when I navigate in ssms explorer and try to show any databases, including system databases, even though the same "value cannot be null" error is returned then by ssms. So it doesn't seem like a query or the engine is at issue. (Listings are added in profiler/tracer when I first open up SSMS only, but the same "value cannot be null" SSMS error is triggered when I try to browse in SSMS explorer.)
    Sunday, October 17, 2010 6:21 AM
  • I also believe this is SSMS issue but may be specific to this instance. Other tools (MS Access, ODBC) fire different queries and they don't have same functionality as SSMS.

    What happens if you use same SSMS to connect to other database engine (instance)? does that also show null error?

    You are correct, one you hit connect, we would populate most of the 1st level nodes in SSMS. I would suggest you to take profiler trace and run those queries within the query and check if there is some thing unusual.

    Is there any error on Errorlog?


    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Sunday, October 17, 2010 7:33 AM
  • I don't have any other instance of sql server installed.  I didn't see anything unusual in profiler, but not sure what would be unusual. 

    There is no error in errorlog but there is no errorlog folder for 10.5 (r2); there is an errorlog folder for 10.0 which seems to update for 10.5, and the only thing that comes close there is this:
    The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.

    This looks related (where the workaround is to add permisssions for the user that installed sql server):
    http://social.msdn.microsoft.com/Forums/en/sqltools/thread/2afbd7a3-a13a-4f7a-9bb0-917bccd4cbdb

    However, adding full permissions for the current user (who installed sql server) made no difference, and I am not sure for whom else they want me to add permissions.

     

     

    Sunday, October 17, 2010 4:19 PM
  • When I run the text of the individual queries from profiler/tracer in the SSMS query window, there were no errors (and no nulls returned for any column), so the bug seems unrelated to any queries being sent.  Unfortunately, I can't use edit or use any databases in SSMS until this is resolved.

     

    btw, the column "LogOnSuccess" for the query below (from tracer/profiler) returns a zero. (The computer name is "MYPCNAME"), but that is probably not an error (the computer is running as a local desktop, not as part of a domain). exec sp_executesql N'SELECT ''PolicyStore[@Name='' + quotename(CAST(serverproperty(N''Servername'') AS sysname),'''''''') + '']'' AS [Urn], CAST(serverproperty(N''Servername'') AS sysname) AS [Name], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''Enabled'') AS bit) AS [Enabled], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''HistoryRetentionInDays'') AS int) AS [HistoryRetentionInDays], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''LogOnSuccess'') AS bit) AS [LogOnSuccess] WHERE (CAST(serverproperty(N''Servername'') AS sysname)=@_msparam_0)',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'MYPCNAME'
    Sunday, October 17, 2010 6:15 PM
  • are you sure the build of SSMS is in sync with the engine you are trying to connect to?

    If you are using an older build of SSMS and a newer server, you can get this kind of error.  

    SSMS is usually backwards compatible (newer build of SSMS works against older server), but it's pretty much never forwards compatible (old build of SSMS and new server).


    elsasoft.org
    Sunday, October 17, 2010 6:48 PM
  • I hope there's some other solution short of a reformat of the computer and reinstall of the os.

    @jezemine:  It looks like they are in perfect sync, but let me know if there is some way of determining it other than this:

    This is what I get in help about in SSMS:

    Microsoft SQL Server Management Studio      10.50.1734.0
    Microsoft Analysis Services Client Tools      10.50.1734.0
    Microsoft Data Access Components (MDAC)      6.1.7600.16385
    Microsoft MSXML      3.0 6.0
    Microsoft Internet Explorer      8.0.7600.16385
    Microsoft .NET Framework      2.0.50727.4952
    Operating System      6.1.7600

    This is what the query window returns for the engine:
    SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
    Returns this:
    10.50.1734.0 RTM Enterprise Edition (64-bit)

    Sunday, October 17, 2010 7:13 PM
  • So, your version seems newer, how and where did you get it?
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    Hey Naomi,
    10.50.1734 is SQL 2008 RTM CU3 http://support.microsoft.com/kb/2261464



    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Sunday, October 17, 2010 9:37 PM
  • I'm using the latest update to sql server R2, CU3.  But I doubt that's the cause of the problem, since I had that installed months ago and the problem with sql server began only this weekend. 

     

     

    Sunday, October 17, 2010 10:46 PM
  • UPDATE:
    I uninstalled redgate utility tools (for sql server). 
    Then I uninstalled CU3 (cumulative update), re-repaired sql 2008 R2 x64, and then tried running SSMS.
    I also tried re-installing CU3, and then running SSMS.

    The result in both cases is the same:
    When I run SSMS, I now get two message information boxes, one after the other.
    The first says:
    Package 'Microsoft Sql Management Studio Package' failed to load. 
    After pressing 'OK' (actually it's not 'ok,' but I don't get another choice):
    The second one then pops up with the additional information that:
    Package 'Microsoft Sql Management Studio Package' failed to load.

    The first one has a yellow triangle containing a big black exclamation point.
    The second one however has a red circle containing a big white X.
    I'm sure that must have some significance.

    Then the SSMS window abruptly shuts down.

    (Is this progress?  Before this attempt, SSMS did stay open, now it closes on me after the message boxes.  However, the new error message is a change, and change is like hope.)

     

    Monday, October 18, 2010 12:19 AM
  • I don't know when precisely, but not more than a few days. unfortunately a windows restore rollback did not solve the problem.
    Monday, October 18, 2010 3:16 AM
  • It sounds to me you may be left to re-installing SQL Server from scratch :( First you'll need a clean un-install, then re-install.
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    • Marked as answer by TechVsLife2 Monday, October 18, 2010 6:10 AM
    Monday, October 18, 2010 3:22 AM
  • Uninstalling and reinstalling sql server solved the problem.  Fortunately a "dirty" uninstall was enough: all I had to do was uninstall and reinstall SSMS only (not the engine or any other feature).  (I also reapplied CU3, but it worked even without CU3.)

    • Marked as answer by TechVsLife2 Monday, October 18, 2010 11:45 PM
    Monday, October 18, 2010 6:10 AM
  • I have the same problem ( "Value Cannot be Null Error" on SSMS 2008 R2 on x64 machine) .  It seems to be related to a SQL Server failure for one of my Registered Server Instances.  Now SSMS does not want to cooporate at all (show any database info).  I will try to reinstall SSMS.  Unless someone knows how I can unregister a server without being able to bring up Registered Servers under view Registered Servers.  The latter was giving me an error, now it just gives me a blank screen.

    .

    Monday, November 22, 2010 6:18 PM
  • So i digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the missing directory causes the "Value cannot be null" error.

    My missing file name was:
    C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
    But the file name changes on every startup.
    So my missing directory name was:
    C:\Users\<username>\AppData\Local\Temp\2
    After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.

    I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"

    Hope this helps other people to solve their issues too.
    • Proposed as answer by Naomi N Wednesday, December 1, 2010 2:13 PM
    • Marked as answer by Naomi N Tuesday, July 8, 2014 3:53 PM
    Wednesday, December 1, 2010 10:42 AM
  • I'm running Windows 7 and got same problem.

    I've run SSMS as Administrator and everything worked fine.

     

    PS I've gold rule of mine if you have any issues running any application on OS with UAC - use Run As Administrator.

    Tuesday, December 14, 2010 10:37 PM
  • So i digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the missing directory causes the "Value cannot be null" error.

    My missing file name was:
    C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
    But the file name changes on every startup.
    So my missing directory name was:
    C:\Users\<username>\AppData\Local\Temp\2
    After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.

    I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"

    Hope this helps other people to solve their issues too.

    I had the same issue and adding the folder "2" resolved this for me. Thanks!
    • Proposed as answer by Naomi N Thursday, April 26, 2012 3:35 PM
    Wednesday, June 22, 2011 2:24 PM
  • I looked eventlogs and C: disk was full. I cleaned. And problem was solved. that's all!
    F.Ü.
    • Proposed as answer by Naomi N Monday, December 26, 2011 2:11 PM
    Monday, December 26, 2011 8:21 AM
  • Hi,

    Create empty directory with the name "2" in %TEMP% fix this problem for me too!

    • Proposed as answer by Naomi N Thursday, April 26, 2012 3:35 PM
    Thursday, April 26, 2012 1:45 PM
  • Hi TechVsLife2,

    Excuse my ignorance, new to SQL server. I had the same issue, but not sure what the actual error was, just wondering how to get those stack trace you had listed above.

    Thanks in advance.

    Regards,
    SN

    Tuesday, May 29, 2012 3:15 AM
  • I followed your instructions and trust me... by Lords Name everything worked..... 

    All you need to do is press the windows key + R, type in %TEMP%

    create a new folder named "2" in the %TEMP% folder... 

    Open SSMS...

    Bingo that works fine... everything is back as normal... :) 

    Thursday, May 31, 2012 11:37 PM
  • I know I am late in the game but someone repoted same issue internally and I worked with him.

    During troubleshooting we found that TEMP and TMP folders are pointing to invalid location. I have also added comment to connect item also.

    <snip>

    The most common cause of error would be %TEMP% and %TMP% are pointing to location which is not valid. If  you have SQL Server 2008 management studio on same machine, you would see below error.

    The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)

    If you face same error, then make sure that start>run>%temp% and start>run>%tmp% are working fine. 

    </snip>

    http://connect.microsoft.com/SQLServer/feedback/details/573771/value-cannot-be-null


    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog | Team Blog | @Twitter

    Friday, July 20, 2012 6:55 AM
  • Hi,

    I am running SSMS 2008 R2 on Windows 8. It worked all fine until a few days ago, when it stopped working. I now get "value can not be null" error.  I have

    • Checked that %TEMP% and %TMP% point to valid locations
    • Run it in admin mode
    • Created a folder name "2" in %TEMP%
    • Uninstalled & reinstalled SSMS

    When I try to repair the installation I get the following error:

    "Error 1316. A network error occurred while attempting to read from the time c:\058b0c84925255ea9000c2acecc8\1033_ENU_LP\x64\setup\SSCERuntime_x86-enu.msi"

    The repair process then reports that the following steps failed:

    • Management Tools - Basic
    • Microsoft Sync Framework
    • SQL Compact Edition Runtime

    The others were successful.

    Friday, November 9, 2012 2:09 PM
  • Hi,

    I had the same problem and i did the following:

    goto to %appdata%\Microsoft\Microsoft SQL Server\100\Tools and rename Shell folder to Shell_1

    goto C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\      or  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\

    and backup machine.config  file

    open machine.config and delete from <system.serviceModel> to </system.serviceModel> tag

    execute Sql manager studio

    Hope that works for you.

    Wednesday, January 9, 2013 9:25 PM
  • Hi,

    I have the similar when I did in-place upgrade of SQL Server 2005 SP3 to SQL Server 2008R2.

    Go to C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\ and replace the machine.config with machine.config.default.

    Good luck !

    Thursday, January 24, 2013 3:47 AM
  • For me it was : empty space on C drive. Check that.
    Thursday, October 17, 2013 6:18 PM
  • Thanks it´s works
    Tuesday, July 8, 2014 8:24 AM
  • it worked for me by restarting the SQL server services

    so i restart the service of the SQL instance 

    Wednesday, March 18, 2015 6:39 AM
  • https://connect.microsoft.com/SQLServer/feedback/details/573771/value-cannot-be-null

    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

    Thursday, March 19, 2015 7:35 AM
  • Great, but for some or other reason I had to create a folder with the name 16.
    Wednesday, March 30, 2016 5:08 AM
  • This worked for me out of the gate, without researching if the directory was a different name. Good find!
    Tuesday, December 26, 2017 3:57 PM
  • Clearing cache files from temp folder will work.

    Put %temp% in RUN and delete all files...

    Friday, July 20, 2018 1:45 PM