Forum Discussion

Namassivaya's avatar
Namassivaya
Copper Contributor
Oct 27, 2021

"Object reference not set to an instance of an object. (SqlManagerUI)"

I have installed SSMS 18.10 and I have connected to Azure SQL Managed Instance, then trying to edit

SQL Agent Job always failing to open and resulting is this error

"Object reference not set to an instance of an object. (SqlManagerUI)". Here is the full error.

 

Object reference not set to an instance of an object. (SqlManagerUI)

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

at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.OnDeselecting(Object sender, TabControlCancelEventArgs e)
at System.Windows.Forms.TabControl.OnDeselecting(TabControlCancelEventArgs e)
at System.Windows.Forms.TabControl.WmSelChanging()
at System.Windows.Forms.TabControl.set_SelectedIndex(Int32 value)
at System.Windows.Forms.TabControl.ControlCollection.Remove(Control value)
at System.Windows.Forms.Control.ControlCollection.Clear()
at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.InitializeControls()
at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition..ctor(CDataContainer dataContainer, IMessageBoxProvider messageProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems.CreateJobStepSubSystemSsis(AgentSubSystem agentSubSystem, CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems.CreateJobStepSubSystem(AgentSubSystem agentSubSystem, CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider, IServiceProvider serviceProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems..ctor(CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider, IServiceProvider serviceProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.get_SubSystems()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.FilterStepCombo(DatabaseEngineEdition engineEdition)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeStepCombo()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeData()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.OnInitialization()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(ISqlControlCollection control, IServiceProvider provider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobSteps.OnDoubleClick(Object sender, MouseButtonDoubleClickedEventArgs args)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.OnMouseButtonDoubleClicked(HitTestResult htArea, Int64 nRowIndex, Int32 nColIndex, Rectangle rCellRect, MouseButtons btn, GridButtonArea headerArea)
at Microsoft.SqlServer.Management.SqlManagerUI.SqlManagerUIDlgGrid.OnMouseButtonDoubleClicked(HitTestResult htArea, Int64 rowIndex, Int32 colIndex, Rectangle cellRect, MouseButtons btn, GridButtonArea headerArea)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.OnMouseDown(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

  • erinstellato's avatar
    erinstellato
    Feb 12, 2024
    adamoumagaji I do not have that issue with SSMS 19.3, which is the latest release. Can you please try with SSMS 19.3? Thanks.
    • nstratton's avatar
      nstratton
      Copper Contributor
      erinstellato link above actually downloaded v19 which also works. Nicer to go forward than backward!
  • blogg1920's avatar
    blogg1920
    Copper Contributor
    Same for me, just for SQL Managed Instance. I also thought I would try logging in with SQL Auth as well as AAD just to see. Both the same error. When editing the job step the error is thrown.
    • blogg1920's avatar
      blogg1920
      Copper Contributor
      I am having to script out with a drop and create to now to make those changes, which is time consuming all in all
  • AgentKnipe's avatar
    AgentKnipe
    Copper Contributor
    I am also having the same problem, id really like to not have to drop and recreate jobs to make minor changes
  • RickyJ1967's avatar
    RickyJ1967
    Copper Contributor

    NamassivayaI too downloaded SSMS 18.10 today and I'm getting exactly the same issue but it's only on Managed Instance SQL servers, I can see the properties of job steps on other VM's and "On Prem" servers.  Highly frustrating, especially when we keep getting notifications from Microsoft to update.  😞

  • Namassivaya's avatar
    Namassivaya
    Copper Contributor

    I tried these steps as a work around

    1. uninstalled ssms 18.10 version

    2. reboot my laptop

    3. installed ssms 18.5 version

    4. Right click on SSMS.exe " Run as administrator"

    These above steps solved my issue.

    • erinstellato's avatar
      erinstellato
      Icon for Microsoft rankMicrosoft
      Hi Leonardo_Cursi - can you please provide the steps to recreate? I just tested with 19.1 against Managed Instance with the following steps:

      1. I created a new SQL Agent job that had one step - it just runs a simple select statement (SELECT @@VERSION).
      2. I saved the job, and then manually executed it to make sure it worked. (It did.)
      3. I then right-clicked on the job and selected Properties.
      4. In the properties window, I went to the Steps page, selected the job step, and then selected Edit.
      5. I modified the script (added another query - select * from msdb.sys.databases) and then selected OK.
      6. I selected OK again from the properties window, and then ran the job again.

      I did not encounter any errors. If you are able to share your exact steps, that would be helpful to try and recreate the issue here. Thank you.
      • Leonardo_Cursi's avatar
        Leonardo_Cursi
        Copper Contributor
        I'm ashamed for the delay but I missed your response, Erin. Excuse me.

        I followed the suggestions and the two executions were successful. I'm trying to connect to an old 2014 version even though I get, not always to be honest, the same error with sql 2017. In 2014 I get it in this particular error when I try to add a securable to a sql login (I choose the db, expand the security section, right click on the sql login). I'm sysadmin of that instance.


        I report the error I get in the advanced information.:

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

        Object reference not set to an instance of an object. (SqlMgmt)

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

        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsData.Securable.GetImage(SecurableType type)
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector.InitializeBitmaps()
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, PermissionsDetailsGrid permissionsGrid, Object connectionInfo, Boolean yukonOrGreater)
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore.InitializeSecurableSelector()
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, Object connectionInfo, Boolean yukonOrGreater, Boolean showColumnPermissionsInDetailsGrid)
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.InitializePermissionsCore()
        at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.OnInitialization()
        at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
        at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
        at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
        at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
        at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
        at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
        at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()
    • Tessa_new's avatar
      Tessa_new
      Copper Contributor
      Hi, I have this error message after adjusting some Securables on a Database Role and then trying to open Securables again. The same or others, makes no difference.
      Using SSMS 19.1 via citrix published apps with RunAs.
      I was able to open the Securables at first and added a table and stored procs but wasn't able to open it again to see if my changes were there. Got this error on every attempt, even on different DB connections or different roles.
      After closing and restarting my SSMS I can see my result and adjust a role again. After clicking OK when done with my adjustments the window closes and after that the message appears again on every attempt.
      Details:
      Object reference not set to an instance of an object. (SqlMgmt)

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

      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsData.Securable.GetImage(SecurableType type)
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector.InitializeBitmaps()
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, PermissionsDetailsGrid permissionsGrid, Object connectionInfo, Boolean yukonOrGreater)
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore.InitializeSecurableSelector()
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, Object connectionInfo, Boolean yukonOrGreater, Boolean showColumnPermissionsInDetailsGrid)
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.InitializePermissionsCore()
      at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.OnInitialization()
      at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
      at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.OnBeforeSelection(Object sender, TreeViewCancelEventArgs e)
  • justinbutler's avatar
    justinbutler
    Copper Contributor
    Downloaded 18.10 yesterday and also having issues. Lame. 😕 I uninstalled my whole redgate suite thinking it was one of the addon extensions that was causing the issue. Bad for productivity.
  • Jakub Urban's avatar
    Jakub Urban
    Copper Contributor

    Namassivaya Same here. Very annoying.

    Anyway, 18.9.2 is ok, just tested, no need to run as admin, works fine even with AAD+MFA auth. 

  • Carl_Ripa's avatar
    Carl_Ripa
    Copper Contributor
    This happens to me too. Worked well in v.18.9.2 then after updating to v.18.10 I can't create new steps in jobs, nor edit old ones. Have even tried to reinstall to old version (uninstall 18.10 and then install 18.9.2) but it still fails. Weird thing here is that in the splash screen when starting up it says v.18.9.2, but if I look in the about section it still says v.18.10.
      • Carl_Ripa's avatar
        Carl_Ripa
        Copper Contributor

        cbarroso Yes that worked for when uninstalling a second time, also removing files in %AppData%. No idea what happened the first time. 

        Another note is that it seems to work fine in 18.10 if connected to a SQL Server on Linux (maybe other instances as well). But Azures Managed Instances does not work.

  • rmeldrum's avatar
    rmeldrum
    Copper Contributor
    You need to be mindful of which SQL server you are connecting to in Azure as they don't all have the same features.

    The SQL Agent on SQL-managed instances is very similar to SQL Server. SQL Agent is not available in Azure SQL Database
    • vcannady123's avatar
      vcannady123
      Copper Contributor
      Hello I am using latest version on Management Studio with Azure DB , trying to import a .large .csv file as a flat file after spending hours changing data types I finally get all accepted when I get a Object Reference error and cannot create the .dbo which is different than everyone else's Object Reference Error. Please help I may lose a client over this
      • erinstellato's avatar
        erinstellato
        Icon for Microsoft rankMicrosoft
        This is a completely separate issue that originally reported and should be created as a separate issue. If you do that, feel free to share the link here, but you need to provide step-by-step instructions to recreate the error. The information provided above is not detailed enough to try and recreate what you're seeing. Specifically, are you using Import Flat File, or are you using Import Data (from the right-click menu on the database, after selecting Tasks)? If you're using Import Data, are you select Flat File Source for the Data Source, and then what options are you selecting on the General tab? On the Destination page, what data source are you selecting and how are you authenticating? What changes are you making to the data type mapping and can you provide a sample file that is anonymized? Thanks.

Resources