First upload to GCS always times out

66 views
Skip to first unread message

Mitch Rudominer

unread,
Nov 15, 2017, 9:44:45 PM11/15/17
to Google APIs Client Library for C++
I am using the Google APIs Client library for C++ in order to upload files to a GCS bucket. In my experience the first attempt at an upload always fails with a timeout.
Subsequent upload attempts succeed. Also if I perform a different operation before the first upload, such as listing the buckets, then that succeeds and the
first upload after that succeeds. I only get the timeout if the first thing I do is an upload.

Here is the error I get:

Call to url=https://www.googleapis.com/upload/storage/v1/b/<MY_BUCKET_NAME_REDACTED>/o?uploadType=media&name=<MY_FILE_NAME_REDACTED> failed with http status 0
E1114 10:34:54.355522 18569 gcs_util.cc:113] Error attempting upload: DEADLINE_EXCEEDED: Request timed out

Does anyone have any insight into this issue? Below is a snippet of my code used to perform the upload:

  std::unique_ptr<ObjectsResource_InsertMethod> request(
      storage_service_->get_objects().NewInsertMethod(
          &oauth_credential_, bucket, nullptr, mime_type.c_str(),
          NewUnmanagedInMemoryDataReader(file_contents)));
  request->set_name(file_path);

  // Execute the request.
  Json::Value value;
  google_storage_api::Object response(&value);
  auto status = request->ExecuteAndParseResponse(&response);

Mitch Rudominer

unread,
Nov 15, 2017, 9:44:45 PM11/15/17
to Google APIs Client Library for C++

Matt Ritter

unread,
Dec 3, 2018, 5:52:31 PM12/3/18
to Google APIs Client Library for C++
Was this ever resolved? I'm seeing a similar issue and am curious about what happened.
Reply all
Reply to author
Forward
0 new messages