• Hello,

    I was today trying to fix kopano-search which is not runnig for many years.

    The error is the same many times reported here in the forum, but none of the suggestions did work:

    2020-04-19 20:28:30,075 - search - ERROR - Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/kopano/ics.py", line 290, in sync
        exporter.Config(stream, flags, importer, restriction, None, None, 0)
      File "/usr/lib/python3/dist-packages/MAPICore.py", line 1585, in Config
        return _MAPICore.IExchangeExportChanges_Config(self, lpStream, ulFlags, lpUnk, lpRestriction, lpIncludeProps, lpExcludeProps, ulBufferSize)
    MAPI.Struct.MAPIErrorNotFound: MAPI error 8004010F (MAPI_E_NOT_FOUND)
    

    The MAPI_E_NOT_FOUND is important, it means the connection to kopano-server works and I also see log entries (Accepted incoming connection on file:///var/run/kopano/server.sock) in the kopano-server log.

    When trying to fix this I tried to unhook the store of the SYSTEM user, which was not possible. Should this be possible?
    When analyzing further I found this output:

    root@vserver:/var/log/kopano# kopano-cli --user SYSTEM
    Name:                          SYSTEM
    Full name:                     SYSTEM
    Email address:                 postmaster@bmaehr.com
    Active:                        yes
    Administrator:                 yes (system)
    Address Book:                  hidden
    can only join an iterable
    root@vserver:/var/log/kopano#
    

    I didn’t put attention in the part “can only join an iterable”, but this seams to show something is broken with my system user.
    Commenting out lines of the display tool I found out that my system user perhaps misses (correct):

    • Features
    • PR_MESSAGE_SIZE_EXTENDED
    • send_only_to_delegates
    • PR_FREEBUSY_ENTRYIDS
    • Parameters for quota

    Is there a possibility to fix this? Is this perhaps the reason why kopano-search is not working?

    I’m one the (almost) newest nightly 10.0.3. I have configured ldap for users and groups, but user SYSTEM doesn’t exist in ldap.

    Bernhard

  • Kopano

    @bmaehr said in Corrupt data at user SYSTEM:

    but this seams to show something is broken with my system user.

    No, that is not the case. The output looks just the same on my system (where I do not have problems with search):

    $ kopano-cli --user SYSTEM
    Name:                          SYSTEM
    Full name:                     SYSTEM
    Email address:                 postmaster@localhost
    Active:                        yes
    Administrator:                 yes (system)
    Address Book:                  hidden
    can only join an iterable
    

  • Thanks for confirmation.

    Has somebody an idea why search is crashing with MAPI_E_NOT_FOUND?


  • The patch of https://forum.kopano.io/topic/1849/kopano-search-unable-to-create-new-sync-state didn’t work to solve one of the exceptions.

    2020-06-01 13:45:03,513 - search - WARNING - Sync state does not exist on server (anymore); requesting new one
    2020-06-01 13:45:03,515 - search - ERROR - Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/kopano/ics.py", line 290, in sync
        exporter.Config(stream, flags, importer, restriction, None, None, 0)
      File "/usr/lib/python3/dist-packages/MAPICore.py", line 1585, in Config
        return _MAPICore.IExchangeExportChanges_Config(self, lpStream, ulFlags, lpUnk, lpRestriction, lpIncludeProps, lpExcludeProps, ulBufferSize)
    MAPI.Struct.MAPIErrorNotFound: MAPI error 8004010F (MAPI_E_NOT_FOUND)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/kopano/log.py", line 102, in log_exc
        try: yield
      File "/usr/lib/python3/dist-packages/kopano_search/__init__.py", line 358, in incremental_sync
        new_state = self.server.sync(importer, self.state, log=self.log)
      File "/usr/lib/python3/dist-packages/kopano/server.py", line 1070, in sync
        return _ics.sync(self, self.mapistore, importer, state, max_changes,
      File "/usr/lib/python3/dist-packages/kopano/ics.py", line 297, in sync
        syncid, changeid = struct.unpack('<II', _bdec(state))
    struct.error: unpack requires a buffer of 8 bytes
    

    But at least after running

    kopano-search --reindex -u myuser
    

    the search returns also newer mails.

    The exception above is still there nd mails arriving after the reindex are not found.