espocrm / espocrm-docker

Official Docker Image for EspoCRM
https://hub.docker.com/r/espocrm/espocrm
GNU Affero General Public License v3.0
56 stars 34 forks source link

Can't enable "Use Cache" #12

Closed vp-lab closed 2 years ago

vp-lab commented 2 years ago

Hi,

After updating espocrm from 7.0.4 to 7.0.7, we can't enable "Use Cache" in Settings. Screenshot from 2021-10-21 09-49-59

I don't know if it was enable or disable before (on 7.0.4) but on 6.1.9 it was 100% enable use cache.

What we're using:

I get this error in logs:

[2021-10-20 14:45:56] ERROR: (500) Error while clearing cache; PUT /Settings/1; line: 132, file: /var/www/html/application/Espo/Core/DataManager.php [] []
[2021-10-20 14:46:04] WARNING: E_WARNING: unlink(data/cache/application/cronLastRunTime.php): Permission denied {"code":2,"message":"unlink(data/cache/application/cronLastRunTime.php): Permission denied","file":"/var/www/html/application/E
spo/Core/Utils/File/Manager.php","line":755} []
[2021-10-20 14:46:04] ERROR: (500) Error while clearing cache; PUT /Settings/1; line: 132, file: /var/www/html/application/Espo/Core/DataManager.php [] []
[2021-10-20 14:47:54] WARNING: E_WARNING: unlink(data/cache/application/cronLastRunTime.php): Permission denied {"code":2,"message":"unlink(data/cache/application/cronLastRunTime.php): Permission denied","file":"/var/www/html/application/E
spo/Core/Utils/File/Manager.php","line":755} []
[2021-10-20 14:47:54] ERROR: (500) Error while clearing cache; PUT /Settings/1; line: 132, file: /var/www/html/application/Espo/Core/DataManager.php [] []
[2021-10-20 14:50:14] WARNING: E_WARNING: unlink(data/cache/application/cronLastRunTime.php): Permission denied {"code":2,"message":"unlink(data/cache/application/cronLastRunTime.php): Permission denied","file":"/var/www/html/application/E
spo/Core/Utils/File/Manager.php","line":755} []

I tried to chown data/cache/application/cronLastRunTime.php from root to apache but it'll overwrite again to root.

Thank you.

tmachyshyn commented 2 years ago

It sounds like your EspoCRM files are owner by wrong user. They should be owner by www-data user. Did you changed owner of your mapped directory of EspoCRM?

vp-lab commented 2 years ago

In CentOS/Alma/Rocky, www-data user doesn't exist.

I installed a new espocrm container with fresh configuration on another server with Alma 8.4 and it's something wrong about the production one and the test one.

Here's the production one. [it's working fine but I can't enable Cache] production_crm Only one file it's here compared to the test one where are lots of them.

Here's the test one, fresh install. test_crm

33:tape , it's the ID for user www-data in ubuntu.

tmachyshyn commented 2 years ago

Sorry for the late reply. Try to correct the user and group in the data/config-internal.php under defaultPermissions section. Then set the owner recursively.

Also, please let me know your configuration of cron / daemon to run Scheduled Jobs? Is it something like below:

espocrm-daemon:
    image: espocrm/espocrm
    container_name: espocrm-daemon
    volumes:
      - espocrm:/var/www/html
    restart: always
    entrypoint: docker-daemon.sh