Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App runs locally but returns 500 error on Heroku #466

Closed
rah-ool opened this issue Jun 5, 2018 · 39 comments
Closed

App runs locally but returns 500 error on Heroku #466

rah-ool opened this issue Jun 5, 2018 · 39 comments

Comments

@rah-ool
Copy link

rah-ool commented Jun 5, 2018

There doesn't seem to be any documentation on deploying to Heroku with flask-restplus. I've just deployed an app and am getting the following: Error: INTERNAL SERVER ERROR.

My Procfile is set to web: gunicorn app:app and my app is set as api = Api(app), app.wsgi_app = ProxyFix(app.wsgi_app), and app = Flask(__name__), respectively. Anyone have any suggestions?

@avilaton
Copy link
Contributor

avilaton commented Jun 5, 2018

We will need more of the error log than the last line. Please provide the full content of the error message.

@rah-ool
Copy link
Author

rah-ool commented Jun 5, 2018

  • Code: 500 (undocumented)
  • Details: Error: INTERNAL SERVER ERROR
  • Response body: { "message": "Internal Server Error" }
  • Response headers: connection: keep-alive, content-length: 37, content-type: application/json, date: Tue, 05 Jun 2018 20:32:29 GMT, server: gunicorn/19.8.1, via: 1.1 vegur

@avilaton
Copy link
Contributor

avilaton commented Jun 5, 2018 via email

@rah-ool
Copy link
Author

rah-ool commented Jun 5, 2018

Seems to be an error returning JSON:

2018-06-05T23:42:05.746971+00:00 app[web.1]: [2018-06-05 23:42:05,742] ERROR in app: Exception on /id/val1/val2 [GET]
2018-06-05T23:42:05.746990+00:00 app[web.1]: Traceback (most recent call last):
2018-06-05T23:42:05.746992+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
2018-06-05T23:42:05.746994+00:00 app[web.1]:     rv = self.dispatch_request()
2018-06-05T23:42:05.746995+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
2018-06-05T23:42:05.746997+00:00 app[web.1]:     return self.view_functions[rule.endpoint](**req.view_args)
2018-06-05T23:42:05.746999+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask_restplus/api.py", line 319, in wrapper
2018-06-05T23:42:05.747001+00:00 app[web.1]:     resp = resource(*args, **kwargs)
2018-06-05T23:42:05.747003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/views.py", line 88, in view
2018-06-05T23:42:05.747005+00:00 app[web.1]:     return self.dispatch_request(*args, **kwargs)
2018-06-05T23:42:05.747007+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
2018-06-05T23:42:05.747008+00:00 app[web.1]:     resp = meth(*args, **kwargs)
2018-06-05T23:42:05.747010+00:00 app[web.1]:   File "/app/app.py", line 30, in get
2018-06-05T23:42:05.747012+00:00 app[web.1]:     res = req.json()
2018-06-05T23:42:05.747014+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/requests/models.py", line 892, in json
2018-06-05T23:42:05.747015+00:00 app[web.1]:     return complexjson.loads(self.text, **kwargs)
2018-06-05T23:42:05.747017+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/json/__init__.py", line 354, in loads
2018-06-05T23:42:05.747019+00:00 app[web.1]:     return _default_decoder.decode(s)
2018-06-05T23:42:05.747020+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/json/decoder.py", line 339, in decode
2018-06-05T23:42:05.747022+00:00 app[web.1]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2018-06-05T23:42:05.747024+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/json/decoder.py", line 357, in raw_decode
2018-06-05T23:42:05.747025+00:00 app[web.1]:     raise JSONDecodeError("Expecting value", s, err.value) from None
2018-06-05T23:42:05.747033+00:00 app[web.1]: json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
2018-06-05T23:42:05.748009+00:00 app[web.1]: 38.132.106.132 - - [05/Jun/2018:23:42:05 +0000]

@avilaton
Copy link
Contributor

avilaton commented Jun 6, 2018 via email

@martijnarts
Copy link

Definitely looks like something is wrong with the app or the request. What does the endpoint code look like, and what's the request you're sending?

@rah-ool
Copy link
Author

rah-ool commented Jun 6, 2018

Here's a snippet:

from flask import Flask, request, make_response, Response, jsonify
from flask_restplus import Api, Resource, fields
from bs4 import BeautifulSoup
from datetime import datetime
from urllib.request import urlopen
import os, json, requests, re, ssl

app = Flask(__name__)
api = Api(app)

