mail icon indicating copy to clipboard operation
mail copied to clipboard

Eternally loading mail

Open jospoortvliet opened this issue 3 years ago • 8 comments

Expected behavior

I'd like to read my mail :D

Actual behavior

Loading screen stays forever.

Mail app

cloud.nc.c and nextcloud mail server.

Client configuration

Google Chrome 92.0.4515.107 (Official Build) (64-bit)

Operating system: openSUSE Tumbleweed (everything latest)

Here's the browser log:

mail not behaving cloud.nextcloud.com-1627041946244.log

jospoortvliet avatar Jul 23 '21 12:07 jospoortvliet

Same problem here. Nextcloud Mail just showing "Lade Nachrichten" (loading messages). After a couple of minutes the server log shows

Allowed memory size of 17179869184 bytes exhausted (tried to allocate 1073741832 bytes) at /var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Ids.php#178

That means that Nextcloud Mail eats up all my PHP memory_limit=16G - which is quite a lot. I have about 8.000 mails in my IMAP account. Rainloop would instantly showing up my inbox. However I would rather like to use the official Nextcloud mail app.

  • Nextcloud Mail 1.10.4
  • Nextcloud Server 21.0.4-fpm

ThomasSteinbach avatar Sep 24 '21 09:09 ThomasSteinbach

8k messages should not be a problem. We've tested with accounts up to 300k messages.

Could you check nextcloud.log for a trace? It's strange that building the IDs object is blowing up the memory.

ChristophWurst avatar Sep 24 '21 09:09 ChristophWurst

I have the same Problem: Mails are loading forever (and most of them never show) - but only on android. The logs do not show any errors. Mails are loading (a bit slow, but showing up eventually, when connecting from a windows or linux pc).

This is on NC 22.2.0, debian 11.1, php 7.4, apache2, mariadb 10.5; mailapp-version 1.10.5 (but this problem exists for some time now... maybe since version 1.3 or 1.4)

only thing showing up in the logs is with loglevel 0 are entries like these: Debug mail Account 3 has 0 messages with a new thread IDs

Debug mail Account 3 has 3251 threads

Debug mail Threading 3399 messages took 0s

Debug mail Threading 3399 messages - group by subject took 0s

Debug mail Threading 3399 messages - prune containers took 0s

Debug mail Threading 3399 messages - free ID table took 0s

Debug mail Threading 3399 messages - build root container took 0s

Debug mail Threading 3399 messages - build ID table took 0s

Debug mail Account 3 has 3399 messages for threading

Debug mail Unlocking mailbox 32 from new messages sync

Debug mail Unlocking mailbox 32 from changed messages sync

Debug mail Unlocking mailbox 32 from vanished messages sync

Debug mail partial sync 3:INBOX took 2s

Debug mail partial sync 3:INBOX - persist new messages took 0s

Debug mail partial sync 3:INBOX - get vanished messages via Horde took 0s

Debug mail partial sync 3:INBOX - persist changed messages took 0s

jasond2020 avatar Nov 29 '21 09:11 jasond2020

do you also run out of mem like the previous report?

ChristophWurst avatar Nov 29 '21 09:11 ChristophWurst

I saw a post with the same problem here

https://help.nextcloud.com/t/mail-app-email-loading-slow/109993

hermesalvesbr avatar Mar 09 '22 00:03 hermesalvesbr

a bit late my answer, but the problem is still the same (nc 23.0.2 ...): and no, no running out of memory, no hints in the debug log that give me any hint what is happening. are there some php-related configurations that i am missing?

jasond2020 avatar Mar 09 '22 20:03 jasond2020

I have a similar issue, but I'm not sure if it's the same underlying problem: Mails do not render in the mail app (all I see is an endlessly circling icon). When I click the three-dots-menu -> furtther actions -> show source, I see the full source of the mail body. So fetching the mail from the server works okay. What fails is rendering it inside the mail app. Any idea what causes rendering to fail?

ruedigerkupper avatar Jul 04 '22 10:07 ruedigerkupper

In the log, I see messages like this:

{
  "reqId": "J8PlsPiaIvnd8n37BcNN",
  "level": 3,
  "time": "2022-07-04T10:31:00+00:00",
  "remoteAddr": "10.16.112.227",
  "user": "kup",
  "app": "mail",
  "method": "GET",
  "url": "/apps/mail/api/messages/1175/body",
  "message": "Could not load message",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
  "version": "23.0.6.1",
  "exception": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Could not load message",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php",
        "line": 248,
        "function": "getImapMessage",
        "class": "OCA\\Mail\\Service\\MailManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 217,
        "function": "getBody",
        "class": "OCA\\Mail\\Controller\\MessagesController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 126,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
    "Line": 187,
    "Previous": {
      "Exception": "OCP\\AppFramework\\Db\\DoesNotExistException",
      "Message": "Mail body for this mail(64448) could not be loaded",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 568,
          "function": "loadBodyData",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 441,
          "function": "handleTextMessage",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 387,
          "function": "getPart",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 102,
          "function": "loadMessageBodies",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 261,
          "function": "__construct",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "function": "OCA\\Mail\\IMAP\\{closure}",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 275,
          "function": "array_map"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 71,
          "function": "findByIds",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
          "line": 181,
          "function": "find",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php",
          "line": 248,
          "function": "getImapMessage",
          "class": "OCA\\Mail\\Service\\MailManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 217,
          "function": "getBody",
          "class": "OCA\\Mail\\Controller\\MessagesController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 126,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 157,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 302,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 36,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
      "Line": 613
    },
    "CustomMessage": "Could not load message"
  }
}

ruedigerkupper avatar Jul 04 '22 10:07 ruedigerkupper

Summary of key errors from OP's (@jospoortvliet) report (i.e. what this Issue is about):

/apps/mail/api/messages?mailboxId=2728&limit=20:1 Failed to load resource: the server responded with a status of 409 (Conflict)
/apps/mail/api/messages?mailboxId=2728&filter=is:pi-starred&limit=20:1 Failed to load resource: the server responded with a status of 409 (Conflict)
/apps/mail/api/messages?mailboxId=2728&filter=is:pi-important&limit=20:1 Failed to load resource: the server responded with a status of 409 (Conflict)
/apps/mail/api/messages?mailboxId=2728&filter=is:pi-other&limit=20:1 Failed to load resource: the server responded with a status of 409 (Conflict)
​ [INFO] mail: Mailbox unified (is:pi-other) is locked Object
`ConsoleLogger.js:33 [INFO] mail: Mailbox unified (is:pi-important) is locked {app: "mail", uid: "jos", error: MailboxLockedError
    at p (https://cloud.nextcloud.com/apps/mail/js/mail.js?v=f2012be1-69:68:562)…}
xhr.js:177 GET https://cloud.nextcloud.com/apps/mail/api/messages?mailboxId=2728&limit=20 409 (Conflict)`

@ThomasSteinbach: Your initial outward symptom may be similar, but unclear whether it's a related issue without any provided logs. Unless your logs look similar to the above, your situation is unrelated. If still having the problem, please open an independent Issue please.

@jasond2020 Your situation seems unrelated to this Issue. Please open a dedicated Issue if you're still having this problem.

@ruedigerkupper Thanks for your report, but appears unrelated to this Issue. Can you please open a dedicated Issue if you're still experiencing this?

joshtrichards avatar Jul 03 '23 19:07 joshtrichards