mail icon indicating copy to clipboard operation
mail copied to clipboard

Cron mail sync failed: `getUid()` on null

Open solracsf opened this issue 7 months ago • 2 comments

Steps to reproduce

  1. Wait for cron to run

Expected behavior

No error

Actual behavior

Error

Mail app version

5.1.2

Nextcloud version

30.0.11

Mailserver or service

No response

Operating system

No response

PHP engine version

PHP 8.3

Nextcloud memory caching

Redis

Web server

Apache (supported)

Database

MariaDB

Additional info

{
  "reqId": "WVuQI7DCyaWsM8VSqVPH",
  "level": 3,
  "time": "2025-06-05T06:54:04+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "mail",
  "method": "",
  "url": "--",
  "message": "Cron mail sync failed for account 35",
  "userAgent": "--",
  "version": "30.0.11.1",
  "exception": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Sync failed for 35:INBOX: Call to a member function getUid() on null",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 133,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php",
        "line": 93,
        "function": "syncAccount",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 61,
        "function": "run",
        "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 88,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 75,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 162,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
    "Line": 282,
    "Previous": {
      "Exception": "Error",
      "Message": "Call to a member function getUid() on null",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
          "line": 1236,
          "function": "_sendCmd",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
          "line": 1066,
          "function": "_openMailbox",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
          "line": 1694,
          "function": "openMailbox",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
          "line": 802,
          "function": "status",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 479,
          "function": "isPermflagsEnabled",
          "class": "OCA\\Mail\\Service\\MailManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 263,
          "function": "runPartialSync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 133,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php",
          "line": 93,
          "function": "syncAccount",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
          "line": 61,
          "function": "run",
          "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
          "line": 88,
          "function": "start",
          "class": "OCP\\BackgroundJob\\Job",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
          "line": 75,
          "function": "start",
          "class": "OCP\\BackgroundJob\\TimedJob",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/cron.php",
          "line": 162,
          "function": "execute",
          "class": "OCP\\BackgroundJob\\TimedJob",
          "type": "->"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
      "Line": 4248
    },
    "message": "Cron mail sync failed for account {accountId}",
    "exception": [],
    "CustomMessage": "Cron mail sync failed for account 35"
  },
  "id": "6841435c6d602"
}

solracsf avatar Jun 05 '25 07:06 solracsf

"File": "/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php", "Line": 4248

https://github.com/bytestream/Imap_Client/blob/33dc825bb4fb0a3fc6c892625404807aee7cd861/lib/Horde/Imap/Client/Socket.php#L4245-L4255

ChristophWurst avatar Jun 10 '25 12:06 ChristophWurst

Thanks for the report @solracsf

ChristophWurst avatar Jun 10 '25 12:06 ChristophWurst