NC 26.0.2 breaks IMAP mail

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.2
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4
PHP version (eg, 7.4): 8.1 fpm

The issue you are facing:
Mail client shows correct email address, but no longer shows any folders or messages. Error in log refers to IMAP error synchronising - see below.
Immediately after upgrade it seems OK, but once server is restarted it breaks. Reverting will lose other data so not keen to roll the server back.

Dovecot log shows NC is logging in with correct user, no changes have been made to mail server either.

Standard NC mail app version 3.2.0

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Fully working NC 26.0.1 connection to Postfix and Dovecot
  2. Update to NC 26.0.2
  3. Mail no longer works. Clearing and re-entering config in groupware makes no difference

The output of your Nextcloud log in Admin > Logging:

[mail] Error: OCA\Mail\Exception\ServiceException: IMAP error synchronizing account 6: The object could not be deleted because it does not exist. at <<closure>>

0. /srv/nextcloud/www/apps/mail/lib/Service/MailManager.php line 142
   OCA\Mail\IMAP\MailboxSync->sync("*** sensitive parameters replaced ***")
1. /srv/nextcloud/www/apps/mail/lib/Controller/MailboxesController.php line 85
   OCA\Mail\Service\MailManager->getMailboxes()
2. /srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php line 230
   OCA\Mail\Controller\MailboxesController->index()
3. /srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php line 137
   OC\AppFramework\Http\Dispatcher->executeController()
4. /srv/nextcloud/www/lib/private/AppFramework/App.php line 183
   OC\AppFramework\Http\Dispatcher->dispatch()
5. /srv/nextcloud/www/lib/private/Route/Router.php line 315
   OC\AppFramework\App::main()
6. /srv/nextcloud/www/lib/base.php line 1058
   OC\Route\Router->match()
7. /srv/nextcloud/www/index.php line 36
   OC::handleRequest()

Caused by:

Horde_Imap_Client_Exception_ServerResponse: The object could not be deleted because it does not exist. at <<closure>>

 0. /srv/nextcloud/www/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php line 4566
    Horde_Imap_Client_Socket->_responseCode()
 1. /srv/nextcloud/www/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php line 4314
    Horde_Imap_Client_Socket->_getLine()
 2. /srv/nextcloud/www/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php line 4242
    Horde_Imap_Client_Socket->_sendCmdChunk()
 3. /srv/nextcloud/www/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php line 3904
    Horde_Imap_Client_Socket->_sendCmd()
 4. /srv/nextcloud/www/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php line 3330
    Horde_Imap_Client_Socket->_getMyACLRights()
 5. /srv/nextcloud/www/apps/mail/lib/IMAP/FolderMapper.php line 122
    Horde_Imap_Client_Base->getMyACLRights()
 6. /srv/nextcloud/www/apps/mail/lib/IMAP/MailboxSync.php line 118
    OCA\Mail\IMAP\FolderMapper->fetchFolderAcls()
 7. /srv/nextcloud/www/apps/mail/lib/Service/MailManager.php line 142
    OCA\Mail\IMAP\MailboxSync->sync("*** sensitive parameters replaced ***")
 8. /srv/nextcloud/www/apps/mail/lib/Controller/MailboxesController.php line 85
    OCA\Mail\Service\MailManager->getMailboxes()
 9. /srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Mail\Controller\MailboxesController->index()
10. /srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
11. /srv/nextcloud/www/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
12. /srv/nextcloud/www/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
13. /srv/nextcloud/www/lib/base.php line 1058
    OC\Route\Router->match()
14. /srv/nextcloud/www/index.php line 36
    OC::handleRequest()

GET /index.php/apps/mail/api/mailboxes?accountId=6
from 192.168.555.555 by 12345678-5555-5555-5555-1234567890AB at 2023-06-08T19:18:43+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'number',
  'passwordsalt' => 'with vinegar',
  'secret' => 'sauce',
  'trusted_domains' => 
  array (
    0 => 'something.example.com',
  ),
  'datadirectory' => '/srv/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '26.0.2.1',
  'overwrite.cli.url' => 'http://something.example.com',
  dbinfo removed
  'installed' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cumulus-notify',
  'mail_domain' => 'example.com',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mailer.example.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'nc-notify@example.com',
  'mail_smtppassword' => 'secret',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'default_phone_region' => 'GB',
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

nextcloud_s.access
192.168.X.X - - [08/Jun/2023:20:54:24 +0100] "GET /index.php/apps/mail/ HTTP/1.1" 200 13239 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "GET /ocs/v2.php/search/providers?from=%2Fapps%2Fmail%2F HTTP/1.1" 200 1145 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "PROPFIND /remote.php/dav/ HTTP/1.1" 207 1154 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "GET /ocs/v2.php/apps/user_status/api/v1/statuses/**LDAP-DERIVED-ID** HTTP/1.1" 200 976 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1" 200 1550 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 1300 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "PROPFIND /remote.php/dav/principals/users/**LDAP-DERIVED-ID**/ HTTP/1.1" 207 1894 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:25 +0100] "GET /apps/mail/js/mail.909.510cb6317d89d2c2f347.js HTTP/1.1" 200 4091 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:26 +0100] "PROPFIND /remote.php/dav/calendars/**LDAP-DERIVED-ID**/ HTTP/1.1" 207 3477 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:26 +0100] "GET /index.php/apps/mail/api/sieve/active/6 HTTP/1.1" 400 905 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.X.X - - [08/Jun/2023:20:54:30 +0100] "PUT /index.php/apps/mail/api/preferences/start-mailbox-id HTTP/1.1" 200 1410 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"


Nothing in other logs.

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

As above from logging
1 Like

I tested my Mail client on NC26 and it works with my IMAP provider. likely the issue is specific to your provider or config (I didn’t have Mail installed during upgrade to NC26
 so can’t sort out upgrade issues. but it started working immediatelyusing old config after update/enabling)

I am just seeing exactly the same issue. My mail server is a standard dovecot server, which always worked fine with Nextcloud and any other mail clients. So there does seem to be an issue with the latest NC version.

thanks for sharing this with the community. you are welcome to find and solve the issue!

I am intending to submit a bug report, but gathering all the information takes some effort. Clearly, whatever it is, it first appeared in the latest version.

Downgrading to mail 3.1.1 fixes it. Just tried.

Here is the bug report

P.S.: TBH, I find your tone somewhat denigrating. If you have nothing helpful to contribute, better don’t comment.

1 Like

It is not Nextcloud 26.0.2 that breaks it but version 3.2.0 of the mail app. I have just downgraded it to 3.1.1 and everything is back to normal. (I’ve also submitted a bug report, see my other comment.)

1 Like

Thanks @vasyugan, at least I know it’s not just me! :wink: How do you downgrade the version of the mail app? I have backups of course, but taking the whole host back will lose other data so a last resort.

Another lesson for me is to do more extensive testing (inc reboot!) before allowing any future upgrades, and keep much more careful notes on app versions etc, which if this was at $day_job I’d have insisted on before signing off. My bad.

Or maybe it’s time to build a sandpit and check out snappymail?

If you have console access, that’s done quickly:

  1. Remove the mail app either via occ or through the web interface.
  2. Go to this page and scroll down to version 3.1.1, download it.
  3. Unpack it in the apps/ subdirectory of your nextcloud instance: tar -xzvf [name of the file you just downloaded]
  4. Enable the mail app again, either via occ or the web interface.

I hope, though, that the underlying bug will be fixed in the next point release. So far, there hasn’t been a reaction to my bug report. Please have an eye on it and if needed, contribute information.

2 Likes

[RichardN] RichardN https://help.nextcloud.com/u/richardn
June 11

Thanks @vasyugan https://help.nextcloud.com/u/vasyugan, at least I
know it’s not just me! :wink: How do you downgrade the version of the
mail app?

If you have console access, that’s done quickly:

  1. Remove the mail app either via occ or through the web interface.
  2. Go to this page
    https://apps.nextcloud.com/apps/mail/releases?platform=26#26 and
    scroll down to version 3.1.1, download it.
  3. Unpack it in the apps/ subdirectory of your nextcloud instance: tar
    -xzvf [name of the file you just downloaded]
  4. Enable the mail app again, either via occ or the web interface.

I hope, though, that the underlying bug will be fixed in the next point
release. So far, there hasn’t been a reaction to my bug report
https://github.com/nextcloud/mail/issues/8537. Please have an eye on
it and if needed, contribute information.

The downgrade process worked perfectly and I now have the main and a test instance back to the 3.1.1 release and both talking to main / test Dovecot instances. Many thanks for the downgrade process.

Mail 3.2.1 has just been released with a fix for dynamic class autoloading, hopefully I’ll be able to test this tomorrow evening and see if it makes any difference. And create / resurrect a Github account to add comments too.

:beers:

-R

1 Like

So have you tested 3.2.1? Does it work for you?

3.2.1 fixes it for me. I will close the bug report.

Actually I have to correct myself: Upgrading to Nextcloud 27 fixed it. The bug is still present in Mail 3.2.1 on Nextcloud 26.x

Mail 3.2.1 seemed to be fully working on both test and live instances, but that brief moment of success appears to have been short-lived.

Thanks to @vasyugan though, I’ll try Mail 3.2.2 otherwise a full upgrade to NC 27 is going to take a little while to test everything in a non-prod instance first. Not good.