RaspberryPiFoundation / lesson_format

Lesson formatter
17 stars 28 forks source link

Problem Migrating from Cedar 10 to Cedar 14 #178

Closed martinpeck closed 8 years ago

martinpeck commented 8 years ago

The lesson_format build runs on Heroku. It has been running in a Cedar 10 environment and now needs to be upgraded to Cedar 14.

I've tried upgrading to Cedar 14, and I've tried creating a brand new Heroku app using Cedar 14. In both cases Heroku is unable to compile the app. The errors are similar, but I've shown them both here.

When trying to upgrade the exisitng app to Cedar 14 I get this error when pushing to the repository:

Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 658 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: Git submodules detected, installing:
remote: Synchronizing submodule url for 'lib/pandoc_scratchblocks'
remote: Submodule path 'lib/pandoc_scratchblocks': checked out '83ee0f14c8f5a25b4b13aa7f42b706bf7b2bc756'
remote:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching set buildpack git://github.com/andylolz/heroku-buildpack-python-extras.git... done
remote: -----> Python app detected
remote: -----> Creating Build Directory
remote: -----> Restoring Cached Artifacts
remote: -----> No runtime.txt provided; assuming python-2.7.6.
remote: -----> Using Python runtime (python-2.7.6)
remote: ERROR:root:code for hash md5 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type md5
remote: ERROR:root:code for hash sha1 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha1
remote: ERROR:root:code for hash sha224 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha224
remote: ERROR:root:code for hash sha256 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha256
remote: ERROR:root:code for hash sha384 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha384
remote: ERROR:root:code for hash sha512 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha512
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/bin/pip", line 9, in <module>
remote:     load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 353, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2321, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2048, in load
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <module>
remote:     from pip.util import get_installed_distributions, get_prog
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 18, in <module>
remote:     from pip._vendor.distlib import version
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/version.py", line 14, in <module>
remote:     from .compat import string_types
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module>
remote:     from urllib2 import (Request, urlopen, URLError, HTTPError,
remote: ImportError: cannot import name HTTPSHandler
remote: -----> Installing setuptools (2.2)
remote: -----> Installing pip (1.5.4)
remote: -----> Installing dependencies using pip (1.5.4)
remote: ERROR:root:code for hash md5 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type md5
remote: ERROR:root:code for hash sha1 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha1
remote: ERROR:root:code for hash sha224 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha224
remote: ERROR:root:code for hash sha256 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha256
remote: ERROR:root:code for hash sha384 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha384
remote: ERROR:root:code for hash sha512 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha512
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/bin/pip", line 9, in <module>
remote:     load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 353, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2321, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2048, in load
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <module>
remote:     from pip.util import get_installed_distributions, get_prog
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 18, in <module>
remote:     from pip._vendor.distlib import version
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/version.py", line 14, in <module>
remote:     from .compat import string_types
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module>
remote:     from urllib2 import (Request, urlopen, URLError, HTTPError,
remote: ImportError: cannot import name HTTPSHandler
remote:
remote:  !     Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: !   Push rejected to [snip].
remote:
To https://git.heroku.com/[snip].git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/[snip].git'

When pushing to the brand new app I see this error:

Counting objects: 2873, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1272/1272), done.
Writing objects: 100% (2873/2873), 2.59 MiB | 842.00 KiB/s, done.
Total 2873 (delta 1713), reused 2580 (delta 1527)
remote: Git submodules detected, installing:
remote: Submodule 'lib/pandoc_scratchblocks' (https://github.com/CodeClub/pandoc_scratchblocks.git) registered for path 'lib/pandoc_scratchblocks'
remote: Cloning into 'lib/pandoc_scratchblocks'...
remote: Submodule path 'lib/pandoc_scratchblocks': checked out '83ee0f14c8f5a25b4b13aa7f42b706bf7b2bc756'
remote:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching set buildpack git://github.com/andylolz/heroku-buildpack-python-extras.git... done
remote: -----> Python app detected
remote: -----> Creating Build Directory
remote: -----> Restoring Cached Artifacts
remote: -----> No runtime.txt provided; assuming python-2.7.6.
remote: -----> Preparing Python runtime (python-2.7.6)
remote: /tmp/buildpack20151117-158-90jomk/bin/steps/pip: line 10: pip: command not found
remote: -----> Installing setuptools (2.2)
remote: -----> Installing pip (1.5.4)
remote: -----> Installing dependencies using pip (1.5.4)
remote: ERROR:root:code for hash md5 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type md5
remote: ERROR:root:code for hash sha1 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha1
remote: ERROR:root:code for hash sha224 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha224
remote: ERROR:root:code for hash sha256 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha256
remote: ERROR:root:code for hash sha384 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha384
remote: ERROR:root:code for hash sha512 was not found.
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module>
remote:     globals()[__func_name] = __get_hash(__func_name)
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
remote:     raise ValueError('unsupported hash type ' + name)
remote: ValueError: unsupported hash type sha512
remote: Traceback (most recent call last):
remote:   File "/app/.heroku/python/bin/pip", line 9, in <module>
remote:     load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 353, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2321, in load_entry_point
remote:   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2048, in load
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <module>
remote:     from pip.util import get_installed_distributions, get_prog
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 18, in <module>
remote:     from pip._vendor.distlib import version
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/version.py", line 14, in <module>
remote:     from .compat import string_types
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module>
remote:     from urllib2 import (Request, urlopen, URLError, HTTPError,
remote: ImportError: cannot import name HTTPSHandler
remote:
remote:  !     Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: !   Push rejected to [snip].
remote:
To https://git.heroku.com/[snip]
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/[snip].git'

@andylolz any ideas?

martinpeck commented 8 years ago

Does this have anything to do with the custom build pack we're using?

martinpeck commented 8 years ago

This looks similar...

https://github.com/deis/deis/issues/1740

... suggests a mismatch between versions of python in the Cedar stack and the buildpack might cause this.

martinpeck commented 8 years ago

OK. Deploying is fine, but running the build is the next problem. I'm seeing this error when the build runs...

/app/pandoc: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory

If I heroku run bash and then ./pandoc --version I see the same issue.

I suspect this is another mismatch between the version of Pandoc and the new Cedar-14 stack.

Also, we appear to install our pandoc from a rather strange location...

echo '-----> installing pandoc'
curl -Ls http://cl.ly/3f2i2l2L2u2I/pandoc-1.13.1.tar.gz | tar xz

Will continue to investigate.

andylolz commented 8 years ago

Ahh right, yep. I think I compiled that version of pandoc, rather than the build happening inline. It’s not ideal I guess, but it was much simpler to do it that way. That explains the strange location – It’s being served from my cloudapp account.

martinpeck commented 8 years ago

IT'S ALIVE!

andylolz commented 8 years ago

Amazing! Does it work, though?!

I’ve arbitrarily upgraded pandoc from 1.13 to 1.15, which could be the cause of problems I suppose. (And the chances of the ever-temperamental phantomjs working exactly the same on this different stack are not ever so high.)

martinpeck commented 8 years ago

It would appear to have, yes. Thanks!

andylolz commented 8 years ago

Ahh, brilliant :)