13 March, 2014

The site collection containing this sandboxed solution has exceeded its daily resource usage quota

In our last article, we talked about sandboxed solutions and some associated issues:

In this article, we will discuss on resource usage with respect to Sandboxed Solutions.

Every time we will learn more and more when there is an issue and we start our analysis, troubleshooting, reproducing the issue and many more! – This is not going to stop J in fact nobody want to – J

I had a ticket in which user was facing the issue – he has uploaded a solution package inside solution gallery but as soon as he tried adding the webpart then he was getting the following error message

The site collection containing this sandboxed solution has exceeded its daily resource usage quota

Quite strange because uploading a package and the error in the next 5 mins – don’t you think something is wrong here? I have checked the resource usage of that solution-

1.   Open the site in which you have uploaded the solution (.WSP)
2.   Site actions
3.   Site settings
4.   Galleries
5.   Solutions

You will see the complete usage here – see the following screenshot.

From the above screenshot, it’s very clear that the resource usage is 0 but still I am not able to add the webpart :) then I thought it might be a permission issue so I tried with the farm account but same problem L - OK, permission is not the issue! – cleared.

Then I thought it might be browser specific so I tried in Mozilla as well as chrome to test the functionality but no changes in the result i.e. same problem – OK, browser is not the issue – cleared.

I checked the ULS logs to get more clarity, additionally event logs but didn’t find anything relevant.

Then I checked the timer jobs in case of any failures but everything was fine there also.

Then I thought there should be some setting from where we can set these resource usage numbers and finally I found it, LOL the setting that you see regularly gets sometimes ignored by us. Start thinking guys and hit the target!

Yes, you are right – “Configure quotas and locks” – by means of this you can check the actual “Sandboxed Solutions Resource Quota”.

So when I checked this then I found out that there were no numbers in the textboxes.
1.   Open the central administration
2.   Application management
3.   Configure quotas and locks
4.   Select the appropriate site from the top dropdown and specify the following numbers

By default these are numbers:
Limit maximum usage per day to: 300
Send warning e-mail when usage per day reaches: 100

Set this numbers and you should be good to go J

If you have any queries/questions regarding the above mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues, Thank you.

Notes: if you are facing this problem in reference to Office 365 then here is the Microsoft endpoint: http://support.microsoft.com/kb/2536051

12 March, 2014

The Business Data Connectivity Metadata Store is currently unavailable

BDC, Everybody aware as it was there in MOSS 2007 / SharePoint 2007 but now we have BCS – Business connectivity services, one of the important features in SharePoint 2010. Whenever we need to bring external content / connect to external content types then BCS comes into picture. Today’s article is also based on one of the BCS issue which I came across and resolved it with proper analysis and troubleshooting.

Problem description:
One of our users trying to connect to ‘External content types’ by means of SharePoint Designer and facing the following error.

Error message - 1:

The Business Data Connectivity Metadata Store is currently unavailable.


Error message - 2:

There is no business data connectivity service associated with the current web context.


We haven't used the BCS before so this is the first time we came across this error so when I started exploring our farm then I noticed that one of mandatory requirement to make this functionality working is – Service Application.

Point #1: Make sure you have the BCS service application (SA) exists.

So we have created the BCS SA and check the results but same problem i.e. same error message.

Point #2: Make sure you associate this service application with the respective web applications on which you have the site collections.

How to do this? – Here are the details.
1.   Open the Central Administration
2.   Application management
3.   Service applications
4.   Configure service application associations
5.   Make sure its listed under ‘application proxies’

Point #3: BCS service application has a dependency on managed metadata so make sure the managed metadata service application already exist in your environment. If it’s not then please create it.

Point #4: Make the account that you have used for creating the BCS service application has necessary permissions on the web application database.

Point #5: Make sure the Business connectivity service is in started mode via Services on Server.

How to check this? – Here are the details.
1.   Open the central Administration
2.   System Settings
3.   Servers
4.   Manage services on Servers.
5.   Check the respective service i.e. BCS and start it if it’s in stopped status.

That’s it – the issue should be resolved now after following the above recommendations.

If you find a different solution, please report it as a comment to this post. Be sure to double-verify it: undo your solution and verify that the problem comes back, then redo it and verify that the problem goes away.


If you have any queries/questions regarding the above mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues, Thank you.

Sandboxed code execution request failed - Resolved

Today’s article is based on Sandboxed Solution. By means of this article, I am going to share some issues that I faced while activating the solution as well as adding the webpart on SharePoint site.

So basically what is Sandbox solution?
When we talk about ‘solution’ then only one term which will comes to your mind i.e. WSP (Windows Solution package). People often misunderstood this Sandboxed concept as something is going to affect the farm, the scope is based on web application, and it’s going to reset the IIS app pools but let me tell you the fact – Sandboxed solution are user code solutions. Now again the new terminology – what is ‘user code solution’?

One process leads to understand a new process- isn’t it interesting? J

User code solution means user himself can deploy this solution and activate it and does not required SharePoint administrator to deploy. This is a very fine concept in which the scope is restricted to the specific site collection only. I don’t want to talk about ‘farm Solutions’; otherwise this will misinterpret the purpose of this article.

Why Sandboxed solutions are so important:
Sandboxed solutions do not run in the IIS worker process, neither the IIS application pool nor the IIS server must restart.
It is not necessary for the SPUCWorkerProcess process to recycle to load the latest version of the solution.

Problem description:
One user opened a ticket by saying ‘he needs to deploy some package’. Further probing, I came across that he has a WSP file and wanted to use as Sandboxed.

Now the question is – How to configure Sandboxed if it’s not there in your farm?

Here are the details steps:-
Section: 1
1.      Open Central administration
2.      System settings
3.      Under Servers
4.      Manage services on server
5.      Activate this service “Microsoft SharePoint Foundation Sandboxed Code Service”

Section: 2
1.      On the same server which is hosting the Sandbox code service
2.      Click on ‘start’
3.      Administrative tools
4.      Services
Once this configuration done then you are ready to upload the WSF file to the solution gallery. – Where is this solution gallery?
·         Open your SharePoint site
·         Site actions
·         Site settings
·         Under galleries

Note: Make sure you have site collection admin access to upload the solution in the solution gallery.

Once the solution gets uploaded then you can activate that solution.
How to activate it? -> Click on the solution dropdown -> you will get the option of activate.

In my case, user was trying to add a webpart on the home page of the site but as soon as I select the webpart to add then boom! It throws an error message as following-

Sandboxed code execution request failed.


Let me tell you some story behind this: I have enabled the service only on the app server and not on the web front ends. So basically if I activate any service on app then it does not necessary to activate it on the other servers (WFE’s) – do you support this fact? – would like understand your views!

I negotiated my thoughts for a moment and started the service on rest of the front ends but then a different error comes into picture: see the following-

The Sandboxed code execution request was refused because the sandboxed code host service was too busy to handle the request.




I started exploring the CA, site collection features, site manage features and one link which caught my attention, that is – Manage User Solutions

Where is this link?
·         Open the Central administration
·         System settings
·         Manage user solutions

Once you will open this section then you will get two options:
·         All sandboxed code runs on the same machine as a request.
·         Requests to run sandboxed code are routed by solution affinity.

It took some time for me to understand these terminologies as by practical only you will come to know the actual results.

See the differences:
All sandboxed code runs on the same machine as a request: Sandboxed Code Service should be started on all the WFE’s.

Requests to run sandboxed code are routed by solution affinity: if you start the “Sandboxed Code Service” on app server only then also it’s fine.

So I stick with my logic and select the second point i.e. Requests to run sandboxed code are routed by solution affinity and disabled the service from rest of the front ends.

But the error is still there! I checked the logs, restarted the sandboxed code service, restarted the user code service but still didn’t make any difference.

Then here is the rescue – In our case we checked the state key value and ours was- 0x00023c00

Actual Resolution:
a)      On the server, click Start | Administrative Tools | Services.

b)      On the Services dialog, scroll to SharePoint 2010 User Code Host.

c)      Note the full user name in the Log On As column. You will need this information later.

d)      Open SharePoint Management Shell.

e)      Enter the following at the command prompt, including all punctuation.

f)       (Get-SPManagedAccount –Identity “username”).Sid.Value

g)      Replace username with the name you obtained in step 3. E.g., Domain\FarmAdmin

h)      This will return the user’s SID (Security ID), which you will use in a later step.

i)        Open the registry editor and navigate to:

j)        HKEY_USERS\SID you obtained earlier\SOFTWARE\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\SoftwarePublishing

k)      Be sure the State key value is set to 0x00023e00.

l)        Restart the sandboxed host service on all servers on which it is to run.

No need of server restart as well as IIS RESET.  

Check the results and you will be good.

If you find a different solution, please share as a comment so that everybody will get the benefit of the same.

If you have any queries/questions regarding the mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues, Thank you.

11 March, 2014

