1 / 6
Oct 2023

Stefan, Ralf, All,

With async services active running by crontab (cronnie) I am getting a e-mail on every run every 5 minutes. In egroupware/api/asyncservices.php there is a reference to a comment that is supposed to suppress this if my reading is correct, e.g.

if (isset($_SERVER['HTTP_HOST']))
{
        header($num === false ? "HTTP/1.1 500 Can NOT obtain semaphore" : "HTTP/1.1 200 ".($num ? "$num job(s) executed" : 'Nothing to execute'));
}
// if the following comment got removed, you will get an email from cron for every check performed (*nix only)
//echo $msg;

if (defined('ASYNC_LOG'))
{
        $f = fopen(ASYNC_LOG,'a+');
        fwrite($f,$msg);
        fclose($f);
}

The comment I presume is the //echo $msg; which is certainly there, so is this supposed to suppress the e-mails? They are quite punctual, e.g.:

...
  N   9 10:40      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
  N  10 10:45      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
  N  11 10:50      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
  N  12 10:55      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
  N  13 11:00      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
  N  14 11:05      (Cron Daemon)                  (2K)   Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/ht
...

The content of the messages are a bit strange, mysqli.so is very much loaded and the database being used is very much setup, but there are a few spurious messages to the contrary,

Date: Tue, 17 Oct 2023 10:40:01 -0500 (CDT)
From: "(Cron Daemon)" <http@3111skyline.com>
To: http@3111skyline.com
Subject: Cron <http@2pi> /usr/bin/php -q -d memory_limit=-1 /srv/http/htdocs/egroupware/api/asyncservices.php
    default

Database error (EGroupware\Api\Db\Exception\Setup): Connection with Necessary php database support for mysql
(mysqli.so) not loaded and can't be loaded, exiting !!!

Maybe you not created a database for EGroupware yet. (999)
File: /api/src/Egw.php, Line: 117
#0 /srv/http/htdocs/egroupware/api/src/Egw.php(69): EGroupware\Api\Egw->setup()
#1 /srv/http/htdocs/egroupware/api/src/loader.php(113): EGroupware\Api\Egw->__construct()
#2 /srv/http/htdocs/egroupware/api/asyncservices.php(73): include('...')
#3 {main}
# Instance=default, User=, Request= , User-agent=
Database error: Connection with Necessary php database support for mysql (mysqli.so) not loaded and can't be
loaded, exiting !!!

Maybe you not created a database for EGroupware yet. (999)
/srv/http/htdocs/egroupware/api/src/Egw.php (117)

Checking with php -i, mysqli.so is loaded and doing what it is supposed to, e.g.

$ php -i
<snip>
mysqli

MysqlI Support => enabled
Client API library version => mysqlnd 8.1.23
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0

Directive => Local Value => Master Value
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /run/mysqld/mysqld.sock => /run/mysqld/mysqld.sock
mysqli.default_user => no value => no value
mysqli.local_infile_directory => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
<snip>

I’m not too concerned about the content of the e-mail being sent, the primary issue is suppressing the regular delivery of the e-mail each time async services runs. If the comment in asyncservices.php isn’t the comment that does it – what to add?

One more reason, against a classic EGroupware installation …

Somehow the mysqli PHP extension is not enabled for CLI (command line interface).

Do your self a favor an move to a docker based installation, best with an Linux OS supported by us, maybe in a VM, if you only have access to a single physical host.

Ralf

I’m working on the docker install. (actually had to start by going though the docker documentation – which I’m still digesting :). I’m eager to get 23.1 up in docker and accessible. I’ve sorted out earlier issues with network ip/port identification and only have to find a way to get my mysql data from the classic install into the docker compose setup. I’ll get there – docker isn’t a man-page type evening look-over… Especially when we are composing on Arch.

Bad part is I’ll have to write a compose file to put 1.8.007 in a container as well so I can keep that around. That should be a learning exercise for my docker education…

As for mysqli not being loaded for CLI, it really is. For example, I just tested with a short script, e…g

<?php
if (!extension_loaded('mysqli'))  {
  dl('mysqli.so');
}
else {
  echo "mysqli.so is loaded for CLI";
}
?>

Running from the command line:

$ php checkmysqlicli.php
mysqli.so is loaded for CLI

So unless there is some other way that EGW needs it loaded, I’m bewildered at how else I could do it. I guess the bottom line is the comment in the asyncservices.php will suppress the e-mail if the classic install thinks mysqli.so is loaded – if not, I’m just getting the error check output each time – I see.

Thanks for your guidance. I’ll prune my docker installs of egroupware and try again, It’s apparent the classic install is well past prime. Projects won’t even let me edit a pricelist without croaking, so I’m eager to make friends with docker.

That one is trivial: trigger a DB backup in EGroupware setup or admin, rsync the files and backup directory to the new machine (or simply use the same path on the host, which is the default) and restore the backup in the docker installation. The same procedure is used when migrating an installation to a new Linux server.

In case the old none-docker installation is not on Debian/Ubuntu, you have to chown recursive the files and backup directories, for PHP running in an Ubuntu based container to access it:

cd /var/lib/egroupware/default
chown -R 33:33 files backup

Ralf

Oh that will be easy. I’m just talking about moving the backup from the 23.1 classic-install to the docker install on the same machine. (UID/GID are the same).

So I can just connect to the docker install and have it pull the backup from the existing /var/lib/egroupware/default/backup/... on the host filesystem? (or should I move the backup under /etc/egroupware-docker/ location?)

Old dog is learning new docker tricks – slowly…

We keep everything in the old place on the host.
No need to move it or change your backup strategy …

Obviously it’s not a good idea to have two active instances running on the same files directory, e.g. deleting a file from filemanager on any instance, will delete it for all instances!

Ralf