Images not showing in SuiteCRM

Problem description:

Uploading images to my suitecrm instance does not display the picture. I can see the field and it does show a blank picture. If I click on it shows the picture path but does not display the picture. Also since the file name is changed when one uploads a file when I open the image link it does not display the image.
I can find many forum discussions on this topic and the most obvious problems are file permissions and configuration parameters. I tried all recommendations I could find but I just cannot get the system to display the picture. The same instance on my localhost running XAMP works perfectly well.
Below I some information of my instance and some of the solutions I tied:

Environment
SuiteCRM Version 7.10.4
PHP version 8.0
Ubuntu 22.0
AWS EC2 instance

Configuration:
File ownership set to www-data
File ownership group www-data
Permissions as follows:
sudo chmod -R 755 /va/www/html/
sudo chmod -R 775 cache custom modules themes data upload
sudo chmod 775 config_override.php 2>/dev/null

Configuration checks:
Config.php:

‘upload_dir’ => ‘upload/’,
‘upload_maxsize’ => 30000000,
‘use_common_ml_dir’ => false,
‘use_real_names’ => true,
‘valid_image_ext’ =>
array (
0 => ‘gif’,
1 => ‘png’,
2 => ‘jpg’,
Confirmed the correct configuration in my php.ini file

Network

I checked the firewall and all the ports are configured to allow for the correct inbound and outbound routes.

Logs

No errors found in any of the log files

After spending many hours on this trying to get this right but with no success. I would really appreciate it if somebody can assist me or suggest other changes, I can make to get this sorted. Also if you need me to post screenshots of the problem or some config files let me know.

Your PHP version is not supported by SuiteCRM 7.10.4:

… and you should really upgrade, 7.10.4 is not a good version to stop at.

Thank you for the response. We have upgraded now to 7.12.5 on PHP 8.0 but we still have the same issue. How can we go about fixing this issue? What else can we have a look at?

In the sugar_version.php is shows:

$sugar_version = ‘6.5.25’;
$sugar_db_version = ‘6.5.25’;
$sugar_flavor = ‘CE’;
$sugar_build = ‘344’;

Not sure if there can be an issue

It’s very strange that you don’t have anything in the logs, maybe you’re not looking at the correct log files? This often happens.

I have managed to fix the issue. So the only difference between localhost and AWS server was that localhost ran on php 7.4.29 and AWS was on 8.

So I downgraded on AWS from php8 to php 7.4.29 and it worked 100%.

Just a note to the developers and other users that might struggle, in my specific situation, the compatibility matrix does show that SuiteCRM 7.12.5 is compatible on php 8, there are certain functions such as images that doesn’t display and documents that cant upload, that seems to be working incorrectly on php 8

This can only be fixed if there are specific errors that PHP 8.0 is throwing into php_errors.log

I installed php 8 on my localhost first to see if the images does display or not. Obviously in my case it didn’t. This is the error log I have:

e[0me[90m ~ ~ ~ ~e[0m e[31m#0 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(82): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection()
e[0me[90m ~ ~ ~ ~e[0m e[31m#1 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(99): Elasticsearch\Transport->getConnection()
e[0me[90m ~ ~ ~ ~e[0m e[31m#2 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(297): Elasticsearch\Transport->performRequest(‘POST’, ‘/AOD_IndexEvent…’, Array, ‘{“meta”:{"modif…’, Array)
e[0me[90m ~ ~ ~ ~e[0m e[31m#3 C:\xampp\htdocs\cx\vendor\react\promise\src\FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections{closure}(Array)
e[0me[90m ~ ~ ~ ~e[0m e[31m#4 C:\xampp\htdocs\cx\vendor\ezimuel\ringphp\src\Future\CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
e[0me[90m ~ ~ ~ ~e[0m e[31m#5 C:\xampp\htdocs\cx\vendor\ezimuel\ringphp\src\Core.php(341): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
e[0me[90m ~ ~ ~ ~e[0m e[31m#6 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(345): GuzzleHttp\Ring\Core::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
e[0me[90m ~ ~ ~ ~e[0m e[31m#7 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(241): Elasticsearch\Connections\Connection->Elasticsearch\Connections{closure}(Array, Object(Elasticsearch\Connections\Connection), Object(Elasticsearch\Transport), Array)
e[0me[90m ~ ~ ~ ~e[0m e[31m#8 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(110): Elasticsearch\Connections\Connection->performRequest(‘POST’, ‘/AOD_IndexEvent…’, Array, ‘{“meta”:{"modif…’, Array, Object(Elasticsearch\Transport))
e[0me[90m ~ ~ ~ ~e[0m e[31m#9 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Client.php(1929): Elasticsearch\Transport->performRequest(‘POST’, ‘/AOD_IndexEvent…’, Array, Array, Array)
e[0me[90m ~ ~ ~ ~e[0m e[31m#10 C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Client.php(911): Elasticsearch\Client->performRequest(Object(Elasticsearch\Endpoints\Index))
e[0me[90m ~ ~ ~ ~e[0m e[31m#11 C:\xampp\htdocs\cx\lib\Search\ElasticSearch\ElasticSearchIndexer.php(294): Elasticsearch\Client->index(Array)
e[0me[90m ~ ~ ~ ~e[0m e[31m#12 C:\xampp\htdocs\cx\lib\Search\ElasticSearch\ElasticSearchHooks.php(181): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer->indexBean(Object(AOD_IndexEvent))
e[0me[90m ~ ~ ~ ~e[0m e[31m#13 C:\xampp\htdocs\cx\lib\Search\ElasticSearch\ElasticSearchHooks.php(137): SuiteCRM\Search\ElasticSearch\ElasticSearchHooks->performAction(Object(AOD_IndexEvent))
e[0me[90m ~ ~ ~ ~e[0m e[31m#14 C:\xampp\htdocs\cx\lib\Search\ElasticSearch\ElasticSearchHooks.php(107): SuiteCRM\Search\ElasticSearch\ElasticSearchHooks->reIndex(Object(AOD_IndexEvent))
e[0me[90m ~ ~ ~ ~e[0m e[31m#15 C:\xampp\htdocs\cx\lib\Search\ElasticSearch\ElasticSearchHooks.php(77): SuiteCRM\Search\ElasticSearch\ElasticSearchHooks->reIndexSafe(Object(AOD_IndexEvent))
e[0me[90m ~ ~ ~ ~e[0m e[31m#16 C:\xampp\htdocs\cx\include\utils\LogicHook.php(260): SuiteCRM\Search\ElasticSearch\ElasticSearchHooks->beanSaved(Object(AOD_IndexEvent), ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#17 C:\xampp\htdocs\cx\include\utils\LogicHook.php(201): LogicHook->process_hooks(Array, ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#18 C:\xampp\htdocs\cx\data\SugarBean.php(3174): LogicHook->call_custom_logic(‘AOD_IndexEvent’, ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#19 C:\xampp\htdocs\cx\data\SugarBean.php(2426): SugarBean->call_custom_logic(‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#20 C:\xampp\htdocs\cx\modules\AOD_Index\AOD_Index.php(372): SugarBean->save()
e[0me[90m ~ ~ ~ ~e[0m e[31m#21 C:\xampp\htdocs\cx\modules\AOD_Index\AOD_LogicHooks.php(43): AOD_Index->index(‘BF_Multi_Files’, ‘8be32eae-56b8-a…’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#22 C:\xampp\htdocs\cx\include\utils\LogicHook.php(260): AOD_LogicHooks->saveModuleChanges(Object(BF_Multi_Files), ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#23 C:\xampp\htdocs\cx\include\utils\LogicHook.php(201): LogicHook->process_hooks(Array, ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#24 C:\xampp\htdocs\cx\data\SugarBean.php(3174): LogicHook->call_custom_logic(‘BF_Multi_Files’, ‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#25 C:\xampp\htdocs\cx\data\SugarBean.php(2426): SugarBean->call_custom_logic(‘after_save’, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#26 C:\xampp\htdocs\cx\custom\include\SugarFields\Fields\Collection_files\SugarFieldCollection_files.php(82): SugarBean->save()
e[0me[90m ~ ~ ~ ~e[0m e[31m#27 C:\xampp\htdocs\cx\include\formbase.php(128): SugarFieldCollection_files->save(Object(Lead), Array, ‘collection_file…’, Array, ‘’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#28 C:\xampp\htdocs\cx\modules\Leads\LeadFormBase.php(268): populateFromPost(’’, Object(Lead))
e[0me[90m ~ ~ ~ ~e[0m e[31m#29 C:\xampp\htdocs\cx\modules\Leads\Save.php(47): LeadFormBase->handleSave(’’, true, false)
e[0me[90m ~ ~ ~ ~e[0m e[31m#30 C:\xampp\htdocs\cx\include\MVC\View\SugarView.php(823): include_once(‘C:\xampp\htdocs…’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#31 C:\xampp\htdocs\cx\include\MVC\View\views\view.classic.php(72): SugarView->includeClassicFile(‘modules/Leads/S…’)
e[0me[90m ~ ~ ~ ~e[0m e[31m#32 C:\xampp\htdocs\cx\include\MVC\View\SugarView.php(210): ViewClassic->display()
e[0me[90m ~ ~ ~ ~e[0m e[31m#33 C:\xampp\htdocs\cx\include\MVC\Controller\SugarController.php(432): SugarView->process()
e[0me[90m ~ ~ ~ ~e[0m e[31m#34 C:\xampp\htdocs\cx\include\MVC\Controller\SugarController.php(363): SugarController->processView()
e[0me[90m ~ ~ ~ ~e[0m e[31m#35 C:\xampp\htdocs\cx\include\MVC\SugarApplication.php(101): SugarController->execute()
e[0me[90m ~ ~ ~ ~e[0m e[31m#36 C:\xampp\htdocs\cx\index.php(54): SugarApplication->execute()

I have no idea if this can give you an indication of anything.

Those lines are numbered #0, #1, up to #36

The error message comes in the line before that #0. You should look for the more severe ERROR or FATAL messages, not notices and warnings.

Thanks, there I learned something new, thanks. The lines before that are as follows:

[e[1me[34m@e[0m][12:34:10] e[1me[34mIndexing AOD_IndexEvent()e[0m
[e[1me[31m!e[0m][12:34:13] e[1me[31mFailed to index bean to indexe[0m
[e[1me[31m!e[0m][12:34:13] e[1me[31mElasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in C:\xampp\htdocs\cx\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php:64

Anything before that repeats the line #0 - #36

Sorry, I can’t make much from that. Your pasting some weird codes in there, but that isn’t the main problem. The problem is that the text is not what I’m used to seeing (and what I can make sense of).

This is what a FATAL looks like:

[06-Apr-2018 16:38:23 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/conXXX/crm/download.php:180
Stack trace:
#0 /home/conXXX/crm/include/MVC/Controller/SugarController.php(1014): require_once()
#1 /home/conXXX/crm/include/MVC/Controller/SugarController.php(465): SugarController->handleEntryPoint()
#2 /home/conXXX/crm/include/MVC/Controller/SugarController.php(373): SugarController->process()
#3 /home/conXXX/crm/include/MVC/SugarApplication.php(109): SugarController->execute()
#4 /home/conXXX/crm/index.php(52): SugarApplication->execute()
#5 {main}
thrown in /home/conXXX/crm/download.php on line 180

The first line tells me it’s FATAL, what the error is, and where it happened.
The lines below with the #0 numbering are the call stack, they tell me where that function is getting called from, that is also quite useful to know.

Let me revert back to php 8 and delve deeper into the logs to see if I cant find anything better that might explain where the problem comes from.

I am hoping its not a SuiteCRM issue but would definitely want to help if it appears to be. I’ll respond here soon with any results

1 Like