Kopano-cli authenticate failed user='SYSTEM'



  • kopanocore-8.6.80.1005 built from sources because LFS is unsupported distro
    mariadb-10.2.14
    In the past I have got zarafa working but this is the first time I test kopano

    kopano-server starts fine without errors. But any kopano-cli command gives error.

    # kopano-cli --list-users --debug
    [error  ] HrLogon server "default:" user "SYSTEM": logon failed
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/kopano_cli/__init__.py", line 589, in main
        server = kopano.Server(options)
      File "/usr/lib/python2.7/site-packages/kopano/server.py", line 262, in __init__
        raise LogonError('Could not logon to server: username or password incorrect')
    LogonError: Could not logon to server: username or password incorrect
    

    audit.log

    [crit   ] authenticate failed user='SYSTEM' from='file:///var/run/kopano/server.sock' program='python'
    
    $ man kopano-cli shows option
           --config, -c FILE
               Load configuration settings from specified file.
    

    No other ducumentation found.

    What am I missing?


  • Kopano

    @tjoen said in Kopano-cli authenticate failed user='SYSTEM':

    What am I missing?

    connecting to the file socket requires admin permissions for the user. for the file socket, these are usually established through the local_admin_users setting in the server.

    In your case you have run it with a user that is not an admin.



  • OK. I deleted root from the default example-config/server.cfg because of another error.
    After adding root again to server.cfg audit.log reports

    [crit   ] authenticate ok: from="file:///var/run/kopano/server.sock" user="SYSTEM" method="Pipe socket" program="python" sid=0x3c81196ef148128a
    

    But the original error now came back:

    # kopano-cli --list-users --debug
    [error  ] virtual HRESULT M4LMAPISession::OpenMsgStore(ULONG_PTR, ULONG, const ENTRYID*, LPCIID, ULONG, IMsgStore**): msp->Logon failed: logon failed (80040111)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/kopano_cli/__init__.py", line 590, in main
        check_options(parser, options, server)
      File "/usr/lib/python2.7/site-packages/kopano_cli/__init__.py", line 576, in check_options
        if server.multitenant and not (options.companies or options.groups or options.users):
      File "/usr/lib/python2.7/site-packages/kopano/server.py", line 503, in multitenant
        self._companylist()
      File "/usr/lib/python2.7/site-packages/kopano/server.py", line 497, in _companylist
        return [eccompany.Companyname for eccompany in self.sa.GetCompanyList(MAPI_UNICODE)]
      File "/usr/lib/python2.7/site-packages/kopano/server.py", line 282, in sa
        self._sa = self.mapistore.QueryInterface(IID_IECServiceAdmin)
      File "/usr/lib/python2.7/site-packages/kopano/server.py", line 276, in mapistore
        self._mapistore = GetDefaultStore(self.mapisession)
      File "/usr/lib/python2.7/site-packages/MAPI/Util/__init__.py", line 101, in GetDefaultStore
        return session.OpenMsgStore(0, row[1].Value, None, MDB_WRITE)
      File "/usr/lib/python2.7/site-packages/MAPICore.py", line 1464, in OpenMsgStore
        return _MAPICore.IMAPISession_OpenMsgStore(self, ulUIParam, cbEntryID, lpInterface, ulFlags)
    MAPIErrorLogonFailed: MAPI error 80040111 (MAPI_E_LOGON_FAILED)
    
    # kopano-cli --create-store  --user kopano --password kopano  --admin-level 1
    [error  ] virtual HRESULT M4LMAPISession::OpenMsgStore(ULONG_PTR, ULONG, const ENTRYID*, LPCIID, ULONG, IMsgStore**): msp->Logon failed: logon failed (80040111)
    MAPI error 80040111 (MAPI_E_LOGON_FAILED)
    

  • Kopano

    with which user are you running these scripts and are these users mentioned in local_admin_users?

    PS: this forum uses markdown to format messages. please put logfiles and console output into code blocks.



  • @fbartels
    local_admin_users = root kopano
    That is the same as the file in doc/kopano/example-config/

    Those in my postings were by root
    I tried the last command running as user kopano, but same results.
    /var/lib/mysql/localhost.log:

    180625 13:30:02    38 Connect   kopano@localhost as anonymous on kopano
                       38 Query     SHOW tables
                       38 Query     SHOW variables LIKE 'max_allowed_packet'
                       38 Query     SET NAMES utf8
                       38 Query     SHOW SESSION VARIABLES LIKE 'group_concat_max_len'
                       38 Query     set max_sp_recursion_depth = 255
                       38 Query     SET SESSION sql_mode = 'STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
                       38 Query     SELECT hierarchy.id, stores.guid, stores.hierarchy_id, stores.type FROM stores join hierarchy on stores.hierarchy_id=hierarchy.parent WHERE stores.user_id=2 AND stores.type=0 LIMIT 1
    


  • This thread can be closed. I need to open a new subject for problem

    # kopano-cli --list-users --debug
    

  • Kopano

    What was your solution?



  • So kopano-admin -l worked?



  • @fbartels the sollution is what you suggested:
    local_admin_users = root kopano
    was:
    local_admin_users = kopano

    @jengelh - result of kopano-admin -l
    Unable to open Admin store: logon failed (0x80040111)
    Same as kopano-cli

    I try to reinstall database and try the default
    mysql_user = root
    Currently:
    mysql_user = kopano


Log in to reply