【发布时间】:2015-10-01 21:12:06
【问题描述】:
我正在尝试在 Heroku 上部署我的 Django 应用程序。我创建了一个 Heroku Postgres 数据库,我想从 AWS S3 将一个现有的 PostgreSQL 数据库导入其中。我跟着tutorial in the Heroku docs 到了这封信。我创建了一个 Heroku Postgres 数据库并将其提升到主数据库。我按照Heroku's AWS S3 tutorial 设置所有配置变量,以便heroku 可以访问我的S3 存储桶。但是当我运行 heroku pg:backups restore 'https://s3.amazonaws.com/<bucket name>/<database name>' DATABASE_URL 时,我收到一条错误消息,提示“发生错误,您的备份未完成。”
这是heroku pg:backups info的完整输出:
=== Backup info: r012
Database: BACKUP
Started: 2015-07-13 13:43:30 +0000
Finished: 2015-07-13 13:43:30 +0000
Status: Failed
Type: Manual
Backup Size: 0.00B
=== Backup Logs
2015-07-13 13:43:30 +0000: 2015/07/13 13:43:30 aborting: could not write to output stream: Expected HTTP Status 200, received: "403 Forbidden"
2015-07-13 13:43:30 +0000: pg_restore: [custom archiver] could not read from input file: end of file
2015-07-13 13:43:30 +0000: waiting for restore to complete
2015-07-13 13:43:30 +0000: restore done
2015-07-13 13:43:30 +0000: waiting for download to complete
2015-07-13 13:43:30 +0000: download done
当然,由于这是一个 403 错误,我认为我的身份验证有问题。我已经运行heroku config 并三重检查了我所有的配置变量。 AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY 和 DATABASE_URL 环境变量都是正确的,并且与我在 AWS 和 Heroku Postgres GUI 中看到的一致。
为什么我会看到此错误消息?
【问题讨论】:
标签: django database postgresql heroku amazon-s3