1

I am trying to deploy django app on bluemix but its giving hash type not found errors while installing dependencies.

Here's my manifest.yml:

 applications:
    - name: twhisper
    memory: 1024M
    command: python manage.py runserver
    buildpack: https://github.com/cloudfoundry/python-buildpack#v1.1.2
    path: .  

Log is as follows:

-------> Buildpack version 1.1.2
-----> Installing runtime (python-2.7.9)
-----> Installing dependencies with pip
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224

ImportError: No module named 'pip._vendor.requests'
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5

Can anyone tell what's the problem? I was able to deploy it before. I think there maybe some problem with buildpack. Thanks in advance...

practicalli-john
  • 1,836
  • 1
  • 12
  • 8
  • [related](http://stackoverflow.com/questions/20399331/error-importing-hashlib-with-python-2-7-but-not-with-2-6#comment30485423_20399331) – jfs Oct 12 '15 at 07:26
  • What does your `requirements.txt` contain? – whitfiea Oct 12 '15 at 09:49
  • Django==1.6.5 pygal==1.5.0 pymongo==2.7.2 twitter==1.14.3 dj-database-url==0.3.0 django-cors-headers==1.0.0 xlwt==1.0.0 requests==2.7.0 – ashutosh bhadke Oct 12 '15 at 11:04
  • Can you try with python-2.7.10 ? (If you haven't done already , create : runtime.txt at root of your app folder, add this line : python-2.7.10) – vmovva Oct 13 '15 at 00:55
  • I added runtime.txt. Still its not started.. Is it happening because of the changes in os(stack). It was working fine before. When I tried to upgrade to the new stack then this error occured. – ashutosh bhadke Oct 13 '15 at 09:29

1 Answers1

2

This issue would be due to the buildpack cache that would be present on your existing app. Bluemix changed the default stack from lucid64 to cflinuxfs2 so the existing buildpack would have been 'compiled' against the old stack. When obtaining this cached buildpack and running on cflinuxfs2 you would see these issues.

Please delete the existing app from Bluemix using the cf delete appname command and then push the app again. You should see output indicating a new app is created and the buildpack is built again rather than being retrieved from the cache.

whitfiea
  • 1,943
  • 10
  • 15
  • @whitefea, I am again facing the same problem with another application with same configuration. I tried deleting and creating application again but no success. Is there any alternative for it? – ashutosh bhadke May 11 '16 at 05:54