Skip to content

Common errors and their solution

mgross edited this page Oct 13, 2022 · 11 revisions

Because I have recently received several issues and mails about environment-specific problems in older version (< 1.2), I have recorded some possible solutions on this wiki page.

Failed to touch (create) file easy_backup.log or directory easy_backup

Error Description

The plugin initially tries to create the folder /var/www/kimai2/var/easy_backup/. Although the correct permission appears to be in place, in some cases this goes wrong. The error is then in the general kimai log´says e.g.:

[2022-09-14 14:39:16] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Failed to touch "/var/www/kimai2/var/easy_backup/easybackup.log"." at /var/www/kimai2/vendor/symfony/filesystem/Filesystem.php line 151 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Failed to touch \"/var/www/kimai2/var/easy_backup/easybackup.log\". at /var/www/kimai2/vendor/symfony/filesystem/Filesystem.php:151)"} []

Solution

Just create the folder /var/www/kimai2/var/easy_backup/ by yourself and refresh the status page.

git rev-parse HEAD command fails

Error Description

In the Controller/EasyBackupController.php attempts to execute the command git rev-parse HEAD in two places. Once for the status display and once to write the current Git header into the manifest.json. So that in the event of a recovery, the correct Kimai version can be determined with which the backup was created at the time.

In the UI the error looks like the following image

Solution

Edit the Controller/EasyBackupController.php: Remove the line

$manifest['git'] = str_replace(PHP_EOL, '', exec(self::CMD_GIT_HEAD));

Change the lines

$cmd = self::CMD_GIT_HEAD;
$status[$cmd] = exec($cmd);

to

$cmd = self::CMD_GIT_HEAD;
$status[$cmd] = '';