Captcha image not showing up (Ubuntu 20.04)

Hello community,

Since I upgraded to Ubuntu 20.04 Focal, I am having a broken captcha. I had to disable the functionnality.

I’m using imagemagick 6.9 with ghostscript 9.50. Also have gsfonts and ttf-mscorefonts-installer packages installed.

I’ve tried generating the captcha with imagemagick verbose logs enabled, there are no errors at all.

Here are the enabled lines from /etc/ImageMagick-6/policy.xml:

  <policy domain="resource" name="memory" value="256MiB"/>
  <policy domain="resource" name="map" value="512MiB"/>
  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
  <policy domain="resource" name="area" value="128MB"/>
  <policy domain="resource" name="disk" value="1GiB"/>
  <policy domain="delegate" rights="none" pattern="URL" />
  <policy domain="delegate" rights="none" pattern="HTTPS" />
  <policy domain="delegate" rights="none" pattern="HTTP" />
  <policy domain="path" rights="none" pattern="@*"/>

I’ve seen other topics where the same issue was solved by commenting the following line. However it does not exist on my ImageMagick6 xml file.
<policy domain="coder" rights="none" pattern="LABEL" />

Any ideas on this please?

Thank you!


The best is to watch log/production.log for errors while opening the sign up page.

Hi @jhass!

log/production.log is actually showing only one line:

[2021-01-11T06:13:46] INFO  PID-1483681 TID-47399854692720 Rails: Started GET "/simple_captcha?code=2ea31532cccda508415d50a52c52af33979621d3" for xx.xx.xx.xx at 2021-01-11 06:13:46 +0000


Request is also returning an HTTP 200.

The solution is in the first line of the response of the request:

$ curl "" | head -1
ERROR: object '/usr/lib/x86_64-linux-gnu/' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

So you probably have hardcoded the path to libjemalloc somewhere (systemd service file?), but with Ubuntu 20.04 it was upgraded to and is no longer available. So your problem has nothing to do with imagemagick directly.


Thanks for your help! Using curl | head -1 is very handy :slight_smile:

I’m using eye to launch diaspora server currently, and not using LD_PRELOAD in the eye.rb script. Also libjemalloc is not installed.

I’ve tried installing libjemalloc2 and adding the following line to the eye.rb script:
env "LD_PRELOAD" => "/usr/lib/x86_64-linux-gnu/"
and reloading it / restarting diaspora just now, but it looks like that it’s still trying to find

I’m trying to find out where this could be hardcoded.

If you use eye with script/server then it shouldn’t be hardcoded. script/server tries to detect the correct path for libjemalloc: (but if it isn’t installed, then it doesn’t add anything)

I also can highly recommend to install it to improve your memory usage a lot.

1 Like

I ended up just creating a symlink between .so.1 and .so.2 files for now. I’ll update here when I find the root cause.

Thank you !