t = api.model('t',{'pui':fields.String('pui'),
                        'psi':fields.String('psi'),
                        'psi_':fields.String('psi_')})
tks = []

@api.route('/tks')
class T(Resource):
    def get(self):
        return tks

    @api.expect(t)
    def post(self):
        tks.append(api.payload)
        return {'result':'success.'},201

@api.route('/id/<pc>/<pn>')
class Product(Resource):
    def get(self, pc, pn):
        session = requests.Session()
        req = session.get("<placehoder_website.json.json>")
        res = req.json()
        for i in res["n"][pc]:
            n=i["n"]
            if pn in n:
                return {'n':n}
        else:
            return {'error':"pnc."}

@avilaton
Copy link
Contributor

avilaton commented Jun 6, 2018

If you look at the error you are getting in heroku

2018-06-05T23:42:05.747010+00:00 app[web.1]:   File "/app/app.py", line 30, in get
2018-06-05T23:42:05.747012+00:00 app[web.1]:     res = req.json()

the line that is failing is the last in

@api.route('/id/<product_category>/<product_name>')
class Product(Resource):
    def get(self, product_category, product_name):
        session = requests.Session()
        req = session.get("<placeholder/website.json>")
        res = req.json()

this does not have anything to do with flask-restplus. This little snippet will also fail the same way

import requests

session = requests.Session()
req = session.get("<placeholder/website.json>")
res = req.json()

Not sure what you are trying to do with that, but it looks like you are using requests to hit an invalid URL and then req.json() fails.

@rah-ool
Copy link
Author

rah-ool commented Jun 6, 2018

The URL is a placeholder for the one I'm using in the application, but thanks for pointing out the req.json() line. I was able to run some tests locally and fix the issue 👍.

@rah-ool rah-ool closed this as completed Jun 6, 2018
@toxicOxygen
Copy link

I have a similar problem, I am working with django. The app works fine locally but when I upload it on heroku I get the 500 error

2020-03-25T07:18:44.000000+00:00 app[api]: Build started by user [email protected]
2020-03-25T07:20:00.581174+00:00 heroku[web.1]: Restarting
2020-03-25T07:20:00.600219+00:00 heroku[web.1]: State changed from up to starting
2020-03-25T07:20:00.358258+00:00 app[api]: Deploy efb0df25 by user [email protected]
2020-03-25T07:20:00.358258+00:00 app[api]: Release v18 created by user [email protected]
2020-03-25T07:20:01.800989+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-03-25T07:20:01.811106+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [4] [INFO] Handling signal: term
2020-03-25T07:20:01.811171+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-03-25T07:20:01.815665+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-03-25T07:20:02.012303+00:00 app[web.1]: [2020-03-25 07:20:02 +0000] [4] [INFO] Shutting down: Master
2020-03-25T07:20:02.100993+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T07:20:07.543794+00:00 heroku[web.1]: Starting process with command gunicorn src.wsgi
2020-03-25T07:20:10.648339+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-03-25T07:20:10.649113+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Listening at: http://0.0.0.0:41786 (4)
2020-03-25T07:20:10.649277+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Using worker: sync
2020-03-25T07:20:10.653963+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-25T07:20:10.713620+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [11] [INFO] Booting worker with pid: 11
2020-03-25T07:20:11.708533+00:00 heroku[web.1]: State changed from starting to up
2020-03-25T07:20:12.000000+00:00 app[api]: Build succeeded
2020-03-25T07:20:40.678880+00:00 app[web.1]: 10.7.242.21 - - [25/Mar/2020:07:20:40 +0000] "GET / HTTP/1.1" 500 145 "https://dashboard.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
2020-03-25T07:20:40.679111+00:00 heroku[router]: at=info method=GET path="/" host=bookmark-app-kkb.herokuapp.com request_id=5dbf3276-b4e8-494d-aeab-eb5e554202cd fwd="95.2.0.14" dyno=web.1 connect=3ms service=340ms status=500 bytes=380 protocol=https
2020-03-25T07:25:05.885070+00:00 app[web.1]: 10.11.150.203 - - [25/Mar/2020:07:25:05 +0000] "GET / HTTP/1.1" 500 145 "https://dashboard.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
2020-03-25T07:25:05.884999+00:00 heroku[router]: at=info method=GET path="/" host=bookmark-app-kkb.herokuapp.com request_id=927a9e7f-f5b4-462c-a696-54e69255db06 fwd="95.2.0.14" dyno=web.1 connect=1ms service=162ms status=500 bytes=380 protocol=https

