All graph images are broken

I installed docker image ( on my Synology DS920+.
I found that Web UI cannot show all the graph images.

Please refer to attached image.

librenms-librenms1:/opt/librenms$ ./validate.php

Component Version
LibreNMS 1.65.1
DB Schema 2020_06_23_00522_alter_availability_perc_column (170)
PHP 7.3.19
Python 3.8.3
MySQL 10.5.4-MariaDB-1:10.5.4+maria~focal
RRDTool 1.7.2


[OK] Installed from package; no Composer required

[OK] Database connection successful
[OK] Database schema correct
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Non-git install, updates are manual or from package

When I try to access the image directly, I have the attached error.

if ($output === ‘base64’) {
$imagedata = file_get_contents($graphfile);
$base64_output = base64_encode($imagedata);
} else {
$fd = fopen($graphfile, ‘r’);

I don’t understand why there is a extra line at the beginning of the svg+xml file.
So I modified the includes/html/graphs/ and added ob_end_clean(); before reading the file generated by RRDTool.

Ok I have solved this issue.
It is because of I created custom.php which is used for custom configuration in a editor in Windows OS and copy it to the /data folder. The php file has unneccessary characters when viewed using vi in the docker bash. Once I removed these characters, the image show correctly, however I am facing other issues in the image attached. Sometimes the image does not generate properly.