Font error - No avatars with letters

Nextcloud version 13.0.0
Operating system and version CentOs7 Linux 3.10.0-693.17.1.el7.x86_64
Apache or nginx version _Apache 2.4.6
PHP version _7.1.14

The issue you are facing:

Avater is without any letters

Same for existing users and new ones

I found this solution - but it’s still the same

drwxr-xr-x. 2 apache apache 4096 Feb 21 13:57 fonts

drwxr-xr-x. 2 apache apache 4096 Feb 21 13:57 .
drwxr-xr-x. 17 apache apache 4096 Feb 10 21:29 …
-rw-r–r--. 1 apache apache 11560 Feb 10 21:29 LICENSE.txt
-rw-r–r--. 1 apache apache 156148 Feb 21 13:56 OpenSans-Light.ttf
-rw-r–r--. 1 apache apache 62844 Feb 10 21:29 OpenSans-Light.woff
-rw-r–r--. 1 apache apache 217360 Feb 10 21:29 OpenSans-Regular.ttf
-rw-r–r--. 1 apache apache 20544 Feb 10 21:29 OpenSans-Regular.woff
-rw-r–r--. 1 apache apache 156735 Feb 21 13:57 OpenSans-Semibold.ttf
-rw-r–r--. 1 apache apache 69888 Feb 10 21:29 OpenSans-Semibold.woff

selinux is disabled for testing

Is this the first time you’ve seen this error? (Y/N): Yes since update to NC13 - No Problems with NC12

Steps to replicate it:

  1. Check avatars
  2. Create new user or rename one

The output of your Nextcloud log in Admin > Logging:

|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#267|2018-02-22T09:24:58+0100|
|---|---|---|---|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#261|2018-02-22T09:24:58+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#267|2018-02-22T09:24:01+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#261|2018-02-22T09:24:01+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#267|2018-02-22T09:23:54+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#261|2018-02-22T09:23:54+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#267|2018-02-22T09:23:53+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#261|2018-02-22T09:23:53+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-22T09:12:52+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-22T09:12:52+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-21T14:16:31+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-21T14:16:31+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-21T14:16:31+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-21T14:16:31+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-21T14:16:21+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-21T14:16:21+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-21T14:15:42+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-21T14:15:42+0100|
|Error|PHP|imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#266|2018-02-21T14:15:33+0100|
|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-21T14:15:33+0100|

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!): /lib/private/Avatar.php

                $im = imagecreatetruecolor($size, $size);
                $background = imagecolorallocate($im, $backgroundColor[0], $backgroundColor[1], $backgroundColor[2]);
                $white = imagecolorallocate($im, 255, 255, 255);
                imagefilledrectangle($im, 0, 0, $size, $size, $background);

        #       $font = __DIR__ . '/../../core/fonts/OpenSans-Semibold.woff';
                $font = __DIR__ . '/../../core/fonts/OpenSans-Semibold.ttf';

                $fontSize = $size * 0.4;
                $box = imagettfbbox($fontSize, 0, $font, $text);


I found something… but it’s strange

my data folder is on a different location /mnt/clouddata

there is the avatar folder

/mnt/clouddata/data/appdata_ocplu6p7jg8r/avatar/admin

for testing I changed the permission for apache

drwxrwxrwx. 2 apache apache 4096 Feb 28 18:03 .
drwxrwxr-x. 14 apache apache 4096 Feb 21 14:05 …
-rwxrwxrwx 1 apache apache 5358 Feb 28 18:03 avatar.png
-rwxrwxrwx 1 apache apache 0 Feb 28 18:03 generated

then I tried to change the avatar - the Letter inside the Circle was shown for 1 second -.- and the permission is gone

drwxrwxrwx. 2 apache apache 4096 Feb 28 18:17 .
drwxrwxr-x. 14 apache apache 4096 Feb 21 14:05 …
-rw-r–r-- 1 apache apache 5358 Feb 28 18:17 avatar.png
-rw-r–r-- 1 apache apache 0 Feb 28 18:17 generated


I also moved the appdata_ocplu6p7jg8r/ folder to another location. After this i was able to change the Avatars, but I got a new error – folder not found …

It’s really annoying :frowning: