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

E-mails show up with question mark and no subject and database entries for them are empty #6938

Closed
plantroon opened this issue Jul 27, 2022 · 18 comments · Fixed by #6948
Closed
Assignees

Comments

@plantroon
Copy link

plantroon commented Jul 27, 2022

Steps to reproduce

  1. Add a big account with 500 of e-mails in Inbox at least, ideally hosted on Mailcow or any Dovecot-based service
  2. Wait for it to sync
  3. Watch performance metrics on client where Nextcloud webUI is running

Expected behavior

E-mail subject+recipient should be displayed as well as the e-mail when clicking on it.

Actual behavior

Question marks are displayed instead of recipient and no subjects instead of e-mail subjects. E-mail body is empty when clicking on it. Checking the database entries in Nextcloud mail they are empty as well.

KGF

Here are the logs from when viewing an e-mail with no subject and ? as sender:

------------------------------
>> Sat, 23 Jul 2022 20:17:08 +0000
>> Connection to: imap://mailcow.plantroon.com:993/
>> Server connection took 0.0124 seconds.
S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
C: 1 AUTHENTICATE PLAIN [INITIAL CLIENT RESPONSE (username: [email protected])]
S: 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk] Logged in
>> Command 1 took 0.0836 seconds.
>> CACHE: Using the OCA\Mail\Cache\Cache storage driver.
C: 2 ENABLE QRESYNC
C: 3 EXAMINE INBOX (QRESYNC (1628609455 69311 479:480,483,485:486,488,492:495,498:499,510,512:517,519:520,523,526:527,532,534:542,545,547,549,551,555,557,560:567,569:570,573:574,583:585,589:593,597:598,601:603,605:606,608,610,612,615:617,624:625,632:634,639,642:645,652,662,670:672,686,688,705:707,709:710,722:723,726,730:731,735,741,743:749,751,754:764,766,2922:2923,2926:2936,2941,3536,3919,4142,4232,4244,4431,4671,5722,6366,6768,6770,6789,6844,6892,7044,7047:7049,8392,9169,9374,9981,10076,10562,11932,12063,12640,12865,13170,13499:13501,14316,14833,15642,16936,17046,17543,18382,18920,20523,22905,23859,24744:24745,24803,24813,24815:24824))
S: * ENABLED QRESYNC
S: 2 OK Enabled (0.001 + 0.000 secs).
>> Command 2 took 0.0006 seconds.
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded NonJunk)
S: * OK [PERMANENTFLAGS ()] Read-only mailbox.
S: * 193 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 184] First unseen.
S: * OK [UIDVALIDITY 1628609455] UIDs valid
S: * OK [UIDNEXT 24825] Predicted next UID
S: * OK [HIGHESTMODSEQ 69311] Highest
S: 3 OK [READ-ONLY] Examine completed (0.001 + 0.000 secs).
>> Command 3 took 0.0015 seconds.
C: 4 UID FETCH 23774 (ENVELOPE FLAGS INTERNALDATE BODY.PEEK[HEADER])
S: 4 OK Fetch completed (0.001 + 0.000 secs).
>> Command 4 took 0.0006 seconds.

==> data/nextcloud.log <==
{"reqId":"emALmoOJE5nduuY1spST","level":0,"time":"2022-07-23T20:17:09+00:00","remoteAddr":"172.31.0.1","user":"plantroon","app":"mail","method":"GET","url":"/apps/mail/api/messages/23296/body","message":"findByIds in INBOX got 1 UIDs (23774) and found 1. minFetched=23774 maxFetched=23774","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62","version":"24.0.3.2","data":{"app":"mail"}}

==> data/horde_imap.log <==
C: 5 UID FETCH 23774 (ENVELOPE BODYSTRUCTURE FLAGS RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER])
S: 5 OK Fetch completed (0.001 + 0.000 secs).
>> Command 5 took 0.0008 seconds.
C: 6 LOGOUT
S: * BYE Logging out
S: 6 OK Logout completed (0.001 + 0.000 secs).
>> Command 6 took 0.0025 seconds.
------------------------------
>> Sat, 23 Jul 2022 20:17:11 +0000
>> Connection to: imap://mailcow.plantroon.com:993/
>> Server connection took 0.0133 seconds.
S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
C: 1 AUTHENTICATE PLAIN [INITIAL CLIENT RESPONSE (username: [email protected])]
S: 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk] Logged in
>> Command 1 took 0.0848 seconds.
>> CACHE: Using the OCA\Mail\Cache\Cache storage driver.
C: 2 ENABLE QRESYNC
C: 3 SELECT INBOX (QRESYNC (1628609455 69311 479:480,483,485:486,488,492:495,498:499,510,512:517,519:520,523,526:527,532,534:542,545,547,549,551,555,557,560:567,569:570,573:574,583:585,589:593,597:598,601:603,605:606,608,610,612,615:617,624:625,632:634,639,642:645,652,662,670:672,686,688,705:707,709:710,722:723,726,730:731,735,741,743:749,751,754:764,766,2922:2923,2926:2936,2941,3536,3919,4142,4232,4244,4431,4671,5722,6366,6768,6770,6789,6844,6892,7044,7047:7049,8392,9169,9374,9981,10076,10562,11932,12063,12640,12865,13170,13499:13501,14316,14833,15642,16936,17046,17543,18382,18920,20523,22905,23859,24744:24745,24803,24813,24815:24824))
S: * ENABLED QRESYNC
S: 2 OK Enabled (0.001 + 0.000 secs).
>> Command 2 took 0.0007 seconds.
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded NonJunk)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded NonJunk \*)] Flags permitted.
S: * 193 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 184] First unseen.
S: * OK [UIDVALIDITY 1628609455] UIDs valid
S: * OK [UIDNEXT 24825] Predicted next UID
S: * OK [HIGHESTMODSEQ 69311] Highest
S: 3 OK [READ-WRITE] Select completed (0.001 + 0.000 secs).
>> Command 3 took 0.0018 seconds.
C: 4 UID STORE 23774 +FLAGS \seen
S: 4 OK Store completed (0.001 + 0.000 secs).
>> Command 4 took 0.0006 seconds.
C: 5 LOGOUT
S: * BYE Logging out
S: 5 OK Logout completed (0.001 + 0.000 secs).
>> Command 5 took 0.0007 seconds.

In the database the subjects are empty and in this write-out as well:

plantroon@liberty:/srv/vapps/nextcloud$ /usr/bin/docker exec -t -u www-data nextcloud-app-1 php -f occ mail:account:export-threads 1 | grep subj | tail -n30
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "",
        "subject": "Intel GuC Firmware Fix Submitted For Linux 5.19",
        "subject": "",
        "subject": "Keanu Reeves dropped by Comic-Con to reveal John Wick 4 sneak peek teaser",
        "subject": "Cron <plantroon@liberty> \/usr\/bin\/flock -x -n \/tmp\/rss2email.lock -c \"\/usr\/bin\/r2e run\"",
        "subject": "Security alert",
        "subject": "AMD Sensor Fusion Hub \"SFH1.1\" Support Coming In Linux 5.20 For Newer Laptops",
        "subject": "Seagate s\u013eubuje 30+ TB disk u\u017e o rok",
        "subject": "Problem: High CPU utilization (over 90% for 5m)",
        "subject": "Resolved in 15h 20m 0s: Zabbix agent is not available (for 3m)",
        "subject": "Resolved in 1m 9s: High CPU utilization (over 90% for 5m)",
        "subject": "Problem: Zabbix agent is not available (for 3m)",

All of the e-mails visible there were received AFTER adding the account to Nextcloud. And even out of those, one has the bug. The empty ones were already in the Inbox when adding the account.

Mail app version

1.13.7

Mailserver or service

Self-hosted Mailcow suite (Dovecot IMAP)

Operating system

Docker on Debian

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database

MySQL

Additional info

  • I have utf8mb4 correctly set up per documentation. I use the official docker image but I double-checked anyway. None of the e-mails contained any special characters anyway (emojis or anything similar)
  • during sync, the web browser (Chrome and Edge, without extensions) is locked up for long periods of time on a machine with Core i7 9700k and 64 GB of RAM. I don't know what it's doing.
  • v1.13.1 works .... it does not lock up the browser and it does not try to load the mailbox at once (it loads as I scroll...). If I find any more time, I'll continue testing towards newer versions as I don't know which one broke it. I also needed to drop the tables.
@admorgan
Copy link

admorgan commented Jul 28, 2022

I have the same behavior with my dovecot based e-mail service. Everything was fine until I removed the e-mail account and added it again this morning. Now I get the behavior described above and if I leave the mail app open I get notifications about receiving hundreds of e-mails, but never an update to the missing sender or subject.

I am on Gentoo with nginx and a postgres database. Nextcloud 24.0.2 mail 1.13.7

