Applications in StoreFront Fail to Enumerate

Applications in StoreFront Fail to Enumerate

book

Article ID: CTX136700

calendar_today

Updated On:

Description

When using Citrix Receiver (running in Mac 11) to log on to StoreFront, the applications fail to enumerate. An internal server error occurs in the client device.

User-added image

The following is the log trace of the issue in StoreFront server:

Log Name:   Citrix Delivery Services
Source:        WebApplication
Date:          06/02/2013 17:36:39
Event ID:      7
Task Category: (2)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      Z2T3GBGHVDH53.gb.batgen.com
Description:
Unhandled exception thrown for route "DazzleResources/List"
System.ArgumentException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
   at Citrix.DeliveryServices.DazzleResources.Web.Controllers.DazzleSubscriptionsPopulator.Populate(ControllerContext controllerContext, List`1 resources, ResourcesDto resourcesDto)
   at Citrix.DeliveryServices.ResourcesCommon.Web.Helpers.ResourcePopulatorUtilities.ConvertResources(ControllerContext controllerContext, IEnumerable`1 populators, IEnumerable`1 resourceWrappers)
   at Citrix.DeliveryServices.DazzleResources.Web.Controllers.DazzleResourcesController.GetResourcesDto(ResourcesEnumerationResult resourcesEnumerationResult, IEnumerable`1 groupNames, HashSet`1 subscriptionStatuses)
   at Citrix.DeliveryServices.DazzleResources.Web.Controllers.DazzleResourcesController.List(List`1 group, String scope, HashSet`1 subscriptionStatus)
   at lambda_method(ExecutionScope , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Resolution

To resolve the issue, run the following SQL scripts:

  1. To identify the recently created duplicate entries, run:

    select id_to_delete
    from (select count(id) dup_count, MAX(id) id_to_delete from Subscription group by resource_id, user_id) as dups
    where dup_count > 1;

  2. To delete the duplicate entries, run:

    delete from Subscription
    where id
    in (select id_to_delete
               from (select count(id) dup_count, MAX(id) id_to_delete from Subscription group by resource_id, user_id) as dups
    where dup_count > 1);

Note: When there are more duplicate entries, run the scripts more than once.


Problem Cause

When logging in, the duplicate subscriptions are created in the StoreFront database preventing the applications to enumerate. The applications and desktops which are subscribed using the older version of the Citrix Receiver create duplicate entries. For more information refer to Citrix Documentation - Installing, setting up, upgrading, deploying, or removing Receiver for Mac.

Issue/Introduction

This article provides resolution to remove the duplicate entries in the StoreFront database.