web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

ADX Portal Multi Language Cache Issue

(0) ShareShare
ReportReport
Posted on by

I am working on ADX portal Multilingual website for CRM based on the link below :

https://community.adxstudio.com/products/adxstudio-portals/documentation/developers-guide/web-controls/crmentityformview/language-localization/

I followed the same exact steps as mentioned however I found out there is a cache issue when selecting the second language .  ADX attempt to clear cache from time to times , or when attempting manual cache invalidation (only when  the child website (second language) is selected ) . In both cases,  Cache is being cleared  but the base language(English) disappear from language selector and when attempting to visit the original URL ,  the portal goes offline for the original  base language URL throwing an argument null exception. so I either have to recycle pool or clear cache again on the base language so it could work again.

I tried modifying cache tags in web.config, troubleshooting , even saw similar issue mentioning that filling parent pages for web pages could be the resolution , but nothing worked out . It appears this issue is very critical .

Is there a resolution for this problem? 

Please help if anyone faced similar issue.

Here's the error description:

Server Error in '/' Application.


Value cannot be null.
Parameter name: key

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.Web.SiteMapNode..ctor(SiteMapProvider provider, String key, String url, String title, String description, IList roles, NameValueCollection attributes, NameValueCollection explicitResourceKeys, String implicitResourceKey) +12054146
   Microsoft.Xrm.Portal.Web.CrmSiteMapNode..ctor(SiteMapProvider provider, String key, String url, String title, String description, String rewriteUrl, DateTime lastModified, Entity entity, HttpStatusCode statusCode) +90
   Microsoft.Xrm.Portal.Web.CrmSiteMapProviderBase.GetWebPageNode(OrganizationServiceContext context, Entity page, HttpStatusCode statusCode, Func`2 getRewriteUrl) +664
   Microsoft.Xrm.Portal.Web.CrmSiteMapProviderBase.GetWebPageNode(OrganizationServiceContext context, Entity page, HttpStatusCode statusCode) +112
   Microsoft.Xrm.Portal.Web.CrmSiteMapProvider.GetNode(OrganizationServiceContext context, Entity entity, HttpStatusCode statusCode) +141
   Microsoft.Xrm.Portal.Web.CrmSiteMapProviderBase.GetAccessibleNodeOrAccessDeniedNode(OrganizationServiceContext context, Entity entity) +42
   Adxstudio.Xrm.Web.CrmSiteMapProvider.FindSiteMapNode(String rawUrl) +766
   Adxstudio.Xrm.Web.ContentMapCrmSiteMapProvider.FindSiteMapNode(String rawUrl, ContentMap map) +317
   Adxstudio.Xrm.Web.<>c__DisplayClass0_0.<FindSiteMapNode>b__1(ContentMap map) +63
   Adxstudio.Xrm.Cms.<>c__DisplayClass21_0`1.<Using>b__0() +70
   Adxstudio.Xrm.Cms.<>c__DisplayClass10_0`1.<Using>b__0() +72
   Adxstudio.Xrm.Cms.ContentMap.Using(ContentMapLockType lockType, Action action) +743
   Adxstudio.Xrm.Cms.ContentMap.Using(ContentMapLockType lockType, Func`1 action) +321
   Adxstudio.Xrm.Cms.ContentMapProvider.Using(ContentMapLockType lockType, Func`2 action) +561
   Adxstudio.Xrm.Cms.ContentMapProvider.Using(Func`2 action) +164
   Adxstudio.Xrm.Web.<>c__DisplayClass0_0.<FindSiteMapNode>b__0() +233
   Adxstudio.Xrm.Web.ContentMapCrmSiteMapProvider.CachePerRequest(String method, String key, Func`1 get) +744
   Adxstudio.Xrm.Web.ContentMapCrmSiteMapProvider.FindSiteMapNode(String rawUrl) +283
   Adxstudio.Xrm.AspNet.Cms.PortalContext`3.GetNode(RequestContext request) +414
   Adxstudio.Xrm.AspNet.Cms.PortalContext`3.<.ctor>b__30_0() +137
   System.Lazy`1.CreateValue() +14337348
   System.Lazy`1.LazyInitValue() +524
   Adxstudio.Xrm.AspNet.Cms.PortalContext`3.<.ctor>b__30_1() +87
   System.Lazy`1.CreateValue() +14337348
   System.Lazy`1.LazyInitValue() +524
   Adxstudio.Xrm.AspNet.Cms.PortalContext`3.get_Entity() +72
   Adxstudio.Xrm.Web.Routing.PortalRouteHandler.OnPortalLoaded(RequestContext requestContext, IPortalContext portal) +345
   Adxstudio.Xrm.Web.Routing.PortalRouteHandler.GetHttpHandler(RequestContext requestContext) +242
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +12410231
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

*This post is locked for comments

I have the same question (0)
  • yleclerc Profile Picture
    1,549 on at

    Hi Mark,

    We are dealing with the exact same problem. If the main language is called first, no problem. If secondary language is called first, we lose language selection. Then we call main language and the portal goes offline and we need to recycle pool or clear cache.

    Did you fin a solution to your problem?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Yvan,

    Well I actually spent weeks to solve this issue however it seems a bug in adx portal.

    However, I figured out that if you clear cache after the portal goes offline the portal will work again.

    so I managed to do the following:

    - Create an aspx page "ClearCache.aspx" that execute clearing adx cache script but make sure to execute it from server side  (page_init or load)

      (www.cloudfronts.com/manually-clearing-cache-adx-portals-reflect-changes-made-portals-crm)

    - In global.asax , I created a function that catches the error (whenever the portal goes offline)

    - one you catch the error event handler, you can add a condition to filter it by error code (you'll get the code once the exception is thrown through quick watch)

    - when the filter is applied and the error is thrown , the system will redirect to "ClearCache.aspx" that execute the cache invalidation which will set the portal online for the main language.

    As for the selector make sure to the remove the related website count check from navbar.ascx to keep the selector always visible.

  • yleclerc Profile Picture
    1,549 on at

    Thank you Mark!

    This is a very good starting point for me!

    I wouldn't know how to create a function that catches the error, or where I would have to add a condition to filter the error code.

    As you can see, I am no IIS Savvy, I will need some help from our IT people.

    But thank you so much, I will try to make this work!

  • yleclerc Profile Picture
    1,549 on at

    Here is another idea.

    What if instead of waiting for the error to occur, we could prevent it?

    I am not sure at which delay ADX attempts to clear cache, but let's say it's after 1 hour.

    We could launch a scheduled task every 30 minutes to force the cache invalidation. Then the same task would call the portal main language URL to make sure the portal builds correctly in both languages. So if the secondary language is called after that, it will load with language selection correctly.

    Does that make sense?

  • Community Member Profile Picture
    on at

    Well, I think It's impossible to predict the error , this could be a solution but a bit risky because ADX cache invalidation behavior occur not only on timely basis but on committing changes . (publishing, saving data ..)

    if cache invalidation is called and any user is using the second language and if another instance is calling the main language the portal would go offline within one hour and the task scheduler has not launched yet so the user is stuck .

    I implemented this solution for 2 portals, the portal works pretty normal

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans