SSMS Error: Invalid Urn filter on server level: filter must be empty, or server attribute must be equal with the true server name. (Microsoft.SqlServer.Smo)

Erwin Anema 1 Reputation point
2022-08-12T15:33:21.913+00:00

When connecting to the listener to the secondary readable replica in SSMS, using the additional connection parameters:
MultiSubnetFailover=True; ApplicationIntent=ReadOnly;Database=MyDatabase

The connection succeeds, but hen I try to script out an index in that database, I get the below error.
The error does not occur when I remove the MultiSubnetFailover=True part from the additional connection parameters.

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

Attempt to retrieve data for object failed for Server 'AGLISTENER.OURDOMAIN'. (Microsoft.SqlServer.Smo)

------------------------------

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.46521.71+(SMO-master-A)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attempt+to+retrieve+data+for+object+Server&LinkId=20476

------------------------------

Program Location:

at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn)
at Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.SfcChildrenDiscovery(HashSet1 discoveredUrns) at Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.Discover(IEnumerable1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.Discover(IEnumerable1 urns) at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List1 urns, ISmoScriptWriter writer) at Microsoft.SqlServer.Management.Smo.ScriptMaker.Script(Urn[] urns, ISmoScriptWriter writer) at Microsoft.SqlServer.Management.Smo.ScriptMaker.Script(Urn[] urns) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ScriptGenerator.ScriptCreate(SqlTextWriter sqlwriter, Server server, Urn[] urns, ScriptingOptions options, Func1 onScriptComplete)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ScriptNodeActionContext.<>c__DisplayClass8.<ScriptWithProgress>b__4()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

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

Invalid Urn filter on server level: filter must be empty, or server attribute must be equal with the true server name. (Microsoft.SqlServer.Smo)

------------------------------

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.46521.71+(SMO-master-A)&LinkId=20476

------------------------------

Program Location:

at Microsoft.SqlServer.Management.Smo.Server.CheckValidUrnServerLevel(XPathExpressionBlock xb)
at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn)
at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn)
at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn)
at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn)
at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn)

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,774 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2022-08-16T06:54:21.61+00:00

    Hi @Erwin Anema ,

    Did the client provider that support ApplicationIntent and MultiSubnetFailover parameters? Refer to MS document Driver and client connectivity support for availability groups.

    If it is still not work, please refer to below MS document to troubleshoot this issue.

    Read-Only Routing is Not Working Correctly

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Erwin Anema 1 Reputation point
    2022-08-19T05:42:30.747+00:00

    Hi Cathyji-msft,

    Thanks for your feedback.

    I've checked via help-about that the client driver update you referred to in your link has been installed:
    Microsoft .NET Framework 4.0.30319.42000.

    From my perspective:
    -I'm able to connect both with the multisubnet both on true and on false.
    -I'm able to query tables; read-only routing works fine.
    Therefore, the basic connectivity in SSMS seems to be working fine.

    Is is only when the script-out functionality is used that the error occurs.
    For me it feels like that SSMS sets up a new temporary connection for the script-out function, and there is some issue in setting that up.

    0 comments No comments