google / google/googleapis.dart

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

Open
#665 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
419
Forks
136
Avg merge
1h 21m
Merged PRs (30d)
5

Description

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)
#1 AuthenticatedClient.send (package:googleapis_auth/src/auth_http_utils.dart:41:22)
#2 ApiRequester.request (package:_discoveryapis_commons/src/api_requester.dart:69:20)
#3 ObjectsResource.insert (package:googleapis/storage/v1.dart:3614:23)
#4 GoogleCloudStorageService.uploadFile (package:my_sleep_affirmations/core/services/google_cloud_storage_service.dart:37:20)

```

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.