yourcelf / btb

Codebase that powers Between the Bars, a blogging platform for people in prison. Splitting/parsing/publishing PDFs, managing paper correspondence.
http://betweenthebars.org
GNU Affero General Public License v3.0
13 stars 6 forks source link

Exception Value: Combining pdfs failed on pdftk - one empty file #11

Closed arthurlutz closed 12 years ago

arthurlutz commented 12 years ago

I believe the problem is that 000001.pdf is an empty file is why it fails.

Do you hang out on IRC or on a jabber/xmpp group where we could more easily interact on these small bugs ? Keeping track of these could be useful to others but it might be easier to chat about these issues.

Environment:

Request Method: GET Request URL: http://localhost:8000/correspondence/letter/14

Django Version: 1.4 Python Version: 2.7.3 Installed Applications: ('about', 'accounts', 'annotations', 'blogs', 'btb', 'comments', 'correspondence', 'moderation', 'profiles', 'subscriptions', 'scanning', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.humanize', 'django.contrib.admin', 'django.contrib.flatpages', 'django.contrib.messages', 'django.contrib.staticfiles', 'registration', 'djcelery', 'django_bcrypt', 'lettuce.django', 'compressor', 'sorl.thumbnail', 'notification', 'pagination', 'urlcrypt', 'south') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'pagination.middleware.PaginationMiddleware')

Traceback: File "/home/arthur/local/btb/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/home/arthur/local/btb/venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  2. return view_func(request, _args, *_kwargs) File "/home/arthur/local/btb/btb/scanblog/correspondence/views.py" in show_letter
  3. filename = tasks.generate_letter_task.delay(letter_id=letter_id).get() File "/home/arthur/local/btb/venv/local/lib/python2.7/site-packages/celery/result.py" in get
  4. interval=interval) File "/home/arthur/local/btb/venv/local/lib/python2.7/site-packages/celery/backends/base.py" in wait_for
  5. raise result

Exception Type: Exception at /correspondence/letter/14 Exception Value: Combining pdfs failed: /usr/bin/pdftk /tmp/combinepdfsztyMXF/000000.pdf /tmp/combinepdfsztyMXF/000001.pdf cat output /tmp/tmpo1d68t.pdf

yourcelf commented 12 years ago

Sure: let's do #civicmedia on freenode. I'm there now.

yourcelf commented 12 years ago

What is the type of letter you were generating? Is it a consent form, comments printout, or first post printout?

If it's comments or a first post, I suspect possible issues with wkhtmltopdf. If it's a consent form, I suspect the path to the license agreement pdf might not be set in admin.

yourcelf commented 12 years ago

We determined that the ultimate source of this problem was that the django Site model had its domain set to example.com (the default), which resulted in wkhtmltopdf being unable to print the posts. Documentation is added now: http://dev-docs.betweenthebars.org/en/latest/installation.html#set-the-site-name-in-admin