Searching mail error "Server Error: UID SEARCH: Internal error" when Full Text Search (Solr) indexing is enabled, resolves when disabled.
-
I recently had enabled Full Text Search (Solr) indexing now that I'm on a much more powerful dedicated server with memory to spare, and unfortunately a side-effect that was noticed was in webmail in particular (Roundcube), myself and users were experiencing this generic failure when a search was performed:
Server Error: UID SEARCH: Internal error occurred. Refer to server log for more information. [2024-12-06 17:00:58] (0.001 + 0.000
As soon as I disabled SOLR indexing, the issue was resolved.
Has anyone else experienced this? Any suggestions other than leaving it disabled for now? Not sure if this is a specific Roundcube problem or more of a Cloudron mail problem or both. Feel free to change this to the Roundcube category if needed.
-
I have seen this happen when the indexing is busy the first time around. Do you see this happen with small mailbxoes as well? If so, you might just have to wait till the large mailboxes finish indexing before searching.
-
@girish I hadn’t tried with a small mailbox to be fair, it was a larger one who noted it to me and my own account is fairly large too and I was able to easily reproduce it. Assumed at the time it was impacting everyone but that’s just a guess.
I had enabled the indexing though about 1-2 days before this issue was seen… is it expected to take that long to index everything? Is there a way to mitigate the indexing impact at all? Perhaps pausing when a user issues a search query?
-
-
@d19dotca 1-2 days seems quite a lot. I know that when you search the very first time, dovecot starts putting stuff into solr. There is a progress shown in the IMAP connection but most mail clients don't show it to the user .
As noted in https://docs.cloudron.io/email/#full-text-search , it might take even 10mins for 1GB of mail. Unfortunately, there is no way around this AFAIK. Also, only search is blocked and not checking emails . But of course, this depends on how the mail client deals with connections (it has to open a separate connection to check mails).
-
@girish there’s about 70 GB of mail on my server at the moment, so at that rate I guess it should be done in approximately 700 minutes (less than 12 hours) but even if we gave it 24 hours… 1-2 days seems like way too long then. The problem is my client uses webmail (Roundcube) exclusively and it’s dealing with medical stuff so I can’t really have the search failing like that as they rely on search heavily.
My intention of enabling it was to speed up the search even faster than it is, but it ended up blowing up in my face, lol.
Is there perhaps anything else I can try or is recommended for me to do or monitor if I were to try enabling it again? Anything in the logs I should be searching for? I didn’t find anything relevant in the logs even though the webmail client says to check the logs when it throws that error, so it was hard to know if it just wasn’t logged or if it was perhaps logged somewhere else.
-
@girish, now I’m starting to wonder if the thing was just indexing then that particular mailbox. The mailbox they have is around 15 GB, so 150 minutes approximately would be “down” for searching after they initiate the first search. If that is what was happening… I wonder… is there a way from the command line I can trigger it to index all mailboxes that haven’t been indexed already? My thinking is I could have it running overnight and then when they walk in to start the day it works as expected for them.
-
@d19dotca let me test and report back the exact behavior . would be nice to have this documented as well...
-
@d19dotca If you exec into the mail container, you can run
doveadm index -u mail@domain.com '*'
. That does the indexing . Maybe the solr index got corrupt and it's throwing some errors?You can also see the logs in
/run/solr/solr.log
To clear the index:
- Exec into the mail container (docker exec -ti mail /bin/bash)
- supervisorctl stop dovecot
- supervisorctl stop solr
- rm -rf /app/data/solr/dovecot
- supervisorctl start solr
- gosu cloudron:cloudron /app/code/solr/bin/solr create -c dovecot
- supervisorctl start dovecot
- doveadm index -u mail@domain.com '*'