4

I have some legacy piece of code in some old 5.3 templates which has been migrated to SDL Web 8. The offending piece of C# is as follows:

 String publishItemsXML = publication.GetListPublishItems(uriTarget, false, false, TDSDefinesInterop.ListColumnFilter.XMLListDefault, listRowFilter);

This fails with the following errors

ERROR #1

User 'DOMAIN\MTSUser' is not authorized. Current user must have at least one of the following 'ReadOnly, ReadOnlyService, Administrator' Topology Manager role(s) to perform current action.

Component: Tridion.TopologyManager.Service
Errorcode: 0
User: NT AUTHORITY\NETWORK SERVICE

ERROR #2

Unable to resolve the items to be (un)published.
{
  "error":{
    "code":"","message":"Authorization has been denied for this request."
  }
}

Error Code:
0x80040000 (-2147221504)

Call stack:
Microsoft.OData.Client.QueryResult.ExecuteQuery()
Microsoft.OData.Client.DataServiceRequest.Execute(DataServiceContext,QueryComponents)
Microsoft.OData.Client.DataServiceQuery`1.Execute()
Microsoft.OData.Client.DataServiceQuery`1.GetEnumerator()
System.Linq.Enumerable+WhereEnumerableIterator`1.MoveNext()
System.Collections.Generic.List`1..ctor(IEnumerable`1)
System.Linq.Enumerable.ToList(IEnumerable`1)
Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublicationIdToMappingsLookup(Session,IEnumerable`1,IList`1)
Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublishContextsPerSourcePublication(IEnumerable`1,IEnumerable`1,IEnumerable`1,Boolean)
Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublishContexts(IEnumerable`1,IEnumerable`1,IEnumerable`1,Boolean)
Tridion.ContentManager.BLFacade.Publishing.ResolveEngineFacade.GetListPublishItems(UserContext,String,String[],Boolean,Boolean,ListColumnFilter,String)
Publication.GetListPublishItems


Component: Kernel
Errorcode: 0
User: DOMAIN\MTSUser

ERROR #3

TemplateUtilities: Yes this caused the error:<?xml version="1.0" standalone="yes"?>
<tcm:Error ErrorCode="80040000" Category="18" Source="Kernel" Severity="1" xmlns:tcm="http://www.tridion.com/ContentManager/5.0"><tcm:Line ErrorCode="80040000" Cause="false" MessageID="15734"><![CDATA[Unable to resolve the items to be (un)published.]]></tcm:Line><tcm:Line ErrorCode="80040000" Cause="true"><![CDATA[{
  "error":{
    "code":"","message":"Authorization has been denied for this request."
  }
}]]></tcm:Line><tcm:Line ErrorCode="80040000" Cause="false"><![CDATA[An error occurred while processing this request.]]></tcm:Line><tcm:Details><tcm:CallStack><tcm:Location>Microsoft.OData.Client.QueryResult.ExecuteQuery()</tcm:Location><tcm:Location>Microsoft.OData.Client.DataServiceRequest.Execute(DataServiceContext,QueryComponents)</tcm:Location><tcm:Location>Microsoft.OData.Client.DataServiceRequest.Execute(DataServiceContext,QueryComponents)</tcm:Location><tcm:Location>Microsoft.OData.Client.DataServiceQuery`1.Execute()</tcm:Location><tcm:Location>Microsoft.OData.Client.DataServiceQuery`1.GetEnumerator()</tcm:Location><tcm:Location>System.Linq.Enumerable+WhereEnumerableIterator`1.MoveNext()</tcm:Location><tcm:Location>System.Collections.Generic.List`1..ctor(IEnumerable`1)</tcm:Location><tcm:Location>System.Linq.Enumerable.ToList(IEnumerable`1)</tcm:Location><tcm:Location>Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublicationIdToMappingsLookup(Session,IEnumerable`1,IList`1)</tcm:Location><tcm:Location>Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublishContextsPerSourcePublication(IEnumerable`1,IEnumerable`1,IEnumerable`1,Boolean)</tcm:Location><tcm:Location>Tridion.ContentManager.Publishing.Resolving.ResolveEngine.GetPublishContexts(IEnumerable`1,IEnumerable`1,IEnumerable`1,Boolean)</tcm:Location><tcm:Location>Tridion.ContentManager.BLFacade.Publishing.ResolveEngineFacade.GetListPublishItems(UserContext,String,String[],Boolean,Boolean,ListColumnFilter,String)</tcm:Location><tcm:Location>Publication.GetListPublishItems</tcm:Location></tcm:CallStack></tcm:Details></tcm:Error>


Component: Templating
Errorcode: 0
User: NT AUTHORITY\NETWORK SERVICE

The first of the 3 errors seems to be the key. Is there a way to make this work? Or is my legacy code (which uses interop) not going to work with the new topology manager code?

3
  • you can try to add this user to Topology Manager Administrators group which is configured in topology manager web.config or has the same name in windows groups if it is default. Commented Apr 14, 2016 at 6:09
  • Sounds like an Answer, Stanislav. :-) Commented Apr 14, 2016 at 6:18
  • Unfortunately I already tried that :( I did try enabling the legacy publishing target functionality, and it works fine there. Could it be that Topology Manager functionality simply will not work with old legacy COM Interop APIs? Commented Apr 14, 2016 at 14:06

1 Answer 1

1

Using Topology Manager based publishing in combination with Legacy Templates should be possible. The trickiest thing is that legacy TOM API based code runs in the SDL Web COM+ Application whichs typically runs under an identity which is not authorized to access Topology Manager.

You can see that all errors are related to authorization. You may want to double-check if the DOMAIN\MTSUSER account has been correctly configured as Topology Manager (Service) User.

Sometimes a reboot does miracles... :-)

3
  • Thanks Rick, I added the MTSUser to the three default Windows Groups on the CMS Server (Topology Manager Administrators, Topology Manager Service Users and Topology Manager Users), and rebooted the machine, and still no luck :( Commented Apr 14, 2016 at 18:52
  • Weird... Is your Windows domain really called DOMAIN ? Commented Apr 15, 2016 at 6:42
  • nope, I just removed the client specific reference. Commented Apr 15, 2016 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.