nextcloud / ansible-collection-nextcloud-admin

The ansible galaxy for your nextcloud administrative needs.

Home Page:https://galaxy.ansible.com/nextcloud/admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The current PHP memory limit is below the recommended value of 512MB

MaxiReglisse opened this issue · comments

Nextcloud deployment failed with the following error: The current PHP memory limit is below the recommended value of 512MB

TASK [aalaesar.install_nextcloud : [App] - Install from the official app-store app: "files_external"] 
fatal: [cloud-archives.inframshe.univ-fcomte.fr]: FAILED! => {"changed": true, "cmd": ["php", "occ", "app:install", "files_external"], 
"delta": "0:00:00.182540", "end": "2023-02-04 09:27:46.896039", "msg": "non-zero return code", "rc": 1, "start": "2023-02-04 09:27:46.713499", 
"stderr": "The current PHP memory limit is below the recommended value of 512MB.", "stderr_lines": 
["The current PHP memory limit is below the recommended value of 512MB."], 
"stdout": "files_external already installed", "stdout_lines": ["files_external already installed"]}

I solved this problem by setting correctly the variable memory_limit=512M in the file /etc/php/8.1/fpm/php.ini

root@cloud-archives:~ # grep -r memory_limit /etc/php/
/etc/php/8.1/cli/php.ini:memory_limit = 256M
/etc/php/8.1/apache2/php.ini.ucf-dist:memory_limit = 128M
/etc/php/8.1/apache2/php.ini:memory_limit=512M
/etc/php/8.1/fpm/pool.d/www.conf:;php_admin_value[memory_limit] = 32M
/etc/php/8.1/fpm/php.ini:memory_limit = 512M

I guess the initial value was set (memory_limit=256M) by the php role of Geerlingguy.

root@nfs1-server:/usr/local/ansible-admin (master) # grep -r "memory_limit =" ../galaxy-roles/
../galaxy-roles/geerlingguy.php/templates/php.ini.j2:memory_limit = {{ php_memory_limit }}

Thank you in advance for your feedback.

Ernest.

Same problem with bugfixing than #204

Hello @MaxiReglisse !
Thank you for your report.
can you tell us more about your installation context ?
Like what was your:

  • http server (I'm supposing nginx)
  • DB server

SO we'll be able to reproduce & test using the same flow of tasks.

I guess the initial value was set (memory_limit=256M) by the php role of Geerlingguy.

Actually geerlingguy's role used is not the one you're refering to but php-versions
It is not installing anything except of the external repository and setting a bunch to facts to be consumed/used by later roles/tasks.
so the configuration is still done in this role.
Hense it could help us troubleshooting if you can provides us your installation context 😃

Thanks for the feedback, @aalaesar!

I use Postgresql and Apache2...
As I had difficulties with the geerlingguy's collection, I preferred to use the geerlingguy's role... both are installed.

Looking at both sides, role and collection, we find memory_limit=256 in both.

root@nfs1-server:/usr/local/ansible-admin (master) # grep -r memory_limit ../ansible_collections/
../ansible_collections/geerlingguy/php_roles/roles/php/templates/php.ini.j2:memory_limit = {{ php_memory_limit }}
../ansible_collections/geerlingguy/php_roles/roles/php/defaults/main.yml:php_memory_limit: "256M"

root@nfs1-server:/usr/local/ansible-admin (master) # grep -r memory_limit ../galaxy-roles/geerlingguy*
../galaxy-roles/geerlingguy.php/templates/php.ini.j2:memory_limit = {{ php_memory_limit }}
../galaxy-roles/geerlingguy.php/defaults/main.yml:php_memory_limit: "256M"

the grep -r memory_limit ../galaxy-roles/geerlingguy.php-versions/ command doesn't bring anything back.

Hello @MaxiReglisse!
php_memory_limit is set defaults within the role here: https://github.com/aalaesar/install_nextcloud/blob/main/defaults/main.yml#L36 and it's overwriting geerlingguy role.
Could you make sure that you don't overwriting it somewhere else?

Hello @aalaesar and @wiktor2200 !
Dear Ansible/Nextcloud contributors, I'm sorry to inform you that I certainly made a wrong manipulation because everything worked very well today on a new VM.
Probably I had to launch a php playbook first to deploy PHP, which was unnecessary because the install_nextcloud role takes care of everything.
Thanks for your help and patience.