Skip to content

Silent Failure Uploading file to Bucket Configured as a Website #95

@Zoramite

Description

@Zoramite

Testing uploading a file to a bucket it silently fails if the bucket is configured as a website. Here is the sample code being used:

import gcloud.storage
connection = gcloud.storage.get_connection('project-id', 'email@developer.gserviceaccount.com', 'key-file.key')
bucket = connection.get_bucket('some.website.com')
path = 'answer.html'
file_key = bucket.new_key(path)
file_key.set_contents_from_string('42')
key = bucket.get_key(path)
print key.get_contents_as_string()

When I run this against a normal bucket the file is saved and read correctly. When run against a bucket that is configured as a website the upload silently fails and is unable to retrieve the value from the bucket to print.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions