Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.3.0 Beta 3: cron.php: Allowed memory size of 134217728 bytes exhausted #2855

Closed
winkler-winsen opened this issue Apr 4, 2020 · 12 comments · Fixed by #2873
Closed

v1.3.0 Beta 3: cron.php: Allowed memory size of 134217728 bytes exhausted #2855

winkler-winsen opened this issue Apr 4, 2020 · 12 comments · Fixed by #2873
Assignees
Milestone

Comments

@winkler-winsen
Copy link

This is my first bog report in github / for nextcloud. Tried the search, but found nothing.

Expected behavior

I use NextCloud 18.0.3 on a hosted webspace (bitpalast.net) with cron support. (https://docs.nextcloud.com/server/18/admin_manual/configuration_server/background_jobs_configuration.html#cron). The month before testing Mail v1.3.0 Beta 2 there were no cron.php errors.
After testing Mail v1.3.0 Beta 2, I received random daily errors from executing cron.php. All errors referring to nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/.
Before testing 1.3.0 I've got no errors from executing cron.php.

After receiving the errors, I tried to play with folloging settings in Plesk:

Actual behavior

All erros till today:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 655360 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 655360 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Fetch/Results.php on line 178

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 369

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vhosts/xxx/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Idna/Horde/Idna.php on line 59

Mail app

Mail app version: 1.3.0 (Beta 3)

Mailserver or service: IMAP from Googlemail and IMAP from hosted webserver on same machine.

Server configuration

Operating system: Linux lech 3.10.0-957.1.3.el7.x86_64/hosted with Plesk

Web server: Apache / nginx (tried Plesk config: 1) FPM by Apache 2) FPM by nginx https://docs.plesk.com/de-DE/onyx/customer-guide/websites-und-domains/hostingeinstellungen/einstellungen-f%C3%BCr-webskripting/phpeinstellungen.70742/) before was FPM by nginx

Database: MariaDB Version 10.3 (or newer)

PHP version: 7.3.16

Nextcloud Version: (see admin page, e.g. 13.0.2)

Client configuration

Browser: N/A

Operating system: N/A

@republicus
Copy link

Is your Settings > Administration > System reporting the correct numbers under PHP?
I had the same issues and needed to adjust my php.ini file to correct similar issues for other actions.

image

This may be useful if the numbers don't appear correct: https://docs.nextcloud.com/server/13.0.0/admin_manual/configuration_files/big_file_upload_configuration.html

@ChristophWurst
Copy link
Member

How do you invoke cron? Web? System cron?

How large are your mailboxes in that account?

@winkler-winsen
Copy link
Author

Hi again...

After manually upgrading to v1.3.0 Beta 3, I set up 128M in Plesk. This is stated as default value. But error is still alive. Mostly I get this error in this file / line:

nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

@republicus :
Set memory_limit to 128M
grafik

grafik

@ChristophWurst :
I invoke cron.php via system cron configured in Plesk as described in https://docs.nextcloud.com/server/18/admin_manual/configuration_server/background_jobs_configuration.html#cron
grafik

Don't know how to determine IMAP mailbox size. Do you have a hint?

@no-response no-response bot removed the needs info label Apr 6, 2020
@ChristophWurst
Copy link
Member

Don't know how to determine IMAP mailbox size.

Open the account with another client and check the number of messages in your inbox and any other mailbox/folder.

@winkler-winsen
Copy link
Author

winkler-winsen commented Apr 6, 2020

Nextcloud Account 1:
IMAP GMail: 1,69 GB
IMAP localhost: 238 MB

Nextcloud Account 2:
IMAP Gmail: 4,37 GB
IMAP localhost: 443 MB

@no-response no-response bot removed the needs info label Apr 6, 2020
@ChristophWurst
Copy link
Member

That doesn't tell me anything.

check the number of messages in your inbox and any other mailbox/folder

@ChristophWurst
Copy link
Member

Could you please take a look at #2873? I think I fixed these issues. You can download a patch from https://patch-diff.githubusercontent.com/raw/nextcloud/mail/pull/2873.patch.

To reset your message cache (to trigger a full resync) you may use

truncate oc_mail_recipients;
truncate oc_mail_messages;
update oc_mail_mailboxes set sync_new_token = null, sync_new_lock = null, sync_changed_token= null, sync_changed_lock = null, sync_vanished_token = null, sync_vanished_lock= null;
update oc_mail_accounts set last_mailbox_sync = 0;

As always, run your backup routine before patching the system or running the DB queries

@winkler-winsen
Copy link
Author

@ChristophWurst : Thanks for trying to fix the issue. If you want me to try this patch. I have to say sorry, but this beyond my knowledge. Don't know how to apply or test this patch. (I'm a Git newbie)

@no-response no-response bot removed the needs info label Apr 7, 2020
@ChristophWurst
Copy link
Member

You don't need git. Just a tool to apply a patch. Your basic linux distro tools should do that and there is tons of guides on this.

You can also just replace the three changed files from my pull request by downloading them from https://github.com/nextcloud/mail/tree/enhancement/initial-sync-low-mem/lib.

@winkler-winsen
Copy link
Author

@ChristophWurst : I applied the patch with git apply. But within the last 24h I got two errors again

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 655360 bytes) in /var/www/vhosts/winkler-winsen.de/cloud.winkler-winsen.de/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php on line 179

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 655360 bytes) in /var/www/vhosts/winkler-winsen.de/cloud.winkler-winsen.de/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Fetch/Results.php on line 178

I enabled logging level 1 Docs » Nextcloud configuration » Logging. Trying to catch more infos.

@ChristophWurst
Copy link
Member

I enabled logging level 1 Docs » Nextcloud configuration » Logging. Trying to catch more infos.

Thanks. Let's hope this helps 🙏 I guess we should at least get a better hint of where it fails.

@ChristophWurst
Copy link
Member

Answering #2855 (comment) would still help a lot. And you may upgrade to the RC1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants