CamCOPS
CamCOPS – FAQs and known problems
Back to Documentation
www.camcops.org/documentation/faqs_bugs.html

Common problems

“Read timed out” error when uploading

If this happens frequently: Settings → Set privileged mode → Configure server settings → increase the Network timeout (ms) setting.

Known bugs

Logo PNG with transparency crashes PDF generator

Problem: If your institutional logo PNG file contains a transparency layer, it will crash the xhtml2pdf PDF generator (as of 2015-02-05). The error looks like:

 /usr/local/lib/python2.7/dist-packages/xhtml2pdf/xhtml2pdf_reportlab.py in getRGBData...
    426                     self.mode = 'RGB'
    427                 elif mode not in ('L', 'RGB', 'CMYK'):
=>  428                     im = im.convert('RGB')
    429                     self.mode = 'RGB'
    430                 self._data = im.tostring()
im = <PIL.PngImagePlugin.PngImageFile image mode=P size=590x118>, im.convert = <bound method PngImageFile.convert of <PIL.PngImagePlugin.PngImageFile image mode=P size=590x118>>

 /usr/local/lib/python2.7/dist-packages/PIL/Image.py in convert(self=<PIL.PngImagePlugin.PngImageFile image mode=P size=590x118>, mode='RGB', matrix=None, dither=3, palette=0, colors=256)
    808         if delete_trns:
    809             #crash fail if we leave a bytes transparency in an rgb/l mode.
=>  810             del(new.info['transparency'])
    811         if trns is not None:
    812             if new_im.mode == 'P':
global new = <function new>, new.info undefined

<type 'exceptions.UnboundLocalError'>: local variable 'new' referenced before assignment
      args = ("local variable 'new' referenced before assignment",)
      message = "local variable 'new' referenced before assignment"
  

Solution 1: remove the transparency layer. For example:

Solution 2: use a newer version of CamCOPS; from server version 1.40, it uses wkhtmltopdf instead, which is also faster.

Uploading error: Operational error (1118). Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

This is a problem with some TEXT-heavy tables, e.g. psychiatricclerking.

Best thing: change the table format.

  1. Edit the MySQL config file, e.g. /etc/my.cnf. In the [mysqld] section, add the lines:
    innodb_file_per_table
    innodb_file_format = Barracuda
  2. Restart MySQL.
  3. At the MySQL command line:
    ALTER TABLE psychiatricclerking ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;

Another thing to consider for MySQL versions before 5.7.5: making the MySQL log file bigger, e.g. 512 Mb.

  1. At the MySQL console: SET GLOBAL innodb_fast_shutdown=0;
  2. Stop MySQL.
  3. Edit the MySQL config file, e.g. /etc/my.cnf, and in the [mysqld] section, add the line:
    innodb_log_file_size = 512M
  4. Delete the old log files, e.g. /var/lib/mysql/ib_logfile0 and /var/lib/mysql/ib_logfile1.
  5. Restart MySQL

From CamCOPS v1.32, the server autoconverts tables to Barracuda when using the make-tables command, to avoid this problem.

Sources:

Valid HTML 4.01 Transitional
Valid CSS