@devmarxx
Copy link

Exact the same behavior here.

Nextcloud 24.0.2 mail 1.13.7

Regards

Chris

@admorgan
Copy link

Playing some more, mails marked as flagged get full content and properly updated. New e-mails that come in after the initial sync are correct also.

@admorgan
Copy link

Playing even further the account I am having issues with has over 33000 e-mails. On the same server if I connect to a mailbox with only 4 e-mails everything works fine. Another account on the same server has 40 out of 360 incorrect.

@miaulalala
Copy link
Contributor

I can reproduce, taking a look now.

@miaulalala
Copy link
Contributor

COuld you please look at your nextcloud.log and tell me if you can see an error like

"Exception": "OCA\\Mail\\Exception\\ServiceException",
"Message": "Sync failed for 12:INBOX: rewind(): supplied resource is not a valid stream resource",

@kesselb
Copy link
Contributor

kesselb commented Jul 28, 2022

@plantroon @admorgan

Does it work again when you patch Mail like:

Index: lib/IMAP/IMAPClientFactory.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/IMAP/IMAPClientFactory.php b/lib/IMAP/IMAPClientFactory.php
--- a/lib/IMAP/IMAPClientFactory.php	(revision 85b7fcabd5cb73e8acbb70370d5d77e1ffe1918e)
+++ b/lib/IMAP/IMAPClientFactory.php	(date 1659032692479)
@@ -106,9 +106,9 @@
 			 * using QRESYNC/CONDSTORE if they are available
 			 * @see \Horde_Imap_Client_Socket::_loginTasks
 			 */
