Skip to content

blksthl

Mostly what I know and share about…

Tag: Slow pageload

Fixing the ScriptResource.axd Errors 500 Internal Server Error


ASP.NET Ajax client-side framework (ScriptResource.axd) failed to load.
The status code returned from the server was: 500
Status: 50 The request is not supported

An unknown error occurred while processing the request on the server
asp.net ajax client-side framework failed to load
or
AjaxError

Greetings SharePoint geeks!

The problem
This post is purely created from a little peice of reality. I just experienced this issue myself in a SharePoint setup published externally thru TMG.

It is not entirely easy to troubleshoot, with quite a few components involved, however, I managed in the end and I will here also give you a few hints on how to go about t-shooting something like this.
Anyway, the circumstanses look like all or some of these:

– An internal SharePoint webserver (sp01)
– A TMG 2010 Server connected to the internal network and the internet, used for many more services than SharePoint
– A Web Application, CollabSite, published using a Firewall policy (from the SharePoint publishing wizard)
– A MySite Web Application also published using the same wizard but a separate policy.
– Both sites are configured to only use https/SSL with a certificate issues by an internal CA.
– An external DNS record pointing both URLs to the eexternal interface of the TMG server.
– Internal DNS records also Points to the external interface of the TMG

When connecting to the sites, mysite.domain.com or collabsite.domain.com from a client on the internet. The site prompts for authentication, the site loads…almost…a popup appears that states:

‘asp.net ajax client-side framework failed to load’

The dialogbox popup

AjaxError

Most of the site loads, you see the blue banner at the top but nothing more.
Reloading the site does not give you the popup again, but soads the site without any of the AJAX functionality, like the ribbon and buttons in the top right area. The ribbon will on some pages show up but it only shows the ‘working on it’ twirl instead of the tools/buttons you would expect.

I will here describe why this happens and how you fix it. But first, I will give you a short version…

Short version
1. SharePoint/IIS offers the ScriptResource.axd files in a compressed format
2. TMG cannot inspect compressed files unless Compression filter/http Compression is enabled
3. Enable the ‘Compression filter’ in TMG under the ‘System’ node
4. Apply, done!

Long version
First we look at what is requested and what is delivered. I use IEs built-in F12 Developer Toolbar, IE later than IE9 will have a Network tab and this allows you to trace the traffic. Same thing if you use Firebug/Fiddler or Wireshark, whatever is available. Browse to the failing site, press F12 and select the Network tab. Here you click on the ‘Start Capturing’ button

F12Capture

This causes IE to collect and show all traffic coming to and from the browser.

F12CaptureNotOKx

The two /ScriptResource GET statements are what fails. This is all that is needed to stop all AJAX functionality, now we know that it has to do with something we do not get down to the browser ok, but why is that, how do we fix it? We need more info to be able to answer those questions.
We can get a bit more info from IE still, select one of the GET lines and click on ‘Go to detailed view’ to see more about the issue.

F12CaptureNotOK2x

We get some more info here but not really something that tells us what is going on.

I now tried the same thing from a client on the inside, I added an entry to the local hosts file and added the url and pointed it directly to the IP address of the SharePoint Web Server. With this setup the problem is gone. What this tells me is that the problem is most likely something to do with TMG and how that is configured. Lets take a look.
Logon to the TMG server, make sure that you have permissions to manage TMG.

Since the site at least loads, we have toi assume that https and the publishing in general works as expected. It can’t be all bad.
You will find the logs by clicking on ‘Logs and reports’ in the left pane on TMG.

TMGLeftPaneLogsx

First add a filter, it should include a filter for:
‘Log record type’ = Firewall or Web Rule
‘Log time’ = Live
‘Action’ != Connection status
‘URL’ contains collabsite (Something that will identify the traffic to your site)

Now, you need to start a Query.
Click on start Query, Then go to your browser with the failing site and refresh the site again.
This should give you something like this in the TMG log

TMGLogNotOKxx

