Heroku:从S3导入失败 [英] Heroku: importing from S3 failing
问题描述
我正在尝试将本地Postgresql数据库导入到Heroku,并且正在按照以下步骤操作
I'm trying to import a local Postgresql database to Heroku and I'm following these steps https://devcenter.heroku.com/articles/heroku-postgres-import-export#import-to-heroku-postgres.
我已经成功:
- 创建了转储
- 将其上传到S3存储桶
- 从AWS CLI创建一个已签名的链接
- 运行命令
heroku pg:backups:restore '<SIGNED URL>' DATABASE_URL
(在-a中加上我的应用名称).
- created a dump
- uploaded it to an S3 Bucket
- created from AWS CLI a signed link
- ran the command
heroku pg:backups:restore '<SIGNED URL>' DATABASE_URL
(adding -a with my app name).
还原备份的过程正确开始,但随后退出,并显示以下代码:
The process to restore a backup starts correctly but then exits with this code:
! An error occurred and the backup did not finish.
!
! Could not initialize transfer
!
! Run heroku pg:backups:info r011 for more details.
打开日志显示:
Database: BACKUP
Finished at: 2020-01-09 18:49:30 +0000
Status: Failed
Type: Manual
Backup Size: 0.00B (0% compression)
=== Backup Logs
2020-01-09 18:49:30 +0000 Could not initialize transfer
我尝试过:
- re-uploading the file to the bucket,
- generating a new signed link,
- putting the app in maintenance mode,
- I've created a user in my IAM management service with full S3 access and saved the credentials in the app environment as from https://devcenter.heroku.com/articles/s3
不知道从这里去哪里,但会有所帮助. (我在业余爱好计划中,因此我不能向Heroku的支持寻求帮助)
Not sure where to go from here but would appreciate any help. (I'm on the hobby plan therefore I can't ask Heroku's support for help)
我也尝试过:
- 删除并重新创建S3存储桶
- 安装版本1的AWS CLI,以查看是否偶然更改了预签名链接的结构
由于找不到解决方案,因此我选择暂时完全在AWS上迁移主机
Edit 2: Since I could not find a solution I've opted to migrate the hosting entirely on AWS for the moment
推荐答案
发生了完全相同的错误,并进行了2次调整.在S3控制台中,单击要用于备份的文件.您应该看到文件名,后跟4个标签.在常规信息标签中,执行以下操作:
Had the exact same error and made these 2 adjustments. In the S3 console click on the file you want to use for the backup. You should see the name fo your file followed by 4 tabs. In the General information tab, do the following:
-
单击公开使文件可供下载.
获取该对象的网址,该网址显示为对象的网址
Get the URL for that object where it says URL of object
(应该类似于https://mybucket.s3.amazonaws.com/my.file
,您可以通过将该网址粘贴到新的Chrome标签中并点击该网址来测试其是否正常运行.这应该会触发文件的下载)
(should be something like https://mybucket.s3.amazonaws.com/my.file
, you can test if it works by pasting that url in a new Chrome tab and hitting that url. That should trigger the download of your file)
上一次检查成功后,您可以继续
Once the previous check is working you can proceed to
heroku pg:backups restore 'https://mybucket.s3.amazonaws.com/my.file' DATABASE_URL
这篇关于Heroku:从S3导入失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!