IOError: encoder zip not available

117 views
Skip to first unread message

pr1m35

unread,
Dec 20, 2015, 11:47:28 PM12/20/15
to privacyidea
I am running Debian Jessie on two hosts, both of which have privacyIDEA installed; works perfectly on host A but I get this error on machine B when I try to enroll a new token "IOError: encoder zip not available"

I have re-installed Pillow by forcibly removing it as such (dpkg -r --force-depends "python-pil:amd64"); followed by a re-install (apt-get install python-pil:amd64) but the results are the same; "encoder zip not available"

Here is an excerpt from my privacyidea.log

  File "/usr/lib/python2.7/dist-packages/privacyidea/api/token.py", line 239, in init
    init_details = tokenobject.get_init_detail(param, user)
  File "/usr/lib/python2.7/dist-packages/privacyidea/lib/log.py", line 125, in log_wrapper
    f_result = func(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/privacyidea/lib/tokens/hotptoken.py", line 160, in get_init_detail
    response_detail = TokenClass.get_init_detail(self, params, user)
  File "/usr/lib/python2.7/dist-packages/privacyidea/lib/tokenclass.py", line 1078, in get_init_detail
    "img": create_img(otpkey, width=200)}
  File "/usr/lib/python2.7/dist-packages/privacyidea/lib/utils.py", line 56, in create_img
    o_data = create_png(data, alt=alt)
  File "/usr/lib/python2.7/dist-packages/privacyidea/lib/utils.py", line 31, in create_png
    img.save(output)
  File "/usr/lib/python2.7/dist-packages/qrcode/image/pil.py", line 32, in save
    self._img.save(stream, kind)
  File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1439, in save
    save_handler(self, fp, filename)
  File "/usr/local/lib/python2.7/dist-packages/PIL/PngImagePlugin.py", line 572, in _save
    ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)])
  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFile.py", line 481, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 401, in _getencoder
    raise IOError("encoder %s not available" % encoder_name)
IOError: encoder zip not available
Enter code here...




Cornelius Kölbel

unread,
Dec 21, 2015, 12:58:05 AM12/21/15
to priva...@googlegroups.com
Hello,

your error message reads:

File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 401, in
_getencoder
raise IOError("encoder %s not available" % encoder_name)


But I guess the PIL debian package you installed is located at

/usr/lib/python2.7/dist-packages/PIL/Image.py (without local)


So I assume you have installed PIL manually without zip support.

Check the files in python-pil. I further assume they are not located
in /usr/local/lib/python but in /usr/lib/python.

I then would remove the
directory /usr/local/lib/python2.7/dist-packages/PIL/.

This should do the trick.

Kind regards
Cornelius
> --
> You received this message because you are subscribed to the Google
> Groups "privacyidea" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to privacyidea...@googlegroups.com.
> To post to this group, send email to priva...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/privacyidea/2821018d-8c0d-4800-ad64-2be173b0b194%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
Cornelius Kölbel
corneliu...@netknights.it
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel


signature.asc

Joel Eames

unread,
Jan 8, 2016, 11:02:31 PM1/8/16
to Cornelius Kölbel, priva...@googlegroups.com
Removing

"/usr/local/lib/python2.7/dist-packages/PIL/"

Resolved this; 100% right!

Thanks!

You received this message because you are subscribed to a topic in the Google Groups "privacyidea" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/privacyidea/b0Qif0oBuWw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to privacyidea...@googlegroups.com.

To post to this group, send email to priva...@googlegroups.com.

Cornelius Kölbel

unread,
Jan 9, 2016, 2:43:54 AM1/9/16
to Joel Eames, priva...@googlegroups.com
Hello Joel,

that's great!

An thanks a lot for the feedback.

Kind regards
Cornelius
signature.asc
Reply all
Reply to author
Forward
0 new messages