You get a few more pieces of info, but still no real answer to what is wrong…now..it is time.
Now we give up and ask a friend like I did or Google/Bing up this blog post.
Apperantly, this is due to SharePoint ‘offering’ these scriptresource.axd files, which by the way are files that do not exist, they are virtual…anyway, the files are offered in a compressed form, and when TMG is not configured to use compression, it can’t handled files beeing offered in a compressed format, at least that is a more or less accurate explaination to the what happens.
To soolve the issue, yup, it is easy.

Note! DO not make any Changes to the TMG if it is used in production, most Changes made will or can affect the functionality of other applications than SharePoint. Do this when it fits.

In TMG, go to the system node in the leftpane

TMGLeftPanex

Locate the Filter named Compression Filter and right click, Enable. It has to be enabled in order for TMG to ‘undersdtand’ compressed files…

TMGLogNotOKCompressionFilter

Now, make sure that the filer shows an enabled state

TMGCompressionFilterOn

You might Think that the Compression filter is now enabled…but no. You have to apply the Changes to TMG first, do this by clicking on the Apply button

TMGApply1

The Apply/Discard buttons show app after you have made any change to anything in TMG. Obviously, Discard does nothing and does a reset on all Changes you have made, Apply makes it real. The Changes are commited.

Apply2

TMGApply3

TMGApply4

Now. You should be ok. Check again in the browser. To be 100% sure, Close the browser and start a new one, browse to the address and logon if you have to.
Click on F12, Networking, ‘StartCapturing’ and refresh the browser.

F12CaptureOKx

Now, as you can see, the ScriptResource.axd files load ok with a 200 back from IIS. Test functionality and you will see that you have full AJAX functionality restored!

Failed Connection Attempt
Log type: Web Proxy (Reverse)
Status: 50 The request is not supported.
Rule: Sharepoint
Source: External (10.0.0.10:5656)
Destination: Local Host (collab.internal.domain.com 10.0.0.2:443)
Request: GET http://sp01.domain.com/ScriptResource.axd?d=j1ZhaacmuTdtaXKJmCKiL5N9BhFaiHjoyTepROfiG-dsvaranCGsbhWSAJThJOqErvtnV3f3JK-eai_4uSJCTTsp5WYkDzemQHrfpRrKq-8pIRNncb_vHcHCmvp1E9WFzbrvgUHEnQm3_A6TBJte_EfSWNQReBfix-6dygtTl0aL7MpGhhWiHQWrWzz1Cixd0&t=6119e399
Filter information: Req ID: 1658eda1
Protocol: https
User: Anonymous
Allowed Connection SERVERNAME DATE
Log type: Web Proxy (Reverse)
Status: 200 OK.
Rule: Sharepoint
Source: External (10.0.0.10:5656)
Destination: Local Host (sp01.internal.domain.com 10.0.0.2:443)
Request: GET http://sp01.domain.com/ScriptResource.axd?d=NPjpKZ25gaaa-UUxeA8GUGfiRsyQ0pvhyH-cklhXQDb_uZT9hy-ZNDagl3Gq5QHfhXPAOU_Ngxhu5H5qxWSnmMDCX-IUhKwtH01F785ZmXZ82_V3aeC5wX4aXxARfov8ZzG-FFwXtesO2xApQUCazxU3-FfqQL1NCZqTLM2ttQQhILR1azFbosx9-RCON3JR0&t=6119e399
Filter information: Req ID: 0670e57f
Protocol: https
User: anonymous
References

_________________________________________________________

Enjoy!

Regards

Twitter | Technet Profile | LinkedIn

Advertisement
Thomas Balkeståhl Event viewer, https, IIS, Internet Explorer, Internet Information Services, Networking, SharePoint, SharePoint 2010, SharePoint 2013, SharePoint Server 2013, SSL, URL, Windows Server 2012, Windows Server 2012 R2 1 Comment December 16, 2013December 16, 2013 5 Minutes

Managing the Distributed Cache Service in SharePoint 2013


Managing the Distributed Cache Service in SharePoint 2013 using PowerShell

MultipurposeTractorx
A true multipurpose tractor

Greetings SharePoint Campers!

This time I will just offer a brief cheat sheet for Distributed Cache operations using powershell, which is pretty much the only way you can configure and manage the service.
For some reason, the Distributed Cache seems to offer a lot of people grief, all from no functionality at all to extremely slow responsetimes on all pages loaded (see SharePoint 2013 page loads takes a very long time).

My best tip, the often working quick fix with a malfunctioning cache service, is to first try and stop and start it, then if its still failing, delete the service and add it back again. You should also from the start change the default service account from the farm account to a separate, maybe dedicated managed account.

Quick fix
1.
Stop the service
Start the service
2.
Delete the service
Create a new service
3.
Start checking the logfiles and do a proper t-shooting.

Remember that in a multiserver farm, the PowerShell commands will affect the server where the command has been executed, so make sure to be on the correct server Before runing the CMDlets.

Distributed Cache tasks listed in the following order:

Change the service account running the Distributed Cache
Graceful stop and deattach local server (No lost cache data)
Dettach local server from a cache cluster (Multiple Distributed Cache servers)
Reattach local server to a cache cluster (Multiple Distributed Cache servers)
Delete the service
Create a new service
Start the service on a server
Stop the service on a server
Check current Cache memory allocation
Change the Cache memory allocation
References
Change the service account running the Distributed Cache

It is recommended to use a SharePoint managed account for this service.
$spfarm = Get-SPFarm
$spcacheService = $spfarm.Services | where {$_.Name -eq “AppFabricCachingService”}
$spaccount = Get-SPManagedAccount -Identity domain\spdistcache
$spcacheService.ProcessIdentity.CurrentIdentityType = “SpecificUser”
$spcacheService.ProcessIdentity.ManagedAccount = $spaccount
$spcacheService.ProcessIdentity.Update()
$spcacheService.ProcessIdentity.Deploy()

CurrentIdentityType = “SpecificUser” should be just that and nothing else, do not replace this value

Verify by going to Central administration, Security, Configure Service accounts, Select ‘Windows Service – Distributed Chache’ i dropdown, that the service account has been replaced.

Graceful stop and deattach local server (No lost cache data)

Stop-SPDistributedCacheServiceInstance -Graceful
Remove-SPDistributedCacheServiceInstance

Deattach local server from a cache cluster (Multiple Distributed Cache servers)

Remove-SPDistributedCacheServiceInstance

Reattach local server to a cache cluster (Multiple Distributed Cache servers)

Add-SPDistributedCacheServiceInstance

Delete the service

$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.delete()

Verify in Central Admin, System Settings, Manage Services on Server. It should be gone from this list when it has been completely deleted.
In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.

Create a new service

Add-SPDistributedCacheServiceInstance

Verify in Central Admin, System Settings, Manage Services on Server. It should appear in this list when it has been created. In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.

Start the service on a server

$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()

Stop the service on a server

$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()

Check current Cache memory allocation

Use-CacheCluster Get-AFCacheHostConfiguration -ComputerName $env:computername -CachePort “22233”

Change the Cache memory allocation

On all Cache servers in the farm stop the service
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()
Update the memory allocation
Update-SPDistributedCacheSize -CacheSizeInMB CacheSize
Start the service on all Cache servers
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()

CacheSize is the cache size’s memory allocation assignment in MB

‘

Note: Beware of the signle and double quotes if you copy the code…quotesx

‘

References

Manage the Distributed Cache service in SharePoint Server 2013
http://technet.microsoft.com/en-us/library/jj219613.aspx

Plan and use the Distributed Cache service in SharePoint Server 2013 (Poster)
http://www.microsoft.com/en-us/download/confirmation.aspx?id=35557

_________________________________________________________

Enjoy!

Regards

Twitter | Technet Profile | LinkedIn

Thomas Balkeståhl Powershell, Setup, Setup, SharePoint 2013 1 Comment November 27, 2013November 27, 2013 3 Minutes

Recent Posts

  • The complete list of groupIds for private endpoint & privatelink service connection

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 311 other subscribers
Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • blksthl
    • Join 118 other followers
    • Already have a WordPress.com account? Log in now.
    • blksthl
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...