Sitecore 8.1 : Lucene.Net.Store.LockObtainFailedException - azure

We have sitecore 8.1 hosted in Azure WEB Apps. The setup is 1xCA and 2xCD and using LUCENE
We noticed a error log below which I googled but could not get solution.
ManagedPoolThread #12 2015:12:28 23:22:33 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Reflection.MethodInstance.Invoke()
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters)
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
Nested Exception
Exception: Lucene.Net.Store.LockObtainFailedException
Message: Lock obtain timed out: NativeFSLock#D:\home\site\wwwroot\App_Data\data\indexes\sitecore_web_index\write.lock: System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\App_Data\data\indexes\sitecore_web_index\write.lock' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Lucene.Net.Store.NativeFSLock.Obtain()
Source: Lucene.Net
at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)
at Sitecore.ContentSearch.LuceneProvider.DiagnosticLockFactory.DiagnosticLock.Obtain(Int64 lockWaitTimeout)
at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, IndexDeletionPolicy deletionPolicy, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)
at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, MaxFieldLength mfl)
at Sitecore.ContentSearch.LuceneProvider.Sharding.LuceneShard.CreateWriter(Directory directory, LuceneIndexMode mode)
at Sitecore.ContentSearch.LuceneProvider.Sharding.LuceneShard.CreateWriter(IProviderUpdateContext context, LuceneIndexMode mode)
at Sitecore.ContentSearch.LuceneProvider.LuceneIndex.CreateWriter(IProviderUpdateContext context, Shard shard, LuceneIndexMode mode)
at Sitecore.ContentSearch.LuceneProvider.LuceneUpdateContext.InitializeWriter(UpdateContextShardState shardState, LuceneIndexMode mode)
at Sitecore.ContentSearch.LuceneProvider.LuceneUpdateContext.InitializeWriters()
at Sitecore.ContentSearch.LuceneProvider.LuceneUpdateContext.EnsureInitializeWriters()
at Sitecore.ContentSearch.LuceneProvider.LuceneUpdateContext.UpdateDocument(Object itemToUpdate, Object criteriaForUpdate, IExecutionContext[] executionContexts)
at Sitecore.ContentSearch.LuceneProvider.LuceneUpdateContext.UpdateDocument(Object itemToUpdate, Object criteriaForUpdate, IExecutionContext executionContext)
at Sitecore.ContentSearch.LuceneProvider.LuceneIndexOperations.Update(IIndexable indexable, IProviderUpdateContext context, ProviderIndexConfiguration indexConfiguration)
at Sitecore.ContentSearch.SitecoreItemCrawler.UpdateItemVersion(IProviderUpdateContext context, Item version, IndexEntryOperationContext operationContext)
at Sitecore.ContentSearch.SitecoreItemCrawler.DoUpdate(IProviderUpdateContext context, SitecoreIndexableItem indexable, IndexEntryOperationContext operationContext)
at Sitecore.ContentSearch.SitecoreItemCrawler.Update(IProviderUpdateContext context, IIndexableUniqueId indexableUniqueId, IndexEntryOperationContext operationContext, IndexingOptions indexingOptions)
at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions)
at Sitecore.ContentSearch.AbstractSearchIndex.Update(IEnumerable`1 indexableInfo)
Nested Exception
Exception: System.IO.IOException
Message: The process cannot access the file 'D:\home\site\wwwroot\App_Data\data\indexes\sitecore_web_index\write.lock' because it is being used by another process.
Source: mscorlib
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Lucene.Net.Store.NativeFSLock.Obtain()
Web Apps makes a bit tricky to debug as we don't have access to IIS or event logs etc. Any suggestion would be appreciated.

What you should do is go to that location and just remove the write.lock file. If its being used by another process then use something like fileunlocker, unlock the file and then delete. It does this quite a lot with git and lucene.

In Azure Web Apps, you do have access to those logs and many other troubleshooting tools. Navigate to //<yourwebsitename>.scm.azurewebsites.net and explore your options in the Kudu tool. Especially check the Tools | Support menu option. You'll need to enable logging in your web app first.

Related

Sitecore Logs - Azure Search

Currently I'm seeing the following a lot in my logs, I'm using Sitecore 8.2 rev 2 with azure. The issue only started recently when I added some new indexes to the site for a new microsite. Any ideas of where to start investigating, I've raised with Sitecore too?
ManagedPoolThread #17 22:03:10 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
Nested Exception
Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`2 body)
at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions)
Nested Exception
Exception: System.InvalidOperationException
Message: Sequence contains no elements
Source: System.Core
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Sitecore.ContentSearch.Azure.CloudSearchUpdateContext.Delete(IIndexableId id)
at Sitecore.ContentSearch.SitecoreItemCrawler.Update(IProviderUpdateContext context, IIndexableUniqueId indexableUniqueId, IndexEntryOperationContext operationContext, IndexingOptions indexingOptions)
at Sitecore.ContentSearch.AbstractSearchIndex.<>c__DisplayClass93_2.<PerformUpdate>b__0(IndexableInfo info, ParallelLoopState parallelLoopState)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
For those with the same issue,
The patch is Sitecore.Support.158988 found here:
https://github.com/SitecoreSupport/Sitecore.Support.158988
Versions cover Sitecore 8.2 update 1 and update 2.
164633 The CloudSearchUpdateContext.Delete(IIndexableId) fails with an exception in case the search index does not contain any matching documents.
Thanks.
Looks like there is a patch for this from Sitecore, hopefully this will resolve the issue.

Process runs fine while running through process screen but not under automated schedule

I have a process that I'm trying to schedule. When the schedule runs, I get the following error:
Message: Error #199: You are not currently logged in.
Date/Time: 09/06/2015 10:20
Platform:
Browser:
Source: PX.Data
Target Site: Int32 GetCurrentCompany()
Stack Trace: at PX.Data.PXDatabaseProviderBase.GetCurrentCompany()
at PX.Data.PXDatabaseProviderBase.getCompanyID(String tableName, companySetting& setting)
at PX.Data.PXDatabaseProviderBase.getRestriction(String table, String alias, Boolean mainRestriction, Boolean isRightJoin, Nullable`1 effectiveCid)
at PX.Data.PXDatabaseProviderBase.alterText(String text, Int32 start, Int32 stop, Boolean isTopLevelQuery)
at PX.Data.PXDatabaseProviderBase.alterText(String text, Int32 start, Int32 stop, Boolean isTopLevelQuery)
at PX.Data.PXDatabaseProviderBase.Select(PXGraph graph, BqlCommand command, Int32 topCount, PXView view, PXDataValue[] pars)
at PX.Data.PXGraph.ProviderSelect(BqlCommand command, Int32 topCount, PXView view, PXDataValue[] pars)
at PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter)
at PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Data.PXSelectBase`1.selectBound[Resultset](BqlCommand command, Boolean readOnly, PXGraph graph, Int32 startRow, Int32 totalRows, Object[] currents, Object[] pars)
at PX.Data.PXSelectBase`1.select[Resultset](BqlCommand command, Boolean readOnly, PXGraph graph, Int32 startRow, Int32 totalRows, Object[] pars)
at PX.Data.PXSelectReadonly`2.SelectWindowed[Resultset](PXGraph graph, Int32 startRow, Int32 totalRows, Object[] pars)
at PX.Data.PXSelectReadonly`2.Select[Resultset](PXGraph graph, Object[] pars)
at Exosoft.MP.MikePero.Graphs.RexApiMaint.GetCustomerByCD(String id)
The process runs fine when I run it through my process screen but not under an automated schedule.
Error happens when I call the below...
PXSelectReadonly<PX.Objects.AR.Customer, Where<PX.Objects.AR.Customer.acctCD, Equal<Required<PX.Objects.AR.Customer.acctCD>>>>.Select(this, id);
The graph and the graph it calls to process are custom based on a custom table I created. I have added CompanyID and the other audit fields to the custom table. This is how I am calling it
public class SyncRexApiProcess : PXGraph<SyncRexApiProcess>
{
public PXCancel<RexApiLogin> Cancel;
public PXProcessing<RexApiLogin> RexApiLogins;
public SyncRexApiProcess()
{
RexApiLogins.SetProcessCaption("Sync From Rex Api Login");
RexApiLogins.SetProcessAllCaption("Sync From All Rex Api Logins");
RexApiLogins.SetProcessDelegate<RexApiMaint>(
delegate(RexApiMaint graph, RexApiLogin login)
{
graph.Clear();
Func<Task> task = async () =>
{
await graph.SyncAPIDataAsync(login);
};
task().Wait();
});
}
}
By using async/await, your code will run in a different thread, which isn't guaranteed to be initialized properly with session variables. I don't believe Acumatica guarantees any sort of thread-safety with the graph or any of the caches, so you should separate any code that interacts with it from your asynchronous operations.
Furthermore, I don't see any reason to use an asynchronous operation; it will just make your life harder in this case - just run your API synchronization from the main thread. If you want to run multiple operations at once, and wait for them to return, then isolate these operations from the graph and caches.

Sharepoint 2013 Access App - Request Not Completed - Access Denied

In a project context: SQL Server 2012, SP 2013 (build version: 15.0.4481.1005)
I added Access Apps downloaded from the SharePoint Store to a SharePoint sub-site but I keep on having this issue: "Request Not Completed - You do not have permission to view the records. To obtain permission, contact your site administrator." while trying to open them.
This is happening whatever the Access App is: I tried "Recruiting Helper" and "Orders and Products". For information, they are working correctly when I'm adding them to the SharePoint root site!
Do you have any idea where this can come from?
ResponseTimeUsageProvider: Writing log usage succeeded for Operation: ExecuteScalar. System: SQLCallFromADS. DatabaseName: ... . StartTime: 11/07/2013 11:01:51. EndTime: 11/07/2013 11:01:51. Notes: UlsCorrelationID: f942549c-a3cf-5096-f9b9-504710cde05f; CommandText: SELECT COUNT(*) FROM sys.fulltext_catalogs;
Unknown SPRequest error occurred. More information: 0x80070005
SPRequest.GetUsersDataAsSafeArray: UserPrincipalName=, AppPrincipalName=... ,bstrUrl=... ,dwUsersScope=5 ,dwUserCollectionFlags=0 ,bstrValue= ,dwValue=1073741823
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:
at Microsoft.SharePoint.SPUser.InitMember()
at Microsoft.SharePoint.SPUser..ctor(SPWeb web, SPSecurableObject scope, String strIdentifier, Object[,] arrUsersData, UInt32 index, Int32 iByParamId, String strByParamSID, String strByParamEmail, SPUserCollectionType userCollectionType, SPUserCollectionFlags ucf, Boolean isSiteAuditor)
at Microsoft.SharePoint.SPUserCollection.GetByIDNoThrow(Int32 id)
at Microsoft.SharePoint.SPSite.get_SystemAccount()
at Microsoft.Office.Access.Services.Host.MossHostHelperMethods.RunAsSiteSystemAccount(SafeSPWeb web, Action`1 method)
at Microsoft.Office.Access.Services.MossHost.MossApplicationPeer.set_FullTextEnabled(Nullable`1 value)
at Microsoft.Office.Access.Services.OM.Application.get_FullTextEnabled()
at Microsoft.Office.Access.Services.Data.SqlDataProvider.GetData(Application application, CurrentUserBase user, AccessObjectSchema objectSchema, IEnumerable`1 fields, String restriction, FilterInfoEx filter, String sortExpression, IDictionary`2 queryParameters, Int32 startRow, Int32 endRow, Boolean retrieveExactRowCount, Int32& totalRowCount)
at Microsoft.Office.Access.Services.DataServer.CachedResultSet.RetrieveData(Int32 startRow, Int32 endRow)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.OpenResultSetInternal(CommandParameter parameter, FieldList fields, String restriction, KeyValuePair[] queryParameters, String sortExpression, FilterInfo filter, String moniker, Int32 startRowIndex, Int32 maximumRows, Boolean lockSession, Boolean autoResync, Boolean retrieveExactRowCount, DataTable& tempTable, Int32& tempTotalRowCount)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.c__DisplayClassbe.b__bb()
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.ExecuteDataServerOperation(CommandParameter parameter, String protocolVersion, String moniker, AccessDataServerOperation op, WebMethodType webMethodType, PCID pcidTimeAvg, PCID pcidTimeAvgBase, Guid userCookieId, Boolean isApplicationDesignOperation, Boolean isDatabaseProviderOperation, String container)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.OpenResultSet(CommandParameter parameter, FieldList fields, String container, String restriction, KeyValuePair[] queryParameters, String sortExpression, FilterInfo filter, String source, Int32 startRowIndex, Int32 maximumRows, Boolean autoResync, Boolean retrieveExactRowCount, String& tableXml, Int32& totalRowCount, Guid userCookieId)
at SyncInvokeOpenResultSet(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SecurityChannelListener`1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state)
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Unknown SPRequest error occurred. More information: 0x80070005
SPRequest.GetUsersDataAsSafeArray: UserPrincipalName=, AppPrincipalName= ,bstrUrl=... ,dwUsersScope=5 ,dwUserCollectionFlags=0 ,bstrValue= ,dwValue=1073741823
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:
at Microsoft.SharePoint.SPUser.InitMember()
at Microsoft.SharePoint.SPUser..ctor(SPWeb web, SPSecurableObject scope, String strIdentifier, Object[,] arrUsersData, UInt32 index, Int32 iByParamId, String strByParamSID, String strByParamEmail, SPUserCollectionType userCollectionType, SPUserCollectionFlags ucf, Boolean isSiteAuditor)
at Microsoft.SharePoint.SPUserCollection.GetByIDNoThrow(Int32 id)
at Microsoft.SharePoint.SPSite.get_SystemAccount()
at Microsoft.Office.Access.Services.Host.MossHostHelperMethods.c__DisplayClass2.b__0()
at Microsoft.SharePoint.SPSecurity.c__DisplayClass5.b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.Office.Access.Services.Host.MossHostHelperMethods.RunAsSiteSystemAccount(SafeSPWeb web, Action`1 method)
at Microsoft.Office.Access.Services.MossHost.MossApplicationPeer.set_FullTextEnabled(Nullable`1 value)
at Microsoft.Office.Access.Services.OM.Application.get_FullTextEnabled()
at Microsoft.Office.Access.Services.Data.SqlDataProvider.GetData(Application application, CurrentUserBase user, AccessObjectSchema objectSchema, IEnumerable`1 fields, String restriction, FilterInfoEx filter, String sortExpression, IDictionary`2 queryParameters, Int32 startRow, Int32 endRow, Boolean retrieveExactRowCount, Int32& totalRowCount)
at Microsoft.Office.Access.Services.DataServer.CachedResultSet.RetrieveData(Int32 startRow, Int32 endRow)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.OpenResultSetInternal(CommandParameter parameter, FieldList fields, String restriction, KeyValuePair[] queryParameters, String sortExpression, FilterInfo filter, String moniker, Int32 startRowIndex, Int32 maximumRows, Boolean lockSession, Boolean autoResync, Boolean retrieveExactRowCount, DataTable& tempTable, Int32& tempTotalRowCount)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.c__DisplayClassbe.b__bb()
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.ExecuteDataServerOperation(CommandParameter parameter, String protocolVersion, String moniker, AccessDataServerOperation op, WebMethodType webMethodType, PCID pcidTimeAvg, PCID pcidTimeAvgBase, Guid userCookieId, Boolean isApplicationDesignOperation, Boolean isDatabaseProviderOperation, String container)
at Microsoft.Office.Access.Services.DataServer.WebService.AccessServiceSoap.OpenResultSet(CommandParameter parameter, FieldList fields, String container, String restriction, KeyValuePair[] queryParameters, String sortExpression, FilterInfo filter, String source, Int32 startRowIndex, Int32 maximumRows, Boolean autoResync, Boolean retrieveExactRowCount, String& tableXml, Int32& totalRowCount, Guid userCookieId)
at SyncInvokeOpenResultSet(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SecurityChannelListener`1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state)
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
SqlDataProvider.GetData: Exception thrown: {System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
at Microsoft.SharePoint.Library.SPRequest.GetUsersDataAsSafeArray(String bstrUrl, UInt32 dwUsersScope, UInt32 dwUserCollectionFlags, String bstrValue, UInt32 dwValue, UInt32& pdwColCount, UInt32& pdwRowCount, Object& pvarDataSet)
at Microsoft.SharePoint.SPUser.InitMember()
at Microsoft.SharePoint.SPUser..ctor(SPWeb web, SPSecurableObject scope, String strIdentifier, Object[,] arrUsersData, UInt32 index, Int32 iByParamId, String strByParamSID, String strByParamEmail, SPUserCollectionType userCollectionType, SPUserCollectionFlags ucf, Boolean isSiteAuditor)
at Microsoft.SharePoint.SPUserCollection.GetByIDNoThrow(Int32 id)
at Microsoft.SharePoint.SPSite.get_SystemAccount()
at Microsoft.Office.Access.Services.Host.MossHostHelperMethods.c__DisplayClass2.b__0()
at Microsoft.SharePoint.SPSecurity.c__DisplayClass5.b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.Office.Access.Services.Host.MossHostHelperMethods.RunAsSiteSystemAccount(SafeSPWeb web, Action`1 method)
at Microsoft.Office.Access.Services.MossHost.MossApplicationPeer.set_FullTextEnabled(Nullable`1 value)
at Microsoft.Office.Access.Services.OM.Application.get_FullTextEnabled()
at Microsoft.Office.Access.Services.Data.SqlDataProvider.GetData(Application application, CurrentUserBase user, AccessObjectSchema objectSchema, IEnumerable`1 fields, String restriction, FilterInfoEx filter, String sortExpression, IDictionary`2 queryParameters, Int32 startRow, Int32 endRow, Boolean retrieveExactRowCount, Int32& totalRowCount)}
ResponseTimeUsageProvider: Writing log usage succeeded for Operation: GetData:ExecuteReader. System: SQLCallFromADS. DatabaseName: .... StartTime: 11/07/2013 11:01:51. EndTime: 11/07/2013 11:01:51. Notes: UlsCorrelationID: f942549c-a3cf-5096-f9b9-504710cde05f;

Install-SPUserSolution: Sandboxed code execution request failed

When executing Install-SPUserSolution powershell command the following error is shown:
Install-SPUserSolution : Sandboxed code execution request failed.
At line:1 char:23
+ Install-SPUserSolution <<<< -Identity some_package.wsp -Site http://localhost/sites/test
+ CategoryInfo : InvalidData: (Microsoft.Share...allUserSolution:
SPCmdletInstallUserSolution) [Install-SPUserSolution], SPUserCodeExecu...F
ailedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletInstallU
serSolution
When I try to activate the user solution from the SharePoint interface everything works fine. So this doesn't work only from PowerShell. I tried to run user code service under different account (admin account) but this didn't help. Currently this service is running under Network Service account.
Also when I run Add-SPUserSolution or Uninstall-SPUserSolution they work just fine. I was able to reproduce this issue on at least two servers. Please advice.
[UPD] I'm including full stack trace from SharePoint logs
Sandboxed code execution request failed. - Inner Exception: System.InvalidOperationException Server stack trace: at Microsoft.SharePoint.Utilities.Verify.DoFailTag(UInt32 tag, ULSCat category, Type type, String format, Object[] args) at Microsoft.SharePoint.Utilities.Verify.IsTrueTag(UInt32 tag, ULSCat category, Boolean expression, Type type, String format, Object[] args) at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) 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.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)

Publishing web project to azure failed: The "IsolatedCSPack" task failed unexpectedly

I have web application that I want to publish and upload to windows azure.
I use Visual Studio 2008.
I click on "publish", chose "Create Service Package Only" in "Publish Cloud Service" window, andclick on "OK".
The publish failed tnd the exception is:
Error 26 The "IsolatedCSPack" task failed unexpectedly.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Server stack trace:
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.SparseMemoryStream.CopyMemoryBlocksToStream(Stream targetStream)
at MS.Internal.IO.Packaging.SparseMemoryStream.WriteToStream(Stream stream)
at MS.Internal.IO.Zip.ZipIOFileItemStream.Save()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Save()
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Packaging.PackagePart.Close()
at System.IO.Packaging.Package.DoClose(PackagePart p)
at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)
at System.IO.Packaging.Package.System.IDisposable.Dispose()
at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreateRolePackages(ModelProcessor modelProcessor, PackageManifest applicationManifest, Package applicationPackage)
at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreatePackage(Stream outputStream)
at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, IPackageSecurity encrypt, Dictionary`2 namedStreamCollection, String userInfo, EventHandler`1 rolePackagePartAddedHandler)
at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, RSACryptoServiceProvider encrypt, Dictionary`2 namedStreamCollection, String userInfo, EventHandler`1 rolePackagePartAddedHandler)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.TryCreatePackage(ServiceDefinitionModel sm)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.Execute()
at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.RemoteCSPackBridge.Execute(TaskLoggingHelper log, IBuildEngine buildEngine, ITaskHost hostObject, String serviceHostingTasksPath, String output, String serviceDefinitionFile, ITaskItem[] packRoles, Boolean copyOnly, String generateConfigurationFile, Boolean noEncryptPackage, ITaskItem[]& copiedFiles, ITaskItem[]& outputFiles)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
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.CloudExtensions.MSBuildTasks.IsolatedCSPack.RemoteCSPackBridge.Execute(TaskLoggingHelper log, IBuildEngine buildEngine, ITaskHost hostObject, String serviceHostingTasksPath, String output, String serviceDefinitionFile, ITaskItem[] packRoles, Boolean copyOnly, String generateConfigurationFile, Boolean noEncryptPackage, ITaskItem[]& copiedFiles, ITaskItem[]& outputFiles)
at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets 865 5 Starlims.SDMS.Azure
How can i resolve this?
Happened to me before... try restarting the computer (I know... it's a bit "Technical Support" advice - but it worked for me!
This looks like the same problem someone else posted about on the MSDN Azure forum. Their problem was that a resource was being copied into the project with:
build action = Content
Copy to Output Directory = Copy if Newer.
They changed the latter to Never and the problem went away.

Resources