quinta-feira, 16 de outubro de 2014

SharePoint 2013 - Workflow suspenso: System.ApplicationException: HTTP 401



O fluxo de trabalho no SharePoint 2013 fica normalmente no estado suspenso com a mensagem de erro "System.ApplicationException: HTTP 401" se o fluxo está configurado para enviar e-mail(s) para um grupo do SharePoint que não permite a exibição da associações.



Mensagem de erro no interface:
RequestorId: <GUID>. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPRequestGuid":["<GUID>"],"request-id":["<GUID>"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4569"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Tue, 15 Oct 2014 14:24:05 GMT"],"Server":["Microsoft-IIS\/8.5"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}
Mensagem de error nos logs do SharePoint:


Exception occured in scope Microsoft.SharePoint.Utilities.SPUtility.SendEmail. Exception=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.SPUserCollection.InitUsersCore(Boolean fCustomUsers, String[] strIdentifiers, SPUserCollectionFlags ucf)     at Microsoft.SharePoint.SPBaseCollection.GetEnumerator()     at Microsoft.SharePoint.Utilities.SPUtility.ResolveAddressesForEmail(SPWeb web, IEnumerable`1 addresses, AddressReader func)     at Microsoft.SharePoint.Utilities.SPUtility.SendEmail_Client(EmailProperties properties)     at Microsoft.SharePoint.ServerStub.Utilities.SPUtilityServerStub.InvokeStaticMethod(String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean& isVoid)     at Microsoft.SharePoint.Client.ServerStub.InvokeStaticMethodWithMonitoredScope(String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)


Solução: Permitir a exibição das associações para todos os usuários do SharePoint ou utilizar um outro grupo.

Fontes:

HTTP Unauthorized to /_vti_bin/client.svc/sp.utilities.utility.SendEmail

[]

SharePoint 2013 - Workflow suspenso: System.ApplicationException: HTTP 500



O fluxo de trabalho no SharePoint 2013 fica normalmente no estado suspenso com a mensagem de erro "System.ApplicationException: HTTP 500" se o fluxo está configurado para enviar e-mail(s) para um grupo do SharePoint e o email de saida não está configurado no SharePoint.

Mensagem de erro no interface:
RequestorId: <GUID>. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 500 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["12"],"SPRequestGuid":["<GUID>"],"request-id":["<GUID>"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4569"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":[" Oct 2014 11:42:51 GMT"],"Server":["Microsoft-IIS\/8.5"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Mensagem de error nos logs do SharePoint:


Exception occured in scope Microsoft.SharePoint.Utilities.SPUtility.SendEmail. Exception=System.Configuration.ConfigurationErrorsException: Exception of type 'System.Configuration.ConfigurationErrorsException' was thrown.     at Microsoft.SharePoint.Utilities.SPUtility.SendEmail_Client(EmailProperties properties)     at Microsoft.SharePoint.ServerStub.Utilities.SPUtilityServerStub.InvokeStaticMethod(String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean& isVoid)     at Microsoft.SharePoint.Client.ServerStub.InvokeStaticMethodWithMonitoredScope(String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)
Solução: Permitir a exibição das associações para todos os usuários do SharePoint ou utilizar um outro grupo.

Solução: Configurar email de saída para um farm do SharePoint 2013

Fontes:

Configure outgoing email for a SharePoint 2013 farm

[]

SharePoint 2013 - Workflow suspenso: System.ArgumentNullException: Value cannot be null.

O fluxo de trabalho no SharePoint 2013 fica normalmente no estado suspenso com a mensagem de erro "Value cannot be null." se o fluxo está configurado para enviar e-mail(s) para um grupo do SharePoint sem membros.


RequestorId: <GUID> Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ArgumentNullException: Value cannot be null. Parameter name: Input at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) 

Solução: Adicionar usuários para o grupo ou utilizar um outro grupo.

[]

terça-feira, 7 de outubro de 2014

Registrando o Workflow Manager resulta em "An error occurred while sending the request"



O evento abaixo ocorre no momento da registração do Workflow Manager devido a problemas de comunicação entre o servidor do Workflow Manager e do servidor do SharePoint:

Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint at URI ‘http://<URL>/_layouts/15/metadata/json/1&#8242;. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server 

Nos logs do SharePoint:

Microsoft.Workflow.Client.InvalidRequestException: Failed to query the OAuth S2S metadata endpoint at URI ‘http://<URL>/_layouts/15/metadata/json/1&#8242;. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server – ActivityId: 1b2624e2-42a0-4a93-8c93-2ada0630967c. NodeId: server. Scope: /SharePoint. Client ActivityId : 487d86fd-c961-4d8c-aab2-47269989b292. —> System.Net.WebException: The remote server returned an error: (400) Bad Request 

Verifique o acesso a página http://<URL>/_layouts/15/metadata/json/1 (OAuth Endpoint) do SharePoint a partir do servidor do Workflow Manager. A mensagem no navegador deve ser a mesma - "(400) Bad Request".
A solução seria criar um registro host no servidor do Workflow Manager ou (melhor) um registro do tipo A no DNS do ambiente para o FQDN da página do SharePoint.

[]

SharePoint 2013 e OAuth - Uma visão geral


sexta-feira, 3 de outubro de 2014

Project Server - Mensagem "Erro interno ao aplicar a atualização" no histórico das aprovações




O erro "Erro interno ao aplicar a atualização" (There was an internal error applying the update) no histórico das aprovações é comum em ambientes que não possuem  os requisitos mínimos recomendados para os produtos SharePoint 2013 e Project Server 2013 ou em ambientes com problemas de desempenho e ocorre principalmente com projetos grandes.

O seguinte evento ocorre nos logs do SharePoint:


10/03/2014 06:21:35.51 Microsoft.Office.Project.Server (0x07FC) 0x21EC Project Server Task Statusing and Updates av9k Medium Error is: StatusingInternalError. Details: Status approval internal error Attributes:  Microsoft.Office.Project.Server.BusinessLayer.PcsEngine.PcsManagerException: CalcServiceProxy - EndBatchOperation - Exception ---> System.TimeoutException: CalcServiceManager : Timeout when communicating with the worker in sessionId: r2XWq+BmdkWpFUnR5t7Z4yi+7d4vlxHkr2d4K8u/e0ofDJ2i6zAR45P/ABVdTVgg9p05dkr/EeSUDQAVXU1YILfyVh8h9iFKquDFUw7DO6c=System.TimeoutException: This request operation sent to net.tcp://localhost:PORT/GUID did not receive a reply within the configured timeout (00:00:30).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.    Server stack trace:      at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request [...] Name: Project Server Service Application PSError: StatusingInternalError (3116), LogLevelManager Warning-ulsID:0x6176396B has no entities explicitly specified. 7685be9c-ebb6-20c1-33ba-7f54e8451c86

A solução seria corrigir os problemas de desempenho, porém as vezes existe a necessidade de atuar rápido e nós podemos contornar o problema ajustando o timeout "RequestTimeLimits" do serviço "Project Server Calculation Service" por meio do seguinte comando:

Set-SPProjectPCSSettings -Service Application "Project Server Service Application" -RequestTimeLimits 60000

O valor default é 30000ms (30 segundos):

É necessário de reiniciar o serviço "Microsoft Project Server Calculation Service" (ProjectCalcService15) depois da configuração.

Project Server deve processar as atualizações após essa mudança:


UPDATE:

A seguinte consulta identifica as atualizações que não foram aplicadas:


select p.PROJ_NAME, p.PROJ_UID, t.TASK_NAME, r.RES_NAME from pub.MSP_ASSIGNMENT_TRANSACTIONS at
inner join pub.MSP_Projects p on p.PROJ_UID = at.PROJ_UID
inner join pub.MSP_RESOURCES r on r.RES_UID = at.ASSN_TRANS_SUBMITTER_RES_UID
inner join pub.MSP_ASSIGNMENTS_SAVED t on t.TASK_UID = at.TASK_UID
where at.ASSN_TRANS_STATE_ENUM in (4) 
order by p.PROJ_NAME

UPDATE II:

Execute a seguinte consulta para aplicar as atualizações em um projeto determinado pelo GUID identificado a partir da consulta anterior.

Update pub.MSP_ASSIGNMENT_TRANSACTIONSset ASSN_TRANS_STATE_ENUM = 2where PROJ_UID = '<PROJUID-GUID>' and ASSN_TRANS_STATE_ENUM = 4

Abre o projeto no Project Professional e publique o projeto. 


Fontes:



segunda-feira, 8 de setembro de 2014

SharePoint 2013 - “The item has been truncated in the index because it exceeds the maximum size”

O seguinte evento da pesquisa (severidade "Warning") está relacionado ao tamanho de uma propriedade gerenciada indexada, nesse caso o campo "body".

The item has been truncated in the index because it exceeds the maximum size. ( Item truncated. Field=body, Occurrences=98660, Chars=524288; ; SearchID = F99FEAD1-C0D9-4A2B-9883-5A9C9ED582B4 )

O limite default é 512kb e configurável, o tamanho máximo é 2048kb.

Utilize o script abaixo para configurar o limite para 2048kb:
$ssa = Get-SPEnterpriseSearchServiceApplication$mpi = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Identity "body"$mpi.MaxCharactersInPropertyStoreForRetrieval = 2097152$mpi.Update()

Limites de software para o SharePoint 2013

sexta-feira, 5 de setembro de 2014

Project Server 2013 - Falha na publicação do projeto: SynchronizeTaskListInManagedModeMessage

A mensagem de erro na fila do servidor ocorre principalmente para projetos que utilizam páginas de projetos customizadas.
<?xml version="1.0" encoding="utf-16"?>
<errinfo>
 <general>
  <class name="Microsoft.Office.Project.Server.BusinessLayer.Queue.Message">
   <error id="23000" name="ProjectPublishFailure" uid="<UID>" projectuid="<PUID>" messagetype="Microsoft.Office.Project.Server.BusinessLayer.QueueMsg.SynchronizeTaskListInManagedModeMessage" messageID="38" stage="" blocking="Block"/>
  </class>
  <class name="Queue">
   <error id="26000" name="GeneralQueueJobFailed" uid="<UID>" JobUID="<JobUID>" ComputerName="<GUID>" GroupType="ProjectPublish" MessageType="SynchronizeTaskListInManagedModeMessage" MessageId="38" Stage="" CorrelationUID="<CORRELATION"/>
  </class>
 </general>
</errinfo>

Nesse caso especifico porque o campo "assigned to" não permite entradas múltiplas ou não existe. A lista alimenta também o service application "Work Management Service Application".

A solução é simples - 

1. Configurar o campo para permitir entradas múltiplas :


2. Desabilitar e habilitar o feature "Project Functionality" novamente:


SharePoint 2013: Work Management Service Application


[]