Getting internal server error after deploying the project on Heroku - python

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
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.
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.

Related

Python Setup on NameCheap showing Error 503. Service Unavailable

I am new to NameCheap and I need help deploying a Django application. I just tried installing python on Namecheap's Cpanel using Python 3.7.12 with the desired Application URL, but I get the Error 503. Service Unavailable when I visit the Application URL after creating the python app. From the resources I have seen, I am supposed to get a python signification that the python app works and not an error. Thanks in advance.
python app setup on Namecheap's Cpanel
error page when i visit the application's Url
In my experience, Why does it appear?
The Webserver is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server.
Also among reasons can be:
inodes/disk overusage
irrelevant php.ini/htaccess directives
incorrect PHP version used
lack of memory
Solution:
Switch PHP versions;
Check disk space and inodes usage, etc.;
Check error logs and the latest error messages to find which script, plugin, etc. causes the issue;
ensure the server is up and running.

Cassandra Connection Problem in Heroku deployment

Hi I have deployed a Flask (ML Project) in Heroku cloud and the app is published. But when I try to predict the model, it gave an error of database connection. When I debug I found out that the connection to the cassandra db is not working. Here was my code
self.cloud_config = {'secure_connect_bundle': "cassandraconnection\\secure-connect-test.zip"}
self.auth_provider = PlainTextAuthProvider('XXX','XXX')
self.cluster = Cluster(cloud=self.cloud_config, auth_provider=self.auth_provider)
The secure-connect-test.zip file is located in the project directory itself. But still i am getting the error
No such file or directory: 'cassandraconnection\\secure-connect-test.zip'
Can anyone suggest where I am making the mistake. Or how to solve this issue
It's very likely that where you think the secure bundle should be and where Heroku is looking for it don't match.
We recommend that you always specify the full path to your Astra DB secure connect bundle to avoid confusion. Cheers!

Flask App deploy on GCP has an Internal Server Error

I’ve recently tested and deployed a flask app as the minusthemiddleman website. All of the functions tested and worked in the sandbox by multiple testing methods before deployment to nginx and uwsgi in production. For some reason page 2 of the search function causes a resource problem in app as deployed. I’ve had a chance to monitor the redis directly using $redis-cli monitor and check my pip list to make everything is installed in production correctly.
The specific error is:
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.
Does anybody have ideas as to why this is malfunctioning? Thanks,

Heroku python 'Application Error' ("An error occurred in the application and your page could not be served")

I have a python-based website I'm trying to upload through Heroku (not ideal I know but it's faster than learning JS). the python script is using flask, and when run locally it works fine. i uploaded it to heroku (git, commit etc) but when i try to open the app in the browser (not locally) i get the following message: "An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command"
i checked the logs and i can't find anything wrong.
please help I've been stuck on this for way too long and the heroku support hasn't been much help
Check your logs by using
heroku logs --tail --app your_app_name
and find your errors and then search your error problem in this https://devcenter.heroku.com/articles/error-codes

Wagtail Heroku Hosting Deployment

I am trying to deploy my wagtail app to Heroku but I have run into an issue that I do not understand.
My backend admin works perfectly
https://idealbackend01.herokuapp.com/admin
But my front end says an internal server error
https://idealbackend01.herokuapp.com/
I followed this approach and used whitenoise for static storage.
https://github.com/CodingForEverybody/wagtail-heroku-deployment/blob/master/README.md
Then I got s3 connected following this for media files this works as I was able to upload a file to my s3 bucket.
https://wagtail.io/blog/amazon-s3-for-media-files/
During my Heroku build, I didn't get any errors, and there were no issues in the logs.
Ask I said the backend renders fine and everything works as expected, but nothing on the front end seems to be working.
Is this possibly due to the sites hostname and port? It is currently set at localhost and 80
Then I tried to set it to my default URL https://idealbackend01.herokuapp.com/ but neither solution seems to be fixing the front end issue.
Is there a reason the admin would not be loading but the frontend wouldn't.
Any direction you can provide would be much appreciated.

Categories

Resources