【发布时间】:2019-06-09 13:11:52
【问题描述】:
我无法使用以下链接中的示例将文件上传到 GCS: https://cloud.google.com/python/getting-started/using-cloud-storage
在文件storage.py 上失败,方法:upload_file,完全在以下调用上:
blob.upload_from_string(file_stream, content_type=content_type)
我已按照教程将 ACL 配置为 myu 存储桶并启用所需的 API。我还启用了结算功能。
我在本地开发服务器上运行代码,但使用项目中配置的 GCS 默认存储桶名称。
Python 2.7 版
【问题讨论】:
-
你能显示回溯吗?
-
开发服务器并没有真正显示错误或任何东西......它只是显示http 500。即使使用调试标志运行,我猜本地开发服务器也不太适合调试。我发现它在 blob.upload_from_string() 上失败,方法是在 storage.py 文件中的 upload_file() 方法上添加几个日志记录语句
-
您是否为您的应用启用了调试功能?回溯可能仅在设置标志时显示。
-
我的主文件中有以下内容: if name == "main": app.debug = True
-
刚刚启用了一些日志记录,发现以下错误消息:由 SSLError(\"Can\'t connect to HTTPS URL because the SSL module is not available.\",))
标签: google-app-engine google-cloud-platform google-cloud-storage google-app-engine-python