none
Why does Project Server 2013 timeout RRS feed

  • Question

  • Might be easier to describe during a phone call, but this is for Project Server 2013 On Premise. Below is a snippet of code that causes a timeout.

    <o:p></o:p>

    There are about 13000 enterprise resources. I've incresed List View
    Threshold up to 50000, but it hasn't helped.<o:p></o:p>

     <o:p></o:p>

    public ProjectContext ProjectContext { get; }<o:p></o:p>

    ProjectContext = new ProjectContext(projectOnlineUrl)<o:p></o:p>

    {<o:p></o:p>

                   
    Credentials = new NetworkCredential(projectOnlineUserName,
    projectOnlinePassword)<o:p></o:p>

    };<o:p></o:p>

    ProjectContext.RequestTimeout = RequestTimeout;<o:p></o:p>

    ProjectContext.PendingRequest.RequestExecutor.WebRequest.Timeout =
    RequestTimeout;<o:p></o:p>

    ProjectContext.PendingRequest.RequestExecutor.WebRequest.ReadWriteTimeout =
    RequestTimeout;<o:p></o:p>

                                                   
    <o:p></o:p>

    ProjectContext.Load(ProjectContext.EnterpriseResources, er => er.Where(x
    => x.Id == id).IncludeWithDefaultProperties(x => x.User));<o:p></o:p>

    ProjectContext.ExecuteQuery(); <------------------- EXCEPTION HERE<o:p></o:p>

     <o:p></o:p>

    System.Net.WebException: The underlying connection was closed: An unexpected
    error occurred on a receive. ---> System.IO.IOException: Unable to read data
    from the transport connection: An existing connection was forcibly closed by
    the remote host. ---> System.Net.Sockets.SocketException: An existing
    connection was forcibly closed by the remote host<o:p></o:p>

       at System.Net.Sockets.Socket.Receive(Byte[]
    buffer, Int32 offset, Int32 size, SocketFlags socketFlags)<o:p></o:p>

       at
    System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)<o:p></o:p>

       --- End of inner exception stack
    trace ---<o:p></o:p>

       at
    System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)<o:p></o:p>

       at
    System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)<o:p></o:p>

       at
    System.Net.Connection.SyncRead(HttpWebRequest request, Boolean
    userRetrievedStream, Boolean probeRead)<o:p></o:p>

       --- End of inner exception stack
    trace ---<o:p></o:p>

       at
    System.Net.HttpWebRequest.GetResponse()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder
    sb)<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()<o:p></o:p>

       at
    WebHookData.DataAccess.ExternalAPI.ProjectOnlineAccessService.GetResourceWithUser(Guid
    id) in
    C:\Work\TITG-SPPSI\ProjectServerSync\WebHookData.DataAccess\ExternalAPI\ProjectOnlineAccessService.cs:line
    827 The underlying connection was closed: An unexpected error occurred on a
    receive.<o:p></o:p>

    Unable to read data from the transport
    connection: An existing connection was forcibly closed by the remote host.<o:p></o:p>

    An existing connection was forcibly closed by the
    remote host<o:p></o:p>

     <o:p></o:p>

    public EnterpriseResource
    GetResourceWithAssignments(Guid id)<o:p></o:p>

            {<o:p></o:p>

               
    ProjectContext.Load(ProjectContext.EnterpriseResources, er => er.Where(x
    => x.Id == id).IncludeWithDefaultProperties(x => x.Assignments));<o:p></o:p>

               
    ProjectContext.ExecuteQuery();<o:p></o:p>

               
    EnterpriseResource resource = ProjectContext.EnterpriseResources.FirstOrDefault();<o:p></o:p>

               
    return resource;<o:p></o:p>

            }<o:p></o:p>

    EnterpriseResource enterpriseResource
    =GetResourceWithAssignments(oDataResource.ResourceId);<o:p></o:p>

     <o:p></o:p>

    StatusAssignment statusAssignment =
    enterpriseResource.Assignments.FirstOrDefault(i => i.Id ==
    oDataAssignment.AssignmentId);<o:p></o:p>

    if (statusAssignment.Start >
    actual.DateStarted.Value)<o:p></o:p>

    {<o:p></o:p>

                   
    statusAssignment.Start = actual.DateStarted.Value;<o:p></o:p>

    }<o:p></o:p>

    if (statusAssignment.Finish <
    actual.DateStarted.Value)<o:p></o:p>

    {<o:p></o:p>

                   
    statusAssignment.Finish = actual.DateStarted.Value;<o:p></o:p>

    }<o:p></o:p>

    enterpriseResource.Assignments.Update();<o:p></o:p>

    ProjectContext.ExecuteQuery();
    <------------------- EXCEPTION HERE<o:p></o:p>

     <o:p></o:p>

    Microsoft.SharePoint.Client.ServerException: The
    operation has timed out.<o:p></o:p>

       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream
    responseStream)<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder
    sb)<o:p></o:p>

       at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()<o:p></o:p>

       at
    Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()<o:p></o:p>

       at
    WebHookData.DataAccess.ExternalAPI.ProjectOnlineAccessService.ExecuteQuery() in
    C:\Work\TITG-SPPSI\ProjectServerSync\WebHookData.DataAccess\ExternalAPI\ProjectOnlineAccessService.cs:line
    872<o:p></o:p>

       at
    WebHookDataProcessor.DataSyncJira.ProcessWebHookEntriesWorklogs(ProjectOnlineAccessService
    projectOnlineAccessService, Guid projectUid, List`1 stagings, List`1
    systemLinksForProjectGrouped, List`1 syncSystems, List`1 worklogs) in
    C:\Work\TITG-SPPSI\ProjectServerSync\WebHookDataProcessor\DataSyncJira.cs:line
    840 The operation has timed out.<o:p></o:p>


    • Moved by Patrick_Liang Thursday, December 29, 2016 1:27 AM Project Server issue
    Wednesday, December 28, 2016 3:19 AM

All replies