简体   繁体   中英

Getting internal server error after deploying the project on Heroku

I have deployed NLP project on Heroku server. If I am going to test the webapp by entering the fields, then I get INTERNAL SERVER ERROR:

The server encountered an internal error and was unable to complete your request.
Either the server is overloaded or there is an error in the application.

This app is successfully running on localhost. I don't know what happens after deployment.

Can anyone help?

Here is the screen shot of build [构建描述

Here is the code of app.py file在此处输入图像描述

This is the code of spam_classifier.py在此处输入图像描述

在此处输入图像描述

These are requirements which I put on requirements.txt在此处输入图像描述

It seems like your build got successfully deployed but you are getting the internal server error while you are consuming the API.So you will have to check the application log instead of the build log. To see that, in the heroku dashboard go to more>>logs. For every request that you make, you will be able to see the logs and hence the runtime errors if there are any.

Few other suggestions

  1. You don't need spam_classifier.py in your file system on the deployed environment as you are loading the trained model from the pickle file.
  2. Make sure that you have pushed the pickle files along with the code. I suggest that you use amazon s3 to store and load those kind of files

If you check the Application Logs in heroku you will find this error "Error R14 (Memory quota exceeded)" due to which you are getting the Internal Server Error after deploying the project on Heroku.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM