Operation timed out after 60011 milliseconds with 92 out of 92 bytes received

Tony Joy 0 Reputation points
2024-02-26T09:59:38.2233333+00:00

Hello dev team, Tony here from WPvivid.com. We have integrated OneDrive in our app. Recently we've got an issue: We use "https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online" for uploading file exceeds 4MB to OneDrive. The main code our app uses for creating a upload session is as follows: $path=$remote_path.'/'.basename($file); $url='https://graph.microsoft.com/v1.0/me/drive/root:/'.$path.':/createUploadSession'; $response=$this->remote_post($url); Obtained uploadUrl $response['body']['uploadUrl'], and then after getting the uploadUrl   $response['body']['uploadUrl', it uses this url to upload files in chunks. The main code is as follows: $curl = curl_init(); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 60); curl_setopt($curl, CURLOPT_TIMEOUT, 60); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $upload_size=min($upload_size,$file_size-$uploaded); if ($uploaded) fseek($file_handle, $uploaded); $headers = array( "Content-Length: $upload_size", "Content-Range: bytes $uploaded-$upload_end/".$file_size, ); $headers[] = 'Authorization: Bearer ' . $this->options['token']['access_token']; $options = array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers, CURLOPT_PUT => true, CURLOPT_INFILE => $file_handle, CURLOPT_INFILESIZE => $upload_size, CURLOPT_RETURNTRANSFER=>true, ); curl_setopt_array($curl, $options); $response=curl_exec($curl); $http_code = curl_getinfo($curl,CURLINFO_HTTP_CODE); Starting around February 13th, some users had this problem on their sites: $response=curl_exec($curl); There is no response when the process is executed here, and the process is stuck because the curl timeout is set for 60 seconds. After 60 seconds, the task is terminated, the value of $response is false, and the $http_code obtained by curl_getinfo is 202. We have also implemented breakpoint resume uploading, so when $response=curl_exec($curl) did not respond, our app will retry 3 times and continued uploading using breakpoint resume. However, the problem now is there is no response for http request. For example, the chunk size is 2MB. After there is no response, the next upload is 4MB but there is still no response. Then our app will retry again to upload 6MB but still get no response. In the end, the file upload fails with the curl_error($curl ); "Operation timed out after 60011 milliseconds with 92 out of 92 bytes received" Please help. Thank you!

Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 30,051 Reputation points Microsoft External Staff
    2024-02-27T02:02:53.6+00:00

    Hi,

    I suggest you post this issue to OneDrive for Developer forum:

    https://techcommunity.microsoft.com/t5/onedrive-developer/bd-p/OneDriveDeveloper

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    If the response is helpful, please click "Accept Answer" and upvote it. Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.