mxgross / EasyBackupBundle

Kimai 2 Plugin for easier backups
MIT License
25 stars 6 forks source link

Error bin/console cache:clear #19

Closed markus7777777 closed 4 years ago

markus7777777 commented 4 years ago

I followed the instructions of EasyBackupBundle, but an error occurs after executing the command "cache:clear".

Steps:

cd /var/www/kimai2/var/plugins/ git clone https://github.com/mxgross/EasyBackupBundle.git

cd var/www/kimai2/ bin/console cache:clear

Error Message:

_In FileLoader.php line 208:

Expected to find class "KimaiPlugin\EasyBackupBundle\Controller\EasyBackupController" in file "/var/www/kimai2/var/plugins/E asyBackupBundle/Controller/EasyBackupController.php" while importing services from resource "../../*", but it was not found! Check the namespace prefix used with the resource.

Used software: Kimai version: 1.8; Ubuntu Desktop nginx php 7.2

mxgross commented 4 years ago

Can you please try to update the permissions once again

sudo chown -R :www-data .
sudo chmod -R g+r .
sudo chmod -R g+rw var/
sudo chmod -R g+rw public/avatars/

and then again

cd var/www/kimai2/
bin/console cache:clear

Maybe the user group is not www-data in your case and you have to change it. Often I have to run the commands again to get access to the kimai2 frontend afterwards:

sudo chown -R :www-data .
sudo chmod -R g+r .
sudo chmod -R g+rw var/
sudo chmod -R g+rw public/avatars/

I was on Kimai2 Version 1.6 before and now I updated to 1.9 and it still works. PHP is 7.3.11-1~deb10u1 in my case. But with Apache instead of nginx.

Maybe @kevinpapst has any idea about it?

markus7777777 commented 4 years ago

Hi, I have made some changes since the issue I created. I made an update to kimai 1.9 and php runs on 7.3 like you do.

It now works fine with your description. I don't know if it is because of the permissions after the git clone or because of the php and kimai version. I think it was to adjust the file permissions directly after the git clone.

Thanks for your answer. It's running now :)

yweidmann commented 4 years ago

Hi I encoutered the same problem (see email correspondance).

According to the messages, I checked the ownership of the plugin-directory ./kimai2/var/plugins/EasyBackupBoundle: It is not owned by the group and user www-data.

Could that be the reason?

mxgross commented 4 years ago

Hello Yvo, yes that seems to be the reason. In markus case it helped to follow my steps described in my first comment in this issue here. Afterwards the permissions should be fixed.

yweidmann commented 4 years ago

Mh, we tried again calling bin/console cache:clear with sudo as user. But we got the following error-messages:

PHP Fatal error:  Class 'App\Plugin\AbstractPluginExtension' not found in /home/yweidmann/subdomains/projects/kimai2/var/plugins/EasyBackupBundle/DependencyInjection/EasyBackupExtension.php on line 18

In EasyBackupExtension.php line 18:

  Attempted to load class "AbstractPluginExtension" from namespace "App\Plugin".
  Did you forget a "use" statement for another namespace?

cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

Any ideas?