MAPI error 80040115 (MAPI_E_NETWORK_ERROR) with kopano 8.7.12


  • Hi,

    since our IT provider updated (from 8.7.3, I think) to 8.7.12, all scripts (python) accessing the server from machines other than the server machine sometimes (ca. 5x per hour) fail with the following error:

    MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    

    These scripts were running beforehand without any problem and check a folder on updates using ICS every second. They usually got seldomly an error like the following:

    kopano - WARNING - Received a MAPI error or timeout (error=0x80040115, retry=0/5)
    

    But this did not lead to a crash of the script.

    We have certain flavors of kopano installations used by these scripts:

    Cygwin (self compiled)
    Arch (self compiled)
    Centos (official, supported Kopano packages)

    All of them show the same behaviour. The only script successfully running is the one running on the server itself (we have built a test script watching a folder via ICS and simply printing the subject of a new mail popping up running on all of these servers).

    Our logs show a clear indication that this is timely connected to the update of the kopano server to 8.7.12. Therefore, it seems that something has been changed there leading to this problem. Updating the clients to 8.7.12 did not solve the problem.

    Maybe this is related to https://forum.kopano.io/topic/3164/problems-after-upgrade-kc-8-7-9-to-8-7-12/21

    Any idea? Would you think upgrading to 8.7.14 might help?

    Thanks!


  • As an update:

    Upgrading both the server and the clients did not end up in resolving the issue.

    Any thoughts?


  • @marlemion said in MAPI error 80040115 (MAPI_E_NETWORK_ERROR) with kopano 8.7.12:

    The only script successfully running is the one running on the server itself

    Firewalled, or rejected SSL certificate…


  • Sorry to say, but in the mean time we got the first crash of the script on the server as well. Maybe it is less prone to failure as the communication is faster on the same machine? Anyway, even if the culprit would be a firewall or SSL problems, the script would always fail. However, it does it only occasionally.

    This is an example of failures of today (grepped ‘MAPI error’ from unit journalctl output):

    Jun 26 00:14:58 server04.exampledomain.net testscript[19187]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 00:42:28 server04.exampledomain.net testscript[19337]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 00:42:58 server04.exampledomain.net testscript[19445]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 00:50:28 server04.exampledomain.net testscript[19455]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 01:09:58 server04.exampledomain.net testscript[19495]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 01:33:58 server04.exampledomain.net testscript[19592]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 01:56:58 server04.exampledomain.net testscript[19692]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 01:59:59 server04.exampledomain.net testscript[19784]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 02:41:29 server04.exampledomain.net testscript[19805]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 02:44:29 server04.exampledomain.net testscript[19982]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 02:49:29 server04.exampledomain.net testscript[19996]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 03:47:30 server04.exampledomain.net testscript[20016]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:00:00 server04.exampledomain.net testscript[21506]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:36:00 server04.exampledomain.net testscript[21568]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:37:30 server04.exampledomain.net testscript[21742]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:44:30 server04.exampledomain.net testscript[21749]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:45:30 server04.exampledomain.net testscript[21788]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:49:30 server04.exampledomain.net testscript[21799]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:55:00 server04.exampledomain.net testscript[21814]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 04:56:31 server04.exampledomain.net testscript[21843]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:05:30 server04.exampledomain.net testscript[21862]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:13:30 server04.exampledomain.net testscript[21924]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:33:00 server04.exampledomain.net testscript[21968]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:35:30 server04.exampledomain.net testscript[22048]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:40:00 server04.exampledomain.net testscript[22062]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 05:51:00 server04.exampledomain.net testscript[22088]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:03:01 server04.exampledomain.net testscript[22138]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:05:00 server04.exampledomain.net testscript[22213]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:07:30 server04.exampledomain.net testscript[22224]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:23:01 server04.exampledomain.net testscript[22237]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:30:00 server04.exampledomain.net testscript[22308]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:33:30 server04.exampledomain.net testscript[22347]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:35:01 server04.exampledomain.net testscript[22362]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:36:01 server04.exampledomain.net testscript[22372]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:37:00 server04.exampledomain.net testscript[22381]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:43:00 server04.exampledomain.net testscript[22391]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:48:31 server04.exampledomain.net testscript[22430]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 06:51:01 server04.exampledomain.net testscript[22450]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 07:38:01 server04.exampledomain.net testscript[22606]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 07:45:01 server04.exampledomain.net testscript[22676]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 07:45:30 server04.exampledomain.net testscript[22716]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 07:47:00 server04.exampledomain.net testscript[22725]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    Jun 26 07:55:01 server04.exampledomain.net testscript[22734]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
    

    As the ICS loop is running every second, there are not too many failures, but each of them is killing the script.

    The Test script we use:

    #!/usr/bin/python
    import kopano
    import sys
    import time
    import logging
    
    logger = logging.getLogger('TEST')
    format="[%(filename)-10s:%(lineno)-5s - %(funcName)35s] - %(message)s"
    level = logging.DEBUG
    logger.setLevel(level)
    formatter = logging.Formatter(format)
    sh = logging.StreamHandler()
    sh.setLevel(level)
    sh.setFormatter(formatter)
    logger.addHandler(sh)
    
    logger.info('Start TEST')
    
    # Delete all command line arguments: Trick to circumvent the parser of Kopano modules
    sys.argv = [sys.argv[0]]
    
    # Kopano Server, User and Password
    kopano_server = 'http://xxxx:236/kopano'
    kopano_user = 'xxx'
    kopano_password = 'xxx'
    kopano_folder = 'Inbox'
    
    # Set up importer class for
    class Importer:
        def update(self, item, flags):
            if ( flags != 0 ):
                logger.debug('New Mail: ' + item.entryid + ' ' + item.subject)
    
    if __name__ == '__main__':
    
        # Login to Kopano Server
        # Change this to kopano.server starting from Kopano 8.8 on
        server = kopano.Server(server_socket=kopano_server, auth_user=kopano_user, auth_pass=kopano_password)
    
        # Open store of user and inbox folder
        store = server.user(kopano_user).store
        folder = store.folder(kopano_folder)
    
        # Get current state from folder
        folder_state = folder.state
        logger.debug('Retrieved new state from folder: ' + folder_state)
    
        # Check folder each second
        x = 1
        while ( x == 1 ):
            # Get new state of folder, process files since last state during this process
            new_state = folder.sync(Importer(), folder_state)
    
            # Set new state if necessary
            if new_state != folder_state:
                logger.debug('Retrieved new state from folder: ' + new_state)
                folder_state = new_state
    
            time.sleep(1)
    
        sys.exit(0)