-			$params['cache'] = [
-				'backend' => new Horde_Imap_Client_Cache_Backend_Null(),
-			];
+//			$params['cache'] = [
+//				'backend' => new Horde_Imap_Client_Cache_Backend_Null(),
+//			];
 		}
 		if ($this->config->getSystemValue('debug', false)) {
 			$params['debug'] = $this->config->getSystemValue('datadirectory') . '/horde_imap.log';

@miaulalala @ChristophWurst

As only runInitialSync is affected use this patch to trigger the error without removing and adding the account again.

To everyone else: Don't use this patch! (It will add every message again and again and again and again).

Index: lib/Controller/MailboxesController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/Controller/MailboxesController.php b/lib/Controller/MailboxesController.php
--- a/lib/Controller/MailboxesController.php	(revision 85b7fcabd5cb73e8acbb70370d5d77e1ffe1918e)
+++ b/lib/Controller/MailboxesController.php	(date 1659030317111)
@@ -156,6 +156,7 @@
 		$mailbox = $this->mailManager->getMailbox($this->currentUserId, $id);
 		$account = $this->accountService->find($this->currentUserId, $mailbox->getAccountId());
 
+		$init = true;
 		try {
 			$syncResponse = $this->syncService->syncMailbox(
 				$account,
Index: lib/Service/Sync/ImapToDbSynchronizer.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/Service/Sync/ImapToDbSynchronizer.php b/lib/Service/Sync/ImapToDbSynchronizer.php
--- a/lib/Service/Sync/ImapToDbSynchronizer.php	(revision 85b7fcabd5cb73e8acbb70370d5d77e1ffe1918e)
+++ b/lib/Service/Sync/ImapToDbSynchronizer.php	(date 1659030415419)
@@ -209,6 +209,8 @@
 			return $rebuildThreads;
 		}
 
+		$force = true;
+
 		if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) {
 			$logger->debug("Locking mailbox " . $mailbox->getId() . " for new messages sync");
 			$this->mailboxMapper->lockForNewSync($mailbox);
@@ -293,7 +295,8 @@
 			$logger
 		);
 
-		$highestKnownUid = $this->dbMapper->findHighestUid($mailbox);
+ 		$highestKnownUid = $this->dbMapper->findHighestUid($mailbox);
+		$highestKnownUid = null;
 		$client = $this->clientFactory->getClient($account, false);
 		try {
 			try {

@admorgan
Copy link

Everything looks normal, but I see

{"reqId":"Z4DTc7XDS0v2RKwfR3I0","level":3,"time":"2022-07-28T19:48:09+00:00","remoteAddr":"204.77.163.109","user":"admorgan","app":"mail","method":"POST","url":"/apps/mail/api/mailboxes/193/sync","message":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.167 Safari/537.36","version":"24.0.2.1","exception":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","Code":0,"Trace":[{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/SyncService.php","line":127,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":161,"function":"syncMailbox","class":"OCA\\Mail\\Service\\Sync\\SyncService","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"sync","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","Line":255,"Previous":{"Exception":"TypeError","Message":"OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","Code":0,"Trace":[{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":453,"function":"deleteByUid","class":"OCA\\Mail\\Db\\MessageMapper","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":236,"function":"runPartialSync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/SyncService.php","line":127,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":161,"function":"syncMailbox","class":"OCA\\Mail\\Service\\Sync\\SyncService","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"sync","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Db/MessageMapper.php","Line":551},"CustomMessage":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453"}}

in my logs occasionally now.

@admorgan
Copy link

@miaulalala I do not see any instances of that in my logs.

@miaulalala
Copy link
Contributor

Everything looks normal, but I see

{"reqId":"Z4DTc7XDS0v2RKwfR3I0","level":3,"time":"2022-07-28T19:48:09+00:00","remoteAddr":"204.77.163.109","user":"admorgan","app":"mail","method":"POST","url":"/apps/mail/api/mailboxes/193/sync","message":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.167 Safari/537.36","version":"24.0.2.1","exception":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","Code":0,"Trace":[{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/SyncService.php","line":127,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":161,"function":"syncMailbox","class":"OCA\\Mail\\Service\\Sync\\SyncService","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"sync","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","Line":255,"Previous":{"Exception":"TypeError","Message":"OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453","Code":0,"Trace":[{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":453,"function":"deleteByUid","class":"OCA\\Mail\\Db\\MessageMapper","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":236,"function":"runPartialSync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/SyncService.php","line":127,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":161,"function":"syncMailbox","class":"OCA\\Mail\\Service\\Sync\\SyncService","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"sync","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Db/MessageMapper.php","Line":551},"CustomMessage":"Sync failed for 49:INBOX: OCA\\Mail\\Db\\MessageMapper::deleteByUid(): Argument #2 must be of type int, string given, called in /var/www/nextcloud.morgancomputers.net/htdocs/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php on line 453"}}

in my logs occasionally now.

yeah I've seen that about as well sometimes, there's another ticket here: #6905

@miaulalala
Copy link
Contributor

Also a possibility to fix this would be tro revert the new HEADER_STREAM stuff when getting the raw references:

index bc229c124..7198665be 100644
--- a/lib/Model/IMAPMessage.php
+++ b/lib/Model/IMAPMessage.php
@@ -182,9 +182,7 @@ class IMAPMessage implements IMessage, JsonSerializable {
 
        private function getRawReferences(): string {
                /** @var resource $headersStream */
-               $headersStream = $this->fetch->getHeaderText('0', Horde_Imap_Client_Data_Fetch::HEADER_STREAM);
-               $parsedHeaders = Horde_Mime_Headers::parseHeaders($headersStream);
-               fclose($headersStream);
+               $parsedHeaders = $this->fetch->getHeaderText('0', Horde_Imap_Client_Data_Fetch::HEADER_PARSE);
                $references = $parsedHeaders->getHeader('references');
                if ($references === null) {
                        return '';
```


Then adding an account works for me.

@dirtyharrywk
Copy link

I'm getting the same issue. I setup the account with ssl/tls, but when I export to verify I get none for security.

root@mydomain:/var/www/nextcloud# sudo -u www-data php -f occ mail:account:export user
Account 1:

@drmichaelfricke
Copy link

Just he same! We updated from 23.0.4 oder 23.0.7 auf 24.0.3!
grafik

@miaulalala
Copy link
Contributor

Hello Everyone, we're releasing v1.13.8 RC1 today - if you're able to install the Release Candidate, it would be great if you could test it. It contains the fix for this issue.

@admorgan
Copy link

admorgan commented Aug 7, 2022

I just got a chance to try it again. The current version on beta was 1.14.0-4 and I am still getting the same results with question marks.

@miaulalala
Copy link
Contributor

I just got a chance to try it again. The current version on beta was 1.14.0-4 and I am still getting the same results with question marks.

we didn't release a new version for 1.14 yet, only 1.13.8 :)

@admorgan
Copy link

admorgan commented Aug 7, 2022

Can you give me a clue how to get 1.13.8 when it is offering me 1.14? I can't find the proper occ incantation.

@miaulalala
Copy link
Contributor

Can you give me a clue how to get 1.13.8 when it is offering me 1.14? I can't find the proper occ incantation.

Downgrading is not supported unfortunately, but I will let you know as soon as we relase a new 1.14. version

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