Error: "Farm is Unavailable"

Problem description:
The entire SharePoint staging site is not accessible.

Error messages:
“Farm is Unavailable” - while accessing the site.

While running the product configuration Wizard “Cannot open database “database name” requested by login. The login failed for the user “sa”



Steps Taken & Resolution:
1.   Checked inetmgr / IIS to see all the necessary web application are started.

2.   All the necessary SharePoint & MS SQL service are started.

3.   Restarted the WFE's & DB servers.

4.   Checked the DB server and verified the User “sa” (as mentioned in error) having access to the specified database.

5.   While checking the database, we came to know several database are in offline mode.


Steps to check database is in offline or online:

1.   You will not be seeing + sign to expand the database.

2.   To confirm it is in offline, right click on the database & click on properties.

3.   In property window, Status as blank and size, space available as “Unavailable”. It confirms DB is in offline mode.

To make it online, select the database, click on “New Query” and execute the following query.

alter database [“DATABASE-NAME”]
set online

Example:
alter database [Sharepoint2010_DB]
set online

We ran the query for all the DB which was in offline. Then ran the product configuration wizard and it was successful.

Now all the sites are accessible!!!  :)

Root Cause Analysis: Several DB’s went offline because “huge amount of Log shipping data has been generated for the past 2 months and disk space crossed its threshold”. Later we identified our staging site FAST search server continuously crawling for more than 1000 hours and it never seems like stopping. This happened because “FAST Search server certificate “got expired 3 months back.


We stopped the crawling manually and renewed the fast search certificate .Also we have done shrinking of the log shipping data as well.

That’s it... & it’s all set now.

Note: If you find a different solution, please report it as a comment to this post. Be sure to double-verify it: undo your solution and verify that the problem comes back, then redo it and verify that the problem goes away.

If you have any queries/questions regarding the mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues, Thank you.

08 March, 2014

Fast Search Internal Server error exception - Resolved - SharePoint 2010

Today’s article is based on the numbers of problems that I faced while configuring fast search. This is the first time I have done this configuration but there were string of problems I encountered while resolving the issue. I would like to share the complete troubleshooting steps so that your time will be saved, issue will be resolved, you can meet your deadline in case of any, reduce the frustration J

SP attributes:
- SharePoint Server 2010 with recent CU
- Fast Search Server 2010

Problem description:
I have configured the Fast Search and added the content sources. I was able to crawl but found out Search results are not coming / working.

Error Message:
"Internal Server error exception" while searching from SharePoint sites.

Troubleshooting done:
1.   Verified certificate installation and configuration on both FAST and SharePoint servers

2.   Examined Service application proxy, TCP Port status and IPV6 status of FAST and SharePoint servers

3.   Verified that FAST Service Account is part of FASTSearchAdministrators and FASTSearchKeywordAdministrators group

4.   While troubleshooting FAST service and SharePoint Search Service status identified that SAMWorker process at FAST ADMIN Node was in DEAD state.

About SAMWorker:
Generates a security filter for each user to trim down the query results returned to a user.
Inputs  End user claims tokens from the QRProxyService. 
User security filter requests from the QRServer. 
Accepts configuration changes from the SAM Admin.        
Outputs Generates a user’s security filter which is joined with the user’s query in the QRServer to do security trimming.
Dependencies: LogService, SAM Admin Service, QRServer, QRServerProxy.

5.   We Provide Full Control for Machine Keys in the following location on FAST Server.

(location" “Documents and Settings\All Users\Application  Data\Microsoft\Crypto\RSA\ Machine Keys”)


6.   After this we used a new browser and browsed to the site.

Got the error "The search request was unable to connect to the Search Service"

7.   When examined SharePoint ULS, was seeing error below,

02/24/2014 09:30:05.06 w3wp.exe (0x1CD8) 0x1364 SharePoint Server Search Query g4hr Monitorable FastSearchGateway::GetQueryResult--Communication Exception searching on QRServer: http://SharePoint.amolgalaxy:13287. Putting qrserver on the exclude list for a while. 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 3.0 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 IProxyRemote.ProcessRequest(String request)     at Microsoft.SharePoint.Search.Extended.Query.Http.WcfSearchEngine.GetSearchResponse(IQuery query, String searchUrlPath, String urlQueryStr, Int32 timeout)     at Microsoft.SharePoint.Search.Extended.Query.Http.AbstractUrlBasedSearchEngine.SearchInternal(IQuery query, IResultParser parser, String urlStr)     at Microsoft.SharePoint.Search.Extended.Query.Http.AbstractUrlBasedSearchEngine.Search(IQuery query)     at Microsoft.Office.Server.Search.Query.Gateway.FastSearchGateway.GetQueryResult(IQuery query). f72be699-6dae-42d0-8bd6-501f61958e3d

02/24/2014 09:30:05.06 w3wp.exe (0x1CD8) 0x1364 SharePoint Server Search Query g4hk Monitorable AbstractSearchGateway::Search--Exception when searching for sharepoint site:"http://amolgalaxy/sites/admin-apps". Ex: Microsoft.Office.Server.Search.Query.SearchServiceNotFoundException: Service fault communicating with query service http://SharePoint.amolgalaxy:13287; 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 3.0 SDK documentation and inspect the server trace logs.     at Microsoft.Office.Server.Search.Query.Gateway.FastSearchGateway.GetQueryResult(IQuery query)     at Microsoft.Office.Server.Search.Query.Gateway.FastSearchGateway.ExecuteSearch(SearchRequest request, String queryString)     at Microsoft.Office.Server.Search.Query.Gateway.AbstractSearchGateway.Search(SearchRequest request) f72be699-6dae-42d0-8bd6-501f61958e3d

8.   We confirmed that the Proxy for Search is up and running by executing Get-SPServiceApplicationProxy

- Checked the proxy setting on the IE and was not configured.
- Tried to start the SamWorker (which is dead) but it failed to start
- In the event viewer found the following error

Log Name:      Application
Source:        FASTSearchSAMWorker
Date:         
Event ID:      0
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:     
Description:
Service cannot be started. System.InvalidOperationException: Error Starting up.  Unable to initialize Startup Object Microsoft.SharePoint.Search.Extended.Security.Base.WCF.WCFServiceManager,Microsoft.SharePoint.Search.Extended.Security.Base"
at Microsoft.SharePoint.Search.Extended.Security.WorkerService.WorkerService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

9. Followed steps below in an attempt to resolve this error,
- Stopped the Fast search service.
- Modified the Fast folder (%fastsearch%) permissions to add 'FASTSearchAdministrators' group members one by one, with full control.
- Set child objects to inherit permissions
- Removed the tilda files begining with ‘~’ from %fastsearch% folder
- Started the Fast services for SharePoint

It did not help resolve the issue. SamWorker remained in stopped state.

NCTRL Status   showing SAM worker  'dead'  state.
        Services.msc> FAST Search SAM Worker Service is not started. Manually startign it is not helping to  get sam worker running.

When ran commands below in given order,
 
-nctrl stop samworker
-nctrl stop samadmin
-nctrl start samadmin
-nctrl start samworker
   
The SAMWorker process gets in to running state and goes back to dead state in 2-3 minutes.

You are not able to get any search results in the SharePoint farm. Crawling and indexing works as expected.

This is a new deployment and the issue explained above was identified during the deployment phase.

-Checked %FASTSEARCH%/var/logs/syslog/ found only   'authorization-admin_amolgalaxy.txt' . So, this system never has SAMworker running.  If so, we should see at least authorization-worker_ amolgalaxy.txt in same folder.

-Tried to set FAST logging from warning to debug
 
Ran commands below at customer fast server,
 
-Set-FASTSearchSecurityLogLevel -DefaultLogLevel debug    --> Got error "cannot set log level."

 -Set-FASTSearchSecurityLogLevel -WarningNameSpaceLogLevel  debug --> Got error "cannot set log level.”

Checked the config file in location Config File(s) Location   and verified that they are good by comparing with a good FAST server's configuration files.

  For SAM ADMIN:
  %FASTSEARCH%/bin/Microsoft.Sharepoint.Search.Extended.Security.AdminService.exe.config 

%FASTSEARCH%/components/sam/admin  and
  For SAM WORKER
  %FASTSEARCH%/bin/Microsoft.Sharepoint.Search.Extended.Security.workerService.exe.config

%FASTSEARCH%/components/sam/worker

-Followed  http://support.microsoft.com/kb/2656160     and ran   "psconfig.ps1 -action p"   command via Powershell  as FAST For SharePoint  service account.  The command completed successfully.

-Registered ServicePrincipalNames for CN=s-fastdevsvc,OU=App Services,OU=CUSFA,DC=carrier,DC=UTC,DC=com  using SETSPN command.

That's it - Issue Resolved!  Verified that the search results are returned as expected.

If you have any queries/questions regarding the above mentioned information then please let me know, Thank you.