$heroku pgbackups:restore DATABASE "http://........heroku2.dump" --app myapp
! Internal server error.
! Run heroku status to check for known platform issues.
$heroku status
=== Heroku Status
Development: No known issues at this time.
Production: No known issues at this time.
$Heroku logs --app tcdemo
No entries specific to any of these commands. myapp.herokuapp.com comes up in the browser.
How can I find out the details of Heroku internal server error?
Related
I've got a problem when I upload my project on Heroku. I've trying changing value of socket.io and MongoUrl, but I get this error:
Error: Missing required flag:
› -a, --app APP app to run command against
This has nothing to do with any of your files. It's an argument that you must provide to the Heroku CLI itself, e.g.
heroku config:set SOME_VARIABLE=some_value -a myapp
where myapp is the name of your Heroku app.
The -a / --app argument is required when heroku can't figure out what app to connect to, either bcause there is no Heroku remote configured or because there is more than one Heroku remote configured.
See also How to avoid the --app option with heroku CLI?
I've seen a couple of SO posts, and despite googleing and the heroku --help, I keep getting the same error
I've been working off of this:
https://devcenter.heroku.com/articles/heroku-postgres-import-export
$ heroku pg:backups:restore 'secure-file-location-url' DATABASE_URL --app heroku-app-name --confirm heroku-app-name
Starting restore of secure-file-location-url to postgresql-flat-47715... done
Use Ctrl-C at any time to stop monitoring progress; the backup will continue restoring.
Use heroku pg:backups to check progress.
Stop a running restore with heroku pg:backups:cancel.
Restoring... !
▸ An error occurred and the backup did not finish.
▸
▸ waiting for restore to complete
▸ pg_restore finished with errors
▸ waiting for download to complete
▸ download finished with errors
▸ please check the source URL and ensure it is publicly accessible
▸
▸ Run heroku pg:backups:info r018 for more details.
$ heroku pg:backups:info r018
› Error: Missing required flag:
› -a, --app APP app to run command against
› See more help with --help
My secure-file-location-url is a public Google Drive link, which I can access in an incognito browser window.
As discussed in the comments, your database dump is being hosted on Google Drive and the link you're providing goes to a viewer with a "download file" button.
Instead, you must provide a direct link to the file. The documentation recommends using Amazon S3.
I ran into this problem as well, how I solved it was by adding run to the Heroku CLI command. Formatted like so:
heroku pg:backups:restore '<signed url>' DATABASE_URL -a <your-application-name>
Literally, put DATABASE_URL in there and it will read it from your environment variables. If you try putting in the postgress address it will fail. Also, the application needs to be the last thing added to this command, order matters here.
I am new to Heroku and I keep getting the above error - everything looks good to go when I deploy in heroku, connect to my github repo etc.. but I keep getting this error.
Its a node/express app and works exactly as I'd like locally but it won't deploy. Any help would be appreciated.
For getting logs of particular heroku app, use:
heroku logs --app=app_name
For example: your app name is 'chatapp'
heroku logs -app=chatapp
just run the command with the --app flag, followed by the app name.
I like how the --app flag is "mandatory" according to the official documentation, but the lone usage example in the official documentation doesn't use the --app flag.
Anyway, it's not really mandatory. It's just implicit, usually. You have to tell Heroku which app you're using, with something like:
$ heroku git:remote -a your_app_name
and then it stops wondering which app to run these commands on.
you did not set git remote to your application, do that first by,
heroku git:remote -a your_app_name
To expand a little further on this (just for the benefit of other new users encountering a similar issue) - below is an example of a command you could enter in macOS Terminal:
heroku logs --tail --app yourexampleservername
If you have deployed yourexampleservername to Heroku, this should then display a log.
I am finding that managing production and staging env's on heroku truly a painful process esp with domains, git etc.
1) I created app called htest.
2) In the htest directory I did the below:
heroku create --app htest-staging --remote staging
heroku create --app htest-production --remote production
heroku domains:add staging.mydomain.com --app htest-staging --remote staging
heroku domains:add production.mydomain.com --app htest-production --remote production
3) I committed the app and started service
git push staging master
heroku ps --app htest-staging --remote staging
3) I add domain to route53 with the cname of htest-staging.herokuapp.com
heroku info --app htest-staging
=== htest-staging
Web URL: http://htest-staging.herokuapp.com/
as expected I get web page not found.
What is even more troubling is that when I go to http://htest-staging.herokuapp.com/ I get this on the page:
Heroku | Welcome to your new app!
Refer to the documentation if you need help deploying.
My python app should have said hello world.
So..how do I resolve?
On heroku, how to get the whole value of DATABASE_URL ?
When I issue a
heroku config --app APP_NAME
I get several config parameters but the DATABASE_URL is not entirely visible
DATABASE_URL => postgres://ruhej...s.com/oeuhenchej
Any idea ?
$ heroku config --app APP_NAME
(The Heroku toolbelt has been updated since the question was asked; the command now shows the entire DATABASE_URL.)
$ heroku pg:credentials:url YOUR_DATABASE_NAME
Gives you all the informations needed (url, port, dbname, user, password):
Connection information for default credential.
Connection info string:
"dbname=xxxxxxxxxxxxxx host=yyyyyyyyyyyyyyyyyyyyyyyyyyy.amazonaws.com port=5432 user=zzzzzzzzzzzzzz password=************* sslmode=require"
Connection URL:
postgres://zzzzzzzzzzzzzz:*************#yyyyyyyyyyyyyyyyyyyyyyyyyyy.amazonaws.com:5432/xxxxxxxxxxxxxx
This may seem really basic but your heroku APP_NAME is app_name.heroku.com. You can find that by logging into heroku.com and looking in your account. In order to get your app config variables you simply type into the console:
heroku config --app APP_NAME
To get the full database URL, use config:get from the Heroku CLI;
heroku config:get DATABASE_URL -a my-app-name
To get PostgreSQL dump file from heroku :-
heroku pg:backups:capture
heroku pg:backups
it shows all the backups
heroku pg:backups:url BackupID