0

Trying to import my postgres database into the hobby data cluster on Heroku.

I've followed all the steps in the docs, and after I sign my url and run the restore command, it asks me for confirmation, and then fails, with the message 'Expected success, got 500' or similar.

I've tried changing the number of rows in the database and making a new dump, setting my s3 to public, and trying different variations of the url to my file, with no success.

1 Answer 1

1

Finally fixed it, not sure which solution pushed it over the line, but here's what I did:

  • use the -f flag when performing the dump, it lets you output it to a file and it seems to work better than piping it with '>'
  • double check your credentials, mine were wrong, troubleshoot the permissions on your s3 bucket here
  • made the s3 as public as possible, by following this guide, and going into the individual dump's permissions, and giving write and read access to the 'everyone' group.
  • at this stage, it still didn't work, i was getting an error saying this:

    2020-04-14 17:01:14 +0000 2020/04/14 17:01:14 aborting: could not write to output stream: Expected HTTP Status 200, received: "403 Forbidden"

    2020-04-14 17:01:14 +0000 waiting for restore to complete

    2020-04-14 17:01:14 +0000 pg_restore: error: could not read from input file: end of file 2020-04-14 17:01:14 +0000 pg_restore finished with errors

    2020-04-14 17:01:14 +0000 waiting for download to complete

    2020-04-14 17:01:14 +0000 download finished with errors

    2020-04-14 17:01:14 +0000 please check the source URL and ensure it is publicly accessible

then, i tried the exact same command to import the database, but using the UNSIGNED url, and it worked.

Sign up to request clarification or add additional context in comments.

1 Comment

Oh, man. That -f flag totally fixes it. You're a lifesaver for posting it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.