6
votes

Heroku cannot access my google drive file but it is publicly accessible: https://drive.google.com/uc?export=download&id=0B4cYno3qd3jwSnN5V0JtOVZBb1k

Heroku errors:
1, please check the source URL and ensure it is publicly accessible
2, 'id' is not recognized as an internal or external command, operable program or batch file.

My code:
heroku pg:backups:restore "https://drive.google.com/uc?export=download&id=0B4cYno3qd3jwSnN5V0JtOVZBb1k" DATABASE_URL --app express-tourism

You can take a look at cmd line screenshot here

6
Seems like Google Drive redirects you even when you type direct link so it is bad request for Heroku.Etomanon

6 Answers

5
votes

Got the same issue while using Google drive and then Dropbox. I resolved this by using Dropbox and changing url's 'https' to 'http'.

As per Heroku's docs:

In order for PG Backups to access and import your dump file you will need to upload it somewhere with an HTTP-accessible URL.

Keep in mind the URL should be a downloadable link as in the mentioned question. Hope this helps.

3
votes

https://zapier.com/learn/how-to/generate-direct-dropbox-link/

Example https://dl.dropboxusercontent.com/s/49xukdo0vd22pb8/test.file?dl=0

Remove the URL params (e.g. ?dl=0) and it will work!

1
votes

I had no luck with Google Drive either. Dropbox have worked for me

0
votes

Use single quotes around backup url. Heroku docs says:

If you’re using a Unix-like operating system be sure to use single quotes around the temporary S3 URL, because it might contain ampersands and other characters that will confuse your shell. If you’re running Windows, you must use double-quotes.

I guess it applies as well to Google Drive as to S3.

0
votes

You can try saving backup in S3 and it should work as heroku itself is saving backups on AWS S3.

0
votes

Dropbox works like a charm. Just make sure it's publicly accessible