Error when searching large mailboxes

Ever since successfully upgrading to v0.41, I’ve received the following error when I attempt to search large mailboxes, or across all mailboxes:

An error occurred!

Server Error: Failed to send UID SEARCH command

I’ve searched the forums and github, but have been unable to find anything that fixes it.

Is there anything I should change to fix this? I tend to search my mail quite a bit, so this is rather frustrating.

Can you give the output in the logs around that line? it will give better context.

There does not appear to be a lot of context. There is nothing relevant in /var/log/roundcubemail/errors, and the only thing that coincides and seems relevant is in /var/log/mail.log:

Jul 10 08:16:41 imap(user@domain): Info: Connection closed (UID SORT running for 16.093 + waiting input for 0.001 secs, 0.001 in locks, 35 B in + 0 B out, state=wait-external) in=106 out=1546

The error itself, which I quoted in my original post, appears in the GUI, not the logs.

Additional info: When searching for the error with respect to roundcubemail, I found the following: default_socket_timeout needs to be increased in php.ini to reduce/eliminate the error. I’ve attempted to do this (changing the value from 60 to 180 in /etc/php/7.2/cli and fpm), with no success. I tried increasing it to 360, but the error still occurs.

After changing the value in php.ini (for FPM) you must restart the FPM service:

systemctl restart php-fpm (or php7.2-fpm) It’s been awhile since I’ve ran MIAB so package names might have changed.

Yep. I issued a sudo service php7.2-fpm restart after increasing default_socket_timeout. It did not help.

I saw somewhere else (a cPanel forum, I believe) where similar UID SEARCH errors – but not this exact error – were due to corrupted user prefs in the database, and clearing them may help. Unfortunately, I do not know where to look or what command to run to do so with MIAB. See https://forums.cpanel.net/threads/error-in-imap-command-uid-search-unknown-argument.653875/ for that thread.

Also increase execution_time in php.ini like you did the other option.

Unfortunately, that didn’t help either. I also tried increasing max_input_time.

Is there anything in /var/log/nginx/error?

a few ActiveSync timeouts.

Anyone? Being unable to search my mailboxes is a show-stopper for me. I keep all sorts of things in my email archives. I’ve had to resort to grepping through the mailboxes from the shell, and that’s not a viable long-term solution.

Actually, I think I just fixed it. After some more digging, I found that mailinabox is setting roundcube’s imap_timeout to 15 seconds. I increased this (in my case, to 360 seconds, which may be overkill) by editing /usr/local/lib/roundcubemail/config/config.inc.php , and now my searches work!

Keep in mind that when you update, that file may or may not be overwritten.