@stepaEliz
Copy link

@toxicOxygen The same problem... did you solve it?

@toxicOxygen
Copy link

@Ekzotika no I could not solve the problem

@toxicOxygen
Copy link

I had to host the app on pythonanywhere, (it worked over there)

@joseph9991
Copy link

My logs looks like this:

2020-05-11T19:17:43.214614+00:00 heroku[router]: at=info method=GET path="/bookstore/" host=django-bookstore-ccl.herokuapp.com request_id=f62100a7-efa2-4925-b40a-42886be3f0ed fwd="114.79.179.87" dyno=web.1 connect=1ms service=42ms status=500 bytes=253 protocol=https
2020-05-11T19:17:43.210987+00:00 app[web.1]: 10.63.224.151 - - [12/May/2020:03:17:43 +0800] "GET /bookstore/ HTTP/1.1" 500 27 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
2020-05-11T19:17:49.326835+00:00 heroku[router]: at=info method=GET path="/admib" host=django-bookstore-ccl.herokuapp.com request_id=89fb0a44-b461-4555-b2aa-0ba1c67a5b12 fwd="114.79.179.87" dyno=web.1 connect=1ms service=6ms status=404 bytes=279 protocol=https
2020-05-11T19:17:49.326346+00:00 app[web.1]: 10.63.224.151 - - [12/May/2020:03:17:49 +0800] "GET /admib HTTP/1.1" 404 79 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
2020-05-11T19:17:52.014601+00:00 heroku[router]: at=info method=GET path="/admin/" host=django-bookstore-ccl.herokuapp.com request_id=77699c0e-11cd-47dc-8410-9fe246cf3183 fwd="114.79.179.87" dyno=web.1 connect=1ms service=4ms status=302 bytes=406 protocol=https
2020-05-11T19:17:52.014227+00:00 app[web.1]: 10.63.224.151 - - [12/May/2020:03:17:52 +0800] "GET /admin/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
2020-05-11T19:17:52.288479+00:00 heroku[router]: at=info method=GET path="/admin/" host=django-bookstore-ccl.herokuapp.com request_id=b142f571-b856-4e67-8893-08210b58ea19 fwd="114.79.179.87" dyno=web.1 connect=0ms service=3ms status=302 bytes=406 protocol=https
2020-05-11T19:17:52.287594+00:00 app[web.1]: 10.109.218.102 - - [12/May/2020:03:17:52 +0800] "GET /admin/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
2020-05-11T19:17:52.364785+00:00 app[web.1]: 10.63.224.151 - - [12/May/2020:03:17:52 +0800] "GET /admin/login/?next=/admin/ HTTP/1.1" 500 27 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
2020-05-11T19:17:52.370165+00:00 heroku[router]: at=info method=GET path="/admin/login/?next=/admin/" host=django-bookstore-ccl.herokuapp.com request_id=a5563c52-7269-4e5a-b23b-f98ed0b776dc fwd="114.79.179.87" dyno=web.1 connect=1ms service=63ms status=500 bytes=253 protocol=https

Any idea on what could be the issue?

@ArjixWasTaken
Copy link

i have the same problem too, i use flask-RESTfuly in combination with gunicorn, same settings as the op of the issue had.

@joseph9991
Copy link

i have the same problem too, i use flask-RESTfuly in combination with gunicorn, same settings as the op of the issue had.

I don't know what I did but I made it to work. I started afresh deploy I think.

@thepasterover
Copy link

I have the same problem. I use requests to parse the error and then use r.json() to parse the ouput. it works flawlessly in locally but gives a JSONDECODEDError when you deploy it. I dont know what to do.

@mrjlancaster
Copy link

Has anyone been able to solve the issue? I ran into the same problem.

@tompdriscoll
Copy link

I had this problem using rails and realized I had updated my schema locally but didn't run 'heroku run rails db:migrate'. Not sure what the equivalent is in Flask or Django

@abhayvishnoi
Copy link

that's caused due to bs4 scrapping issue don't know why sites are blocking heroku same code is working final on localhost but heroku is not able to scrap sites and is blocked so sites do not return much data and that's why we keep getting json decode error or if you try to run any query on bs4 coz you are using data which doesn't even exist on heroku . and yes that sucks

@enCodedProgrammer
Copy link

I have the same problem!
I deployed a node js app and whenever I try to view a particular page, it tells me internal server error but the page works fine locally....

@mrjlancaster
Copy link

I figured it out! Thanks for the comments all!

@unknown989
Copy link

I figured it out! Thanks for the comments all!

how

@tammy20-20
Copy link

I am new Heroku. After deployment, I run https://<app_name>.herokuapp.com/ got 500 internal server error. I cannot see any problem in log. Anybody can help me please

@blankmaru
Copy link

Anyone solve this error?

@unknown989
Copy link

unknown989 commented Oct 11, 2020 via email

@SmartManoj
Copy link

I have a similar problem, I am working with django. The app works fine locally but when I upload it on heroku I get the 500 error

2020-03-25T07:18:44.000000+00:00 app[api]: Build started by user [email protected]
2020-03-25T07:20:00.581174+00:00 heroku[web.1]: Restarting
2020-03-25T07:20:00.600219+00:00 heroku[web.1]: State changed from up to starting
2020-03-25T07:20:00.358258+00:00 app[api]: Deploy efb0df25 by user [email protected]
2020-03-25T07:20:00.358258+00:00 app[api]: Release v18 created by user [email protected]
2020-03-25T07:20:01.800989+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-03-25T07:20:01.811106+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [4] [INFO] Handling signal: term
2020-03-25T07:20:01.811171+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-03-25T07:20:01.815665+00:00 app[web.1]: [2020-03-25 07:20:01 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-03-25T07:20:02.012303+00:00 app[web.1]: [2020-03-25 07:20:02 +0000] [4] [INFO] Shutting down: Master
2020-03-25T07:20:02.100993+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T07:20:07.543794+00:00 heroku[web.1]: Starting process with command gunicorn src.wsgi
2020-03-25T07:20:10.648339+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-03-25T07:20:10.649113+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Listening at: http://0.0.0.0:41786 (4)
2020-03-25T07:20:10.649277+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [4] [INFO] Using worker: sync
2020-03-25T07:20:10.653963+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-25T07:20:10.713620+00:00 app[web.1]: [2020-03-25 07:20:10 +0000] [11] [INFO] Booting worker with pid: 11
2020-03-25T07:20:11.708533+00:00 heroku[web.1]: State changed from starting to up
2020-03-25T07:20:12.000000+00:00 app[api]: Build succeeded
2020-03-25T07:20:40.678880+00:00 app[web.1]: 10.7.242.21 - - [25/Mar/2020:07:20:40 +0000] "GET / HTTP/1.1" 500 145 "https://dashboard.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
2020-03-25T07:20:40.679111+00:00 heroku[router]: at=info method=GET path="/" host=bookmark-app-kkb.herokuapp.com request_id=5dbf3276-b4e8-494d-aeab-eb5e554202cd fwd="95.2.0.14" dyno=web.1 connect=3ms service=340ms status=500 bytes=380 protocol=https
2020-03-25T07:25:05.885070+00:00 app[web.1]: 10.11.150.203 - - [25/Mar/2020:07:25:05 +0000] "GET / HTTP/1.1" 500 145 "https://dashboard.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
2020-03-25T07:25:05.884999+00:00 heroku[router]: at=info method=GET path="/" host=bookmark-app-kkb.herokuapp.com request_id=927a9e7f-f5b4-462c-a696-54e69255db06 fwd="95.2.0.14" dyno=web.1 connect=1ms service=162ms status=500 bytes=380 protocol=https

#781

@kallinnas
Copy link

I solved that problem when configured on Heroku app such refs:

I have in resources file with such name application-prod.properties inside:

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
spring.jpa.properties.hibernate.jdbc.lab.non_contextual_creation=true
spring.jpa.hibernate.ddl-auto=create
app.url=

So I set through terminal:
heroku config:set SPRING_PROFILE_ACTIVE=prod
heroku config:set APP_URL=https://name-that-you-gave.heroku.com

@jaykakadiya18
Copy link

2021-06-05T07:00:11.287316+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2021-06-05T07:00:11.287317+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-05T07:00:11.287317+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287318+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287318+00:00 app[web.1]: File "", line 972, in _find_and_load_unlocked
2021-06-05T07:00:11.287318+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2021-06-05T07:00:11.287319+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287319+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287320+00:00 app[web.1]: File "", line 984, in _find_and_load_unlocked
2021-06-05T07:00:11.287320+00:00 app[web.1]: ModuleNotFoundError: No module named 'Home'
2021-06-05T07:00:11.287320+00:00 app[web.1]:
2021-06-05T07:00:11.287321+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-06-05T07:00:11.287321+00:00 app[web.1]:
2021-06-05T07:00:11.287321+00:00 app[web.1]: Traceback (most recent call last):
2021-06-05T07:00:11.287321+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
2021-06-05T07:00:11.287350+00:00 app[web.1]: response = get_response(request)
2021-06-05T07:00:11.287350+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/deprecation.py", line 117, in call
2021-06-05T07:00:11.287351+00:00 app[web.1]: response = response or self.get_response(request)
2021-06-05T07:00:11.287351+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 49, in inner
2021-06-05T07:00:11.287352+00:00 app[web.1]: response = response_for_exception(request, exc)
2021-06-05T07:00:11.287352+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 114, in response_for_exception
2021-06-05T07:00:11.287352+00:00 app[web.1]: response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
2021-06-05T07:00:11.287353+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 152, in handle_uncaught_exception
2021-06-05T07:00:11.287353+00:00 app[web.1]: callback = resolver.resolve_error_handler(500)
2021-06-05T07:00:11.287353+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/resolvers.py", line 611, in resolve_error_handler
2021-06-05T07:00:11.287354+00:00 app[web.1]: callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
2021-06-05T07:00:11.287354+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/functional.py", line 48, in get
2021-06-05T07:00:11.287355+00:00 app[web.1]: res = instance.dict[self.name] = self.func(instance)
2021-06-05T07:00:11.287355+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
2021-06-05T07:00:11.287355+00:00 app[web.1]: return import_module(self.urlconf_name)
2021-06-05T07:00:11.287356+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2021-06-05T07:00:11.287356+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-05T07:00:11.287364+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287365+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287365+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2021-06-05T07:00:11.287365+00:00 app[web.1]: File "", line 680, in _load_unlocked
2021-06-05T07:00:11.287366+00:00 app[web.1]: File "", line 855, in exec_module
2021-06-05T07:00:11.287366+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2021-06-05T07:00:11.287366+00:00 app[web.1]: File "/app/tool/urls.py", line 26, in
2021-06-05T07:00:11.287367+00:00 app[web.1]: path('', include("Home.urls")),
2021-06-05T07:00:11.287367+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/conf.py", line 34, in include
2021-06-05T07:00:11.287367+00:00 app[web.1]: urlconf_module = import_module(urlconf_module)
2021-06-05T07:00:11.287368+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2021-06-05T07:00:11.287368+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-05T07:00:11.287368+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287369+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287369+00:00 app[web.1]: File "", line 972, in _find_and_load_unlocked
2021-06-05T07:00:11.287370+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2021-06-05T07:00:11.287370+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287375+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287375+00:00 app[web.1]: File "", line 984, in _find_and_load_unlocked
2021-06-05T07:00:11.287376+00:00 app[web.1]: ModuleNotFoundError: No module named 'Home'
2021-06-05T07:00:11.287376+00:00 app[web.1]:
2021-06-05T07:00:11.287377+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-06-05T07:00:11.287377+00:00 app[web.1]:
2021-06-05T07:00:11.287377+00:00 app[web.1]: Traceback (most recent call last):
2021-06-05T07:00:11.287390+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 136, in handle
2021-06-05T07:00:11.287391+00:00 app[web.1]: self.handle_request(listener, req, client, addr)
2021-06-05T07:00:11.287391+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 179, in handle_request
2021-06-05T07:00:11.287391+00:00 app[web.1]: respiter = self.wsgi(environ, resp.start_response)
2021-06-05T07:00:11.287392+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/wsgi.py", line 133, in call
2021-06-05T07:00:11.287392+00:00 app[web.1]: response = self.get_response(request)
2021-06-05T07:00:11.287393+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py", line 130, in get_response
2021-06-05T07:00:11.287393+00:00 app[web.1]: response = self._middleware_chain(request)
2021-06-05T07:00:11.287393+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 49, in inner
2021-06-05T07:00:11.287394+00:00 app[web.1]: response = response_for_exception(request, exc)
2021-06-05T07:00:11.287394+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 114, in response_for_exception
2021-06-05T07:00:11.287394+00:00 app[web.1]: response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
2021-06-05T07:00:11.287395+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 152, in handle_uncaught_exception
2021-06-05T07:00:11.287395+00:00 app[web.1]: callback = resolver.resolve_error_handler(500)
2021-06-05T07:00:11.287396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/resolvers.py", line 611, in resolve_error_handler
2021-06-05T07:00:11.287396+00:00 app[web.1]: callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
2021-06-05T07:00:11.287396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/functional.py", line 48, in get
2021-06-05T07:00:11.287397+00:00 app[web.1]: res = instance.dict[self.name] = self.func(instance)
2021-06-05T07:00:11.287397+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
2021-06-05T07:00:11.287397+00:00 app[web.1]: return import_module(self.urlconf_name)
2021-06-05T07:00:11.287398+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2021-06-05T07:00:11.287398+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-05T07:00:11.287398+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287399+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287399+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2021-06-05T07:00:11.287399+00:00 app[web.1]: File "", line 680, in _load_unlocked
2021-06-05T07:00:11.287399+00:00 app[web.1]: File "", line 855, in exec_module
2021-06-05T07:00:11.287400+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2021-06-05T07:00:11.287400+00:00 app[web.1]: File "/app/tool/urls.py", line 26, in
2021-06-05T07:00:11.287401+00:00 app[web.1]: path('', include("Home.urls")),
2021-06-05T07:00:11.287401+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/urls/conf.py", line 34, in include
2021-06-05T07:00:11.287401+00:00 app[web.1]: urlconf_module = import_module(urlconf_module)
2021-06-05T07:00:11.287402+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2021-06-05T07:00:11.287402+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-05T07:00:11.287402+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287403+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287403+00:00 app[web.1]: File "", line 972, in _find_and_load_unlocked
2021-06-05T07:00:11.287403+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2021-06-05T07:00:11.287404+00:00 app[web.1]: File "", line 1030, in _gcd_import
2021-06-05T07:00:11.287404+00:00 app[web.1]: File "", line 1007, in _find_and_load
2021-06-05T07:00:11.287404+00:00 app[web.1]: File "", line 984, in _find_and_load_unlocked
2021-06-05T07:00:11.287405+00:00 app[web.1]: ModuleNotFoundError: No module named 'Home'
2021-06-05T07:00:11.287614+00:00 app[web.1]: 10.43.248.213 - - [05/Jun/2021:07:00:11 +0000] "GET /favicon.ico HTTP/1.1" 500 0 "-" "-"
2021-06-05T07:00:11.291137+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=rehome-pdf-app.herokuapp.com request_id=eb4dc2ed-05ee-4dee-bab3-6bbffaa522a9 fwd="49.34.136.162" dyno=web.1 connect=0ms service=12ms status=500 bytes=244 protocol=https

@mdfahaduddin
Copy link

same problem!!
it's work on localhost but when i deploy in heroku it's show internal server error

@godwynnn
Copy link

I've got same problem on django .. Its running perfectly on local host but returns internal sever error on heroku live server

@godwynnn
Copy link

https://dpaste.org/7VfY

@jerrygeorge360
Copy link

same problem

@jerrygeorge360
Copy link

has anyone solved it?

@JcKay
Copy link

JcKay commented Jun 17, 2022

2022-06-17T20:04:44.514420+00:00 app[web.1]:
2022-06-17T20:04:44.514421+00:00 app[web.1]: [SQL: INSERT INTO user_db (name, username, email, password, api_key, admin) VALUES (%(name)s, %(username)s, %(email)s, %(password)s, %(api_key)s, %(admin)s) RETURNING user_db.id]
2022-06-17T20:04:44.514422+00:00 app[web.1]: [parameters: {'name': 'someone', 'username': 'someone', 'email': '[email protected]', 'password': 'pbkdf2:sha256:260000$MEZSzOlL$164271a41e5392372939ff80d34dc59fe36d03c9d6ec3c437731ca39dfb40eed', 'api_key': 't74a74ba103eaf82c4c7860f6464ce3a', 'admin': True}]
2022-06-17T20:04:44.514422+00:00 app[web.1]: (Background on this error at: https://sqlalche.me/e/14/9h9h)
2022-06-17T20:04:44.515169+00:00 app[web.1]: 10.1.13.155 - - [17/Jun/2022:20:04:44 +0000] "POST /Register HTTP/1.1" 500 265 "https://coffeeshopcollector.herokuapp.com/Register" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"

i don't know how to fix it, please can someone help me?

@sreesankar362
Copy link

same error

@aihsanbozaci
Copy link

Same error at Node.js.. And nobody knows the solution..

@jerrygeorge360
Copy link

Read the log.

@JouziP
Copy link

JouziP commented Mar 20, 2024

Same issue here: when the login is through the social platforms like google, I get 500. I removed the social and still get a HTTP/1.1" 302 error. Everything works perfectly on local. Even tested on Apache server , but fails on Heroku after deployed.

Anyone has more info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests