May 16, 2013

SharePoint 2013: Visio Graphics Service "Failed to access the cache"

Problem

Visio Graphs are not working on SharePoint 2013, you will see generic error message in Visio Web Part and the following error messages in Windows Application Log.

Log Name:      Application
Source:        Microsoft-SharePoint Products-Visio Graphics Service
Event ID:      9004
Task Category: Web Access
Level:         Warning
Description:
Failed to access the cache.


---

Log Name:      Application
Source:        Microsoft-SharePoint Products-Visio Graphics Service
Event ID:      8079
Task Category: Graphics Service
Level:         Error
User:          AD\svc_sp_serviceapppoo
Description:
Failed to generate raster diagram for file
http://intranet/Documents/MyVisio.vsdx page Image0 Error : System.IO.FileNotFoundException: E:\Program Files\Microsoft Office Servers\15.0\Data\VisioServer\VisioCache372264ef-b563-434d-bee0-11dede201c0b\VisioBundle637d234b68df44f8b5957a482056ef00.cache   at Microsoft.Office.Visio.Server.GraphicsServer.DiskCache.ReadBundlePart(Bundle bundle, Int32 index)
   at Microsoft.Office.Visio.Server.GraphicsServer.ServiceCore.GetRasterPageItem(RasterPageItemRequest request)
   at Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsService.GetRasterPageItem(RasterPageItemRequest request)


---

Log Name:      Application
Source:        Microsoft-SharePoint Products-Visio Graphics Service
Event ID:      8078
Task Category: Web Access
Level:         Error
User:          NT AUTHORITY\IUSR
Description:
Failed to get raster diagram for visio file
http://intranet/Documents/MyVisio.vsdx page  Exception : System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Office.Visio.Server.GraphicsServer.IVisioGraphicsService.GetRasterPageItem(RasterPageItemRequest rasterPageItemRequestContract)
   at Microsoft.Office.Visio.Server.Administration.VisioGraphicsServiceApplicationProxy.GetRasterPageItem(RasterPageItemRequest request)
   at Microsoft.Office.Visio.Server.ServiceWrapper.GetRasterPageItem(RasterPageItemRequest request)


Workaround


Run IISRESET.

Actual reason seems to be due to incorrect permissions. Look at the path highlighted in yellow on one of the error messages. There is not enough permissions in E:\Program Files\Microsoft Office Servers\15.0\Data\VisioServer\ for the account Visio Services is using. You can find the account by going to Manage Service Applications page in Central Admin, and highlighting the Visio Graphics Service row, then clicking on the Properties button and looking at the Application Pool used.

image

Then, in Service Accounts page in Central Admin, you can find the actual AD account. Don't go modifying permissions manually, but run the SharePoint Configuration Wizard instead.

image


Solution

Unknown, yet.


Technorati Tags:

May 3, 2013

SharePoint: How to link item title to item in Display Template

Task

When you add List View Web Part to a page in SharePoint and would like it to display e.g., all pages in the Pages library, and provide links to items, you will run into issue where you're not able to link to the item using the title of the item. You can only link to the item usin the file name, which will look bad, and include dashes, remove special characters, etc.

In SharePoint 2010, you would modify the XSLT of the XSLTListViewWebPart using SharePoint Designer (like here), but in SharePoint 2013 you can use new feature in SharePoint 2013, called JSLink to do the same.

Solution

Use JSLink to override how Title column is rendered. But instead of actual title column, you want to use the LinkTitle or LinkTitleNoMenu columns. This is because if you only use Title, the JSLink will not have the item URLs available – apparently optimization within SharePoint not to return item properties that are not used.

In the override, add link tags around the title. I do like this JSLink method better compared to the old XSLT SharePoint Designer way as you can reuse the JavaScript file and only reference that in the Web Parts when required.
  1. In a location of your choice (such as SiteAssets library of your site, or in _catalogs/masterpage), create new JavaScript file.
  2. In the file, add the code below
  3. In your web part, reference this JavaScript file in the JSLink setting, like ~site/SiteAssets/news_ui.js, or ~sitecollection/_catalogs/masterpage/news_ui.js
(function () {
//   Initialize the variables for overrides objects
 var overrideCtx = {};
 overrideCtx.Templates = {};
      
 //List of default Object.keys(ctx.CurrentItem)
 //ID,PermMask,FSObjType,HTML_x0020_File_x0020_Type,ContentType,File_x0020_Type,
 //File_x0020_Type.mapapp,HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon,
 //HTML_x0020_File_x0020_Type.File_x0020_Type.mapico,serverurl.progid,
 //ServerRedirectedEmbedUrl,File_x0020_Type.progid,File_x0020_Type.url,
 //FileRef,FileLeafRef,CheckoutUser,CheckedOutUserId,IsCheckedoutToLocal,Title,
 //Created,Created.FriendlyDisplay,firstRow
 

 overrideCtx.Templates.Fields = {
'LinkTitleNoMenu': { 'View' : '<a href="<#=ctx.CurrentItem.FileRef#>"><#=ctx.CurrentItem.Title#></a>' } 
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })();
 
NOTE! If you still want to use only Title column, you need to include some other field in the View you're using that contains URL in order for this to work, e.g., Icon and Name fields.


Technorati Tags: