Skip to content

StoreApi.objects.inserts returns: Connection closed before full header was received #665

Description

@IbrahimYildirim

Receiving this error in ~50% of the cases where i try to insert and object into my Google Cloud Storage bucket, so it's kind of a gamble of when it works and when it doesn't.

This comes when i call in my google_cloud_storage_service.dart.

      final resp = await storageApi.objects.insert(
        bucketObject,
        bucketName,
        uploadMedia: Media(file.openRead(), file.lengthSync()),
      );

The Exception and stacktrace of the error

ClientException: Connection closed before full header was received, uri=https://storage.googleapis.com/upload/storage/v1/b/[BUCKETNAME]/o?uploadType=multipart&alt=json
#0      IOClient.send (package:http/src/io_client.dart:156:7) <asynchronous suspension>
#1      AuthenticatedClient.send (package:googleapis_auth/src/auth_http_utils.dart:41:22) <asynchronous suspension>
#2      ApiRequester.request (package:_discoveryapis_commons/src/api_requester.dart:69:20) <asynchronous suspension>
#3      ObjectsResource.insert (package:googleapis/storage/v1.dart:3614:23) <asynchronous suspension>
#4      GoogleCloudStorageService.uploadFile (package:my_sleep_affirmations/core/services/google_cloud_storage_service.dart:37:20)
<asynchronous suspension>

The content of the link in the exception is a page with the text: Method Not Allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions