Heroku giving 500 error with little information + Internal Server Error
Asked Answered
K
25

Check the logs of your Heroku application to see more details. You can stream the log using the Heroku CLI after logging in:

heroku logs -t

Alternatively, you can view the logs on the app dashboard.

Keese answered 3/9, 2017 at 8:14 Comment(1)
Thanks, after using that now i know if i forgot to adding Environtment Variable to HerokuGullet
R
2

Apparently, I was being displayed the same error but after 3-4 minutes, the web application finally got loaded on heroku. Most probably it's caused due to setting up of webpage on the heroku's server.

Reprobative answered 27/7, 2019 at 22:36 Comment(1)
There are many possible reasons you were seeing these 5XX errors, but most likely in this case you were either getting H81 (Blank app) or H14 (No web dynos running), both of which should result in HTTP 503 responses. The way to know for sure is to check the logs in either the app dashboard or by using e.g. heroku logs -t. A full list of detailed error code descriptions is available in the error codes help article: devcenter.heroku.com/articles/error-codesKeese
S
2

Do you use database ? if yes, don't forget to add database add-ons in resource of your heroku project and create table that you need in database.

Sis answered 31/7, 2020 at 14:44 Comment(2)
Welcome to stack overflow. Consider posting this as a comment instead of an answer. After gaining certain number of reputation points you will be able to post comments to other questions/answer.Neron
Thank you Rahul. Just like you said, i haven't enough reputation points to make a comments.Sis
R
1

I was facing the same issue with this. Locally the app works but when I pushed it to heroku I was getting an internal server error. Then I realized that the path was rather not known.

assume this is the url for the app on heroku, https://myapp.herokuapp.com

this url was the error, because the route did not exit not looked like any of the routes I had. My route start with or my base url was, myapp/

https://myapp.herokuapp.com/myapp/ worked for me.

I was running http://127.0.0.1:5000/myapp/ locally which should be the same as https://myapp.herokuapp.com/myapp/ on heroku

Rombert answered 20/7, 2020 at 2:35 Comment(0)
D
0

Check response redirect in your control and in file name view (html) , uppercase and lowercase characters very influential

Dampproof answered 20/10, 2019 at 14:17 Comment(0)
M
0

I removed the .env file from my .gitignore file while pushing my code to Heroku. It is worked for me.

Manikin answered 17/9, 2021 at 9:38 Comment(0)
B
0

If your application has a database (as it should) make sure to makemigrations and perform migrate. You can do this using Heroku CLI from your Heroku App dashboard.

To make migrations ==> python manage.py makemigrations

To migrate ==> python manage.py migrate

If the above suggestions do not fix the (500) problem, go to your environment variable and change its value to True. Then return to your application to read the error message. Your cue will definitely be there.

Cheers!

Blackfish answered 22/11, 2021 at 23:9 Comment(0)
A
0

I was stuck with the same problem. For me the problem was in my_project/wsgi.py . I had setup 3 settings file under my_project/my_project/settings folder and I had configured the necessary configuration under manage.py to detect the setting file but forgot the configuration under my_project/wsgi.py . So resolving this solved the problem for me.

Approximate answered 7/3, 2022 at 4:41 Comment(0)
G
0

Add the APP_KEY from the terminal as:

heroku config:set APP_KEY=[App_key] -a project-name 

this worked for me.

Gantline answered 17/3, 2022 at 20:39 Comment(0)
C
0

I know I'm late, but in my case it was also just adding the KEY that I was loading locally from .env to the heroku server as an environment variable.

You can simply do it like this:

heroku config:set SECRET_KEY_NAME="YOUR_SECRET_KEY_VALUE"

For example, it could be something like this:

heroku config:set API_KEY="probablysomestringofcharacters"
Center answered 1/9, 2022 at 7:20 Comment(0)
I
-1

I fixed my issue by removing .env file from my gitignore.

Ironbark answered 28/4, 2021 at 11:2 Comment(1)
BE CAREFUL! Any projects' .env SHOULD be in gitignore; you want this for security reasons. Your environment variables (the contents of the .env file) should be protected and separate from your code. SOLUTION: You should manually input the env variables into your config settings in your Heroku dashboard. This is the normal and correct thing to do.Bullish

© 2022 - 2025 — McMap. All rights reserved.