App Version
3.22.3
DB Schema Version
20230918084154
I’m getting the same problem. I installed it to test before and use the community to get confidence, but I’m getting the error below:
Under System / Settings / Crontab Settings you can review the required crontab configurations
I’m putting all the tests that I did and in the end of this thread I fixed. I don’t know why, but for me the solution was the last. Maybe for you can be other.
Investigating the cron container, I saw this log on /var/log/cron.log
:
2024-01-11 01:50:01 error: [Cake\Database\Exception\MissingConnectionException] Connection to Mysql could not be established: SQLSTATE[HY000] [2002] No such file or directory in /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php on line 133
Stack Trace:
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php:164
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php:51
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php:216
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Schema/Collection.php:53
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Connection.php:418
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:520
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Query.php:290
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Query.php:184
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:1714
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:1269
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Model/Table/QueueProcessesTable.php:116
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/ValidationRule.php:145
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/Validator.php:2722
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/Validator.php:275
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Marshaller.php:275
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Marshaller.php:191
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:2787
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Model/Table/QueueProcessesTable.php:147
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Queue/Processor.php:330
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Queue/Processor.php:105
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Command/RunCommand.php:110
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/BaseCommand.php:189
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:334
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:172
- /var/www/eramba/app/upgrade/bin/cake.php:12
Caused by: [PDOException] SQLSTATE[HY000] [2002] No such file or directory in /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php on line 121
Stack Trace:
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php:121
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php:70
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php:131
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php:164
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php:51
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php:216
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Schema/Collection.php:53
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Connection.php:418
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:520
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Query.php:290
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Query.php:184
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:1714
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:1269
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Model/Table/QueueProcessesTable.php:116
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/ValidationRule.php:145
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/Validator.php:2722
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Validation/Validator.php:275
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Marshaller.php:275
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Marshaller.php:191
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/ORM/Table.php:2787
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Model/Table/QueueProcessesTable.php:147
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Queue/Processor.php:330
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Queue/Processor.php:105
- /var/www/eramba/app/upgrade/vendor/dereuromark/cakephp-queue/src/Command/RunCommand.php:110
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/BaseCommand.php:189
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:334
- /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:172
- /var/www/eramba/app/upgrade/bin/cake.php:12
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex" />
<title>
Error | Eramba
</title>
<link href="/favicon.png" type="image/x-icon" rel="icon"/><link href="/favicon.png" type="image/x-icon" rel="shortcut icon"/>
<link rel="stylesheet" href="/limitless_theme/css/icons/icomoon/styles.css"/>
<link rel="stylesheet" href="/limitless_theme/css/bootstrap.css"/>
<link rel="stylesheet" href="/limitless_theme/css/core.css"/>
<link rel="stylesheet" href="/limitless_theme/css/components.css?ver=20200327"/>
<link rel="stylesheet" href="/limitless_theme/css/colors.css"/>
<link rel="stylesheet" href="/css/report-blocks-grid.css"/>
<link rel="stylesheet" href="/css/eramba.css?app_v=3.22.3"/>
<!-- Load YoonityJS Framework -->
<script src="/js/YoonityJS/YoonityJS-2.0.2-eramba.js?app_v=3.22.3"></script>
<link href="/css/font/Roboto-font/Roboto-Regular.ttf" rel="stylesheet">
</head>
<body>
<div id="navbar" class="navbar-fixed-wrapper">
<div class="navbar navbar-inverse navbar-fixed">
<div class="navbar-header">
<a id="header-logo" class="navbar-brand" href="/">
<img src="/settings/get-logo/white" alt="Eramba" width="190"/> </a>
</div>
</div>
</div>
<div class="error-container container text-center">
<h2>An Internal Error Has Occurred</h2>
<p class="error">
<strong>Error: </strong>
An Internal Error Has Occurred.</p>
<br>
<div class="error-container-buttons">
<a href="javascript:history.back()" class="btn btn-primary">Go Back</a>
<a href="/" class="btn btn-default">Dashboards</a>
</div>
</div>
</body>
</html>
Reading all this thread and others, I tried all this:
Drop all and reinstall again.
To remove: docker compose -f docker-compose.simple-install.yml down -v
To install: docker compose -f docker-compose.simple-install.yml up -d
Reinstall step-by-step
The sequence was:
- MySQL and Redis (Wait for MySQL to be ready)
- Eramba (wait until migrations end)
- Cron
Check the log file
The cron.log
file are correct:
root@01443236d76b:/var/www/html# ls -lh /var/log/
total 656K
lrwxrwxrwx 1 root root 39 Nov 8 08:14 README -> ../../usr/share/doc/systemd/README.logs
-rw-r--r-- 1 root root 9.2K Nov 8 08:15 alternatives.log
drwxrwxrwt 2 www-data www-data 72 Oct 12 03:40 apache2
drwxr-xr-x 1 root root 60 Nov 8 08:16 apt
-rw-rw---- 1 root utmp 0 Oct 9 00:00 btmp
-rw-r--r-- 1 www-data www-data 383K Jan 11 02:45 cron.log
-rw-r--r-- 1 root root 253K Nov 8 08:16 dpkg.log
drwxr-s--- 1 Debian-exim adm 21 Jan 11 01:50 exim4
-rw-r--r-- 1 root root 0 Oct 9 00:00 faillog
-rw-r--r-- 1 root root 1.5K Nov 8 08:15 fontconfig.log
drwxr-sr-x 2 root systemd-journal 6 Nov 8 08:14 journal
-rw-rw-r-- 1 root utmp 0 Oct 9 00:00 lastlog
drwx------ 2 root root 6 Nov 8 08:14 private
-rw-rw-r-- 1 root utmp 0 Oct 9 00:00 wtmp
Check connection to MySQL
I checked if the cron and eramba containers were connecting to MySQL with passwords in .env file. All the connections worked, my the error in System Health was the same
Change the Public Address
To connect in my Eramba from outside of the server, I have one FQDN that was the same in Settings / Security / Public Address, but different in .env.
I changed PUBLIC_ADDRESS
and HOST
fields to the same FQDN that I’m using but without success.
At this time, I discovered that from the cron container was impossible to connect to the FQDN URL (eramba). This can be caused by iptables running in the host. To solve this, I change the /etc/hosts
in the cron container and put the eramba container IP address.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.20.0.5 01443236d76b
172.20.0.4 FQDN
Check the certificates
Debugging I remember that I’m using a self-signed certificate. To discard this possibility, I installed my own CA and tested using the curl from cron to eramba’s container. Work the curl, but the error keeps occurring.
Finally
After all, I checked the cron commands in the cron container. I ran this one manually:
/bin/sh /var/www/eramba/app/upgrade/bin/cake queue run -v
This command ran in ~10 seconds and the output was:
root@47a8172d8200:/var/www/html# /bin/sh /var/www/eramba/app/upgrade/bin/cake queue run -v
[2024-01-11 03:07:18] Looking for Job ...
Running Job of type "Reports.Report"
2024-01-11 03:07:18 debug: ------
2024-01-11 03:07:18 debug: Report (id:29) initialized with model: `Dashboard.DashboardReports`, type `1`, params `[ 'user' => 'User::1', 'reportId' => (int) 29, 'dashboard' => true, 'preload' => true]`
...
2024-01-11 03:07:18 warning: Required attribute 'download' in element 'a' was not allowed, which means 'a' will not be allowed either
Trace:
HTMLPurifier_HTMLDefinition::setupConfigStuff() /var/www/eramba/app/upgrade/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php, line 352
...
---------------------------------------------------------------
[2024-01-11 03:07:18] Looking for Job ...
Running Job of type "Reports.Report"
2024-01-11 03:07:18 debug: ------
2024-01-11 03:07:18 debug: Report (id:29) initialized with model: `Dashboard.DashboardReports`, type `1`, params `[ 'user' => 'User::1', 'reportId' => (int) 29, 'dashboard' => true, 'preload' => true]`
2024-01-11 03:07:18 debug: Reports\Block\TextBlock (2953) initialized with config: `[ 'size' => '12']`
2024-01-11 03:07:18 debug: Reports\Block\TaskListBlock (2952) initialized with config: `[ 'size' => '4', 'type' => '2']`
2024-01-11 03:07:18 debug: Reports\Block\TaskListBlock (2958) initialized with config: `[ 'size' => '4', 'type' => '1']`
2024-01-11 03:07:18 debug: Reports\Block\TaskListBlock (810) initialized with config: `[ 'size' => '4', 'type' => '3']`
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (2960) initialized with config: `[ 'size' => '12', 'model' => 'Risks', 'chartId' => '16', 'visualisations' => '1']`
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (917) initialized with config: `[ 'size' => '12', 'model' => 'CompliancePackageRegulators', 'chartId' => '4', 'visualisations' => '1']`
2024-01-11 03:07:18 debug: Report (id:29) rendering
2024-01-11 03:07:18 debug: Reports\Block\TextBlock (2953) reading from cache
2024-01-11 03:07:18 debug: Reports\Block\TextBlock (2953) rendering
2024-01-11 03:07:18 debug: Reports\Block\TextBlock (2953) writing to cache
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (2960) reading from cache
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (2960) rendering
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (2960) writing to cache
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (917) reading from cache
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (917) rendering
2024-01-11 03:07:18 debug: Reports\Block\ChartBlock (917) writing to cache
Job Finished.
---------------------------------------------------------------
[2024-01-11 03:07:18] Looking for Job ...
nothing to do, sleeping.
^C
After running this command above, the error in System Health changes:
eramba needs to be able to access files inside its working directory, if this check fails then one or more files and/or directories are not owned by the process that runs apache. The easiest way to correct this is by using the chown command on linux for example “chown www-data:www-data eramba/ -R” in ubuntu. In Centos or Redhat apache typically runs as apache and therefore the command is likely to be different, for example: "chown apache:apache eramba/ -R
Reading the message, I ran the recommendation:
chown www-data:www-data -R /var/www/eramba/
Solved!