How do I fix a pgbackups error: backup url is invalid?
Asked Answered
L

5

3

I'm trying to follow the instructions on migrating to Cedar (except I did a major rewrite so this isn't a branch of the previous app but a separate one) and stuck at the db migration step. I installed the pgbackup and heroku postgresql addons but get this result:

j3(master) : heroku pgbackups:restore DATABASE heroku pgbackups:url --app dada-foe-110 --app something-something-4311 32mQkEpWyJdfplOnXhlCnCRsoxYE12-05-25 --app something-something-4311 EXTERNAL_BACKUP <---restore--- b002.dump

! WARNING: Destructive Action ! This command will affect the app: something-something-4311 ! To proceed, type "something-something-4311" or re-run this command with --confirm something-something-4311

[entered app name]

Retrieving... done

! An error occurred and your restore did not finish. ! The backup url is invalid. Use pgbackups:url to generate a new temporary URL.

Lowther answered 25/5, 2012 at 22:18 Comment(0)
L
0

Turns out I needed to update the Heroku gem. Poor error messaging from them, though, that I had to go to a support ticket to understand this since I was only out of date one or two minor versions and you wouldn't expect breaking changes at that level. Oh well.

Lowther answered 7/6, 2012 at 16:15 Comment(0)
D
2

There is a bug with the Heroku gem version 2.26.(0 through 2). We have released a fix. Upgrade to version 2.26.3 or higher

Make sure the output of heroku pgbackups:url --app dada-foe-110 is something like https://s3.amazonaws.com/hkpgbackups/[email protected]/a273.dump?AWSAccessKeyId=AKIAJYEDAEBRU6KYW6QA&Expires=1337985248&Signature=secretsblah

Dredi answered 25/5, 2012 at 22:25 Comment(3)
Thanks but the URL seems a valid S3 address, and I even tried substituting the actual value instead of inserting 'real time' with no better result.Lowther
I'm having the same issue and I'm unsure as to why this is happening. I've attempted using the backticked `heroku pgbackups:url --app name-of-app-restoring-from` in the expression as well as the raw URL, both to no avail. Any ideas Will?Vinificator
Think you meant version 2.26.3 :)Louvenialouver
Z
2

I had a similar problem trying to restore from S3 server. I simply added open/download permission for everyone on that file on S3, otherwise you need to include AWSAccessKeyId as described in Will's answer above.

Zins answered 12/9, 2014 at 15:17 Comment(0)
S
1

Other reasons for the backup URL to be 'invalid' may be permissions or an error typing or copying the URL. For example, I tried the instructions from heroku to backup and restore a DB from one spot to another, and neglected to make the S3 file readable by Heroku, so the restore failed with this same error.

Shied answered 2/6, 2014 at 19:52 Comment(0)
V
0

Download the dump from the S3 URL which is provided and put it somewhere else which is freely accessible (I have an S3 account so I just stuck it up there - if your DB is extra large and you want to transfer directly between S3's if you have one the instructions here https://s3.amazonaws.com/thearthedge_backup/db_backup/b011.dump seem like they do the trick) and then use this new URL in your

heroku pgbackups:restore 'ADD_YOUR_NEW_BACKUP_URL_HERE_WITH_SINGLE_QUOTES' --app your-app-to-restore-to

I had been having the same problem for the past couple of days though relocating the backup away from Heroku has seemed to do the trick

Vinificator answered 29/5, 2012 at 17:33 Comment(0)
L
0

Turns out I needed to update the Heroku gem. Poor error messaging from them, though, that I had to go to a support ticket to understand this since I was only out of date one or two minor versions and you wouldn't expect breaking changes at that level. Oh well.

Lowther answered 7/6, 2012 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.