0
當我嘗試從Google雲端存儲(App Engine,Python,標準環境)中讀取文件內容(純文本)時,我收到以下跟蹤:無法從應用引擎中的Google雲端存儲中讀取文件內容
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))
雖然設置了「公開分享」,但我在默認存儲桶中工作(應用程序應該具有完全的權限以便理解),並且能夠將內容寫入/上傳到同一文件。
作爲額外的信息,我使用GAE開發服務器觸發來自http路由的請求。
你能指點我正確的方向嗎? :d
代碼如下:
def getDatastoreClient():
projectId = 'xxxxxx'
return storage.Client(projectId)
def readFileFromBucket(filename):
# Instantiates a client
storage_client = getDatastoreClient()
# Creates the new bucket
bucket = storage_client.get_bucket(BUCKETNAME)
blob = bucket.get_blob(filename)
return blob.download_as_string()
您使用的是什麼版本的「requests」?恢復到v2.3,看看是否修復它。 – GAEfan
哇!其實它確實有幫助,這是什麼意思?我一直在使用2.17.3,我也試過2.18 ... – ignzz