Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Unable to load php-mapi

    Kopano Groupware Core
    4
    21
    7500
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thctlo
      thctlo last edited by

      remove you old packages…

      TEST :
      for x in `dpkg -l |grep kopano |grep 8.5.5 |cut -f3 -d" "` ; do echo $x ; done

      if you have a correct output, change echo $x to apt-get remove --purge --autoremove $x
      Start there.

      noise 1 Reply Last reply Reply Quote 0
      • noise
        noise @thctlo last edited by noise

        @thctlo

        Hi thctlo
        Hmmm the output of this are:

        for x in `dpkg -l |grep kopano |grep 8.5.5 |cut -f3 -d" "` ; do echo $x ; done
        output:
        kopano-core
        
        for x in `dpkg -l |grep kopano |grep 8.5.5 |cut -f3 -d" "` ; do echo apt-get remove --purge --autoremove $x ; done
        output:
        apt-get remove --purge --autoremove kopano-core
        

        or i missunderstood something here :-)
        i will try the new update with:
        apt-get dist-upgrade --autoremove --purge

        because this says currently:

        apt-get dist-upgrade --autoremove --purge
        Paketlisten werden gelesen... Fertig
        Abhängigkeitsbaum wird aufgebaut.       
        Statusinformationen werden eingelesen.... Fertig
        Paketaktualisierung (Upgrade) wird berechnet... Fertig
        0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
        

        about php you say
        You can only use the php version supplied with Ubuntu the kopano builds are build against only that version of php.
        is version 7.2.22-1 the wrong ? i use the ondrej ppa for php

        edit: after update with my above script, all is wrong now
        counld no etsablish a connection to kopano server (webapp logon is presents) and services running… i have a snapshot so i can back but i looking now. if i find the problem…

        also i think i have a problem with mapi:

        php -i | fgrep mapi -A 4
        PHP Warning:  PHP Startup: Unable to load dynamic library 'mapi.so' (tried: /usr/lib/php/20180731/mapi.so (/usr/lib/php/20180731/mapi.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mapi.so.so (/usr/lib/php/20180731/mapi.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
        
        fbartels thctlo 2 Replies Last reply Reply Quote 0
        • fbartels
          fbartels Kopano @noise last edited by

          Since this has nothing to do with the functionality of kdav I have moved these posts into their own topic.

          Regards Felix

          Resources:
          https://kopano.com/blog/how-to-get-kopano/
          https://documentation.kopano.io/
          https://kb.kopano.io/

          Support overview:
          https://kopano.com/support/

          1 Reply Last reply Reply Quote 0
          • thctlo
            thctlo @noise last edited by

            @fbartels, yes nothing todo with kdav correct.

            @noise said in Unable to load php-mapi:

            /usr/lib/php/

            Now run :
            cp /etc/kopano{,.backup}
            apt-get remove --purge --autoremove kopano-core

            Remember this : kopano-core is same as kopano-server-packages.
            the difference, kopano-core is from the distro packagers and kopano-server-packages is from kopano self.
            run ( just to make sure you have te minimal to run kopano : apt install kopano-server-packages

            ok now check if the kopano.ini is in the /etc/php folder.
            rgrep kopano /etc/php/*

            run : phpenmod kopano
            to make sure its enabled.

            systemctl stop apache2 && systemctl start apache2
            To fix that mapi problem you must stop and start apache, at least thats what i noticed.

            noise 1 Reply Last reply Reply Quote 0
            • noise
              noise @thctlo last edited by noise

              @fbartels
              ok yes its better to move this post here 👍

              @thctlo
              strange are the imap connections (kopano-gateway) are still running, also email are incoming. only webapp & z-push are breaks.

              it looks like:
              https://forum.kopano.io/topic/2439/latest-kopano-build-breaks-z-push-functionality/24

              but a change in

              /etc/kopano/server.cfg
              #server_listen = *:236
              server_listen = [1.2.3.4]:236
              

              not helps to connect.

              and i notice also this logs:

              Thu Sep  5 22:16:02 2019: [  796] [error  ] HrLogon server "default:" user "SYSTEM": network error
              Thu Sep  5 22:16:02 2019: [  796] [error  ] Unable to open admin session: network error (80040115)
              Thu Sep  5 22:16:05 2019: [  796] [error  ] gsoap connect: ()
              Thu Sep  5 22:16:05 2019: [  796] [error  ] HrLogon server "default:" user "SYSTEM": network error
              
              Fri Sep  6 05:00:02 2019: [warning] SQL [00002711] info: Try to reconnect
              Fri Sep  6 05:00:02 2019: [warning] SQL [00002718] info: Try to reconnect
              Fri Sep  6 05:00:02 2019: [warning] SQL [00002719] info: Try to reconnect
              
              ==> /var/log/php7.2-fpm.log <==
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] ERROR: unable to read what child say: Bad file descriptor (9)
              [05-Sep-2019 22:13:51] NOTICE: exiting, bye-bye!
              [05-Sep-2019 22:16:09] NOTICE: fpm is running, pid 932
              [05-Sep-2019 22:16:10] NOTICE: ready to handle connections
              [05-Sep-2019 22:16:10] NOTICE: systemd monitor interval set to 10000ms
              

              i try now your workaround and give a report back.

              p.s. i use nginx not apache, but should not be so relevant.

              1 Reply Last reply Reply Quote 0
              • thctlo
                thctlo last edited by

                works the same, stop/start nginx… you php needs to reload. but not reload stop/start, why i dont know restart does not work as far i can tell.

                noise 1 Reply Last reply Reply Quote 0
                • noise
                  noise @thctlo last edited by noise

                  @thctlo

                  i do the following…

                  apt-get remove --purge --autoremove kopano-core
                  
                  output:
                  Entfernen von kopano-core (8.5.5-0ubuntu1) ...
                  Entfernen von kopano-dagent (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von kopano-gateway (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von kopano-ical (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von kopano-monitor (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von kopano-spooler (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von libkcarchivercore0 (8.7.82.92.2b8011eaf-0+344.3) ...
                  Entfernen von libkcpyplug0 (8.7.82.92.2b8011eaf-0+344.3) ...
                  
                  apt install kopano-server-packages
                  
                  rgrep kopano /etc/php/*
                  
                  output:
                  /etc/php/7.0/mods-available/kopano.ini:include_path="${include_path}:/usr/share/kopano/php"
                  /etc/php/7.2/mods-available/kopano.ini:include_path="${include_path}:/usr/share/kopano/php"
                  /etc/php/7.3/mods-available/kopano.ini:include_path="${include_path}:/usr/share/kopano/php"
                  
                  phpenmod kopano
                  output: nothing
                  
                  systemctl stop nginx php7.2-fpm && systemctl start nginx php7.2-fpm
                  

                  Same as before all services running exept search, but i think this is another thing:

                  kopano-search.service - Kopano Groupware Core Search Daemon
                     Loaded: loaded (/lib/systemd/system/kopano-search.service; enabled; vendor preset: enabled)
                     Active: failed (Result: exit-code) since Fri 2019-09-06 12:33:11 CEST; 17min ago
                       Docs: man:kopano-search(8)
                             man:kopano-search.cfg(5)
                    Process: 822 ExecStart=/usr/sbin/kopano-search -F (code=exited, status=1/FAILURE)
                   Main PID: 822 (code=exited, status=1/FAILURE)
                  
                  Sep 06 12:33:10 smtp kopano-search[822]:     from . import table as _table
                  Sep 06 12:33:10 smtp kopano-search[822]:   File "/usr/lib/python3/dist-packages/kopano/table.py", line 25, in <module>
                  Sep 06 12:33:10 smtp kopano-search[822]:     from . import property_ as _prop
                  Sep 06 12:33:10 smtp kopano-search[822]:   File "/usr/lib/python3/dist-packages/kopano/property_.py", line 48, in <module>
                  Sep 06 12:33:10 smtp kopano-search[822]:     from . import timezone as _timezone
                  Sep 06 12:33:10 smtp kopano-search[822]:   File "/usr/lib/python3/dist-packages/kopano/timezone.py", line 24, in <module>
                  Sep 06 12:33:10 smtp kopano-search[822]:     import tzlocal
                  Sep 06 12:33:10 smtp kopano-search[822]: ModuleNotFoundError: No module named 'tzlocal'
                  

                  check mapi

                  php -i | fgrep mapi -A 4
                  PHP Warning:  PHP Startup: Unable to load dynamic library 'mapi.so' (tried: /usr/lib/php/20180731/mapi.so (/usr/lib/php/20180731/mapi.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mapi.so.so (/usr/lib/php/20180731/mapi.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
                  
                  ls -la /usr/lib/php/20180731/mapi.so
                  ls: cannot access '/usr/lib/php/20180731/mapi.so': No such file or directory
                  

                  mapi.so are not in the folder 20180731
                  there is only a mapi.so in /usr/lib/php/20170718

                  if i do simple copy from 20170718 to 20180731 the output are:

                  php -i | fgrep mapi -A 4
                  PHP Warning:  PHP Startup: mapi: Unable to initialize module
                  Module compiled with module API=20170718
                  PHP    compiled with module API=20180731
                  These options need to match
                   in Unknown on line 0
                  

                  not work because not match…

                  this means i have the wrong php right ?
                  i use the ondrej ppa, but wich repo do I have to take ?

                  1 Reply Last reply Reply Quote 0
                  • thctlo
                    thctlo last edited by

                    Make sure you use the default php version of ubuntu (7.2) is set.

                    check that with:
                    update-alternatives --config php
                    update-alternatives --config php-cgi
                    update-alternatives --config php-fpm

                    Any others check that with : ls -al /etc/alternatives/|grep php

                    ModuleNotFoundError: No module named ‘tzlocal’
                    apt install python3-tzlocal wil fix that.

                    mapi.so in /usr/lib/php/20170718
                    then there is most probely still a package related to that one.

                    run : dpkg -S Path_to/That/Mapi.ile

                    That will show from which package its coming. and htat is most probely : php-smbclient
                    You need that is you use the file plugin and you want smb access.
                    I have these:

                     dpkg -S /usr/lib/php/20170718/smbclient.so
                     php-smbclient: /usr/lib/php/20170718/smbclient.so
                     dpkg -S /usr/lib/php/20180731/mapi.so
                     php7-mapi: /usr/lib/php/20180731/mapi.so
                    
                    verify it :  dpkg -s php7-mapi
                    

                    And if its not installed install it again.
                    and thanks i now also noticed on debian Buster that kopano-smime is still using php7.2, where debian buster is on 7.3. :-/

                    noise 1 Reply Last reply Reply Quote 0
                    • noise
                      noise @thctlo last edited by

                      @thctlo

                      Great this resolve the mapi and search problem many thanks 👍
                      but still not be able to login at webapp and z-push also not working

                      06/09/2019 14:04:20 [ 3037] [FATAL] [test@domain.com] Exception: (ServiceUnavailableException) - Error connecting to KC (login)
                      06/09/2019 14:04:22 [ 3143] [WARN] [test@domain.com] /usr/share/z-push/backend/kopano/kopano.php:168 mapi_logon_zarafa(): Unable to setup service for provider (2)
                      06/09/2019 14:04:22 [ 3143] [ERROR] [test@domain.com] KopanoBackend->Logon(): login failed with error code: 0xFFFFFFFF80040115
                      
                      06/09/2019 14:04:27 [ 3039] [WARN] [test@domain.com] /usr/share/z-push/backend/kopano/kopano.php:168 mapi_logon_zarafa(): Unable to setup service for provider (2)
                      06/09/2019 14:04:27 [ 3039] [ERROR] [test@domain.com] KopanoBackend->Logon(): login failed with error code: 0xFFFFFFFF80040115
                      06/09/2019 14:04:27 [ 3039] [ INFO] [test@domain.com] ServiceUnavailableException: Error connecting to KC (login) - code: 0 - file: /usr/share/z-push/backend/kopano/kopano.php:184
                      06/09/2019 14:04:27 [ 3039] [ INFO] [test@domain.com] User-agent: 'Apple-iPhone9C3/1607.77'
                      06/09/2019 14:04:27 [ 3039] [FATAL] [test@domain.com] Exception: (ServiceUnavailableException) - Error connecting to KC (login)
                      06/09/2019 14:04:27 [ 3039] [ INFO] [test@domain.com] cmd='' memory='1.66 MiB/2.00 MiB' time='0.01s' devType='' devId='' getUser='test@domain.com' from='xxx.xxx.xxx.xxx' idle='0s' version='2.5.1+0-0' method='OPTIONS' httpcode='503'
                      
                      ==> /var/log/kopano/spooler.log <==
                      Fri Sep  6 14:16:15 2019: [ 1062] [error  ] Unable to open admin session: network error (80040115)
                      Fri Sep  6 14:16:18 2019: [ 1062] [error  ] gsoap connect: ()
                      Fri Sep  6 14:16:18 2019: [ 1062] [error  ] HrLogon server "default:" user "SYSTEM": network error
                      Fri Sep  6 14:16:18 2019: [ 1062] [error  ] Unable to open admin session: network error (80040115)
                      Fri Sep  6 14:20:54 2019: [ 1062] [warning] Table reload requested, breaking server connection
                      Fri Sep  6 14:20:54 2019: [ 1062] [warning] Server connection lost. Reconnecting in 3 seconds...
                      Fri Sep  6 14:29:52 2019: [=======] Starting kopano-spooler version 8.7.82 (pid 5758 uid 0)
                      Fri Sep  6 14:29:52 2019: [error  ] Use of Python (plugin_enabled=yes) forces process_model=fork
                      Fri Sep  6 14:29:52 2019: [=======] Starting kopano-spooler version 8.7.82 (pid 5758 uid 999)
                      Fri Sep  6 14:29:52 2019: [error  ] Use of Python (plugin_enabled=yes) forces process_model=fork
                      
                      
                      ==> /var/log/php7.2-fpm.log <==
                      [06-Sep-2019 14:16:23] NOTICE: fpm is running, pid 963
                      [06-Sep-2019 14:16:24] NOTICE: ready to handle connections
                      [06-Sep-2019 14:16:24] NOTICE: systemd monitor interval set to 10000ms
                      [06-Sep-2019 14:21:02] NOTICE: Terminating ...
                      [06-Sep-2019 14:21:02] ERROR: unable to read what child say: Bad file descriptor (9)
                      [06-Sep-2019 14:21:02] ERROR: unable to read what child say: Bad file descriptor (9)
                      [06-Sep-2019 14:21:02] NOTICE: exiting, bye-bye!
                      [06-Sep-2019 14:21:03] NOTICE: fpm is running, pid 4360
                      [06-Sep-2019 14:21:03] NOTICE: ready to handle connections
                      [06-Sep-2019 14:21:03] NOTICE: systemd monitor interval set to 10000ms
                      

                      the connection lost since the update i do yesterday. Before that it runs. but this is now another problem…

                      1 Reply Last reply Reply Quote 0
                      • thctlo
                        thctlo last edited by

                        Now i dont know much about nginx.
                        but this looks very good. https://kb.kopano.io/display/WIKI/Nginx
                        Follow that and review the setup.

                        Your almost there. ;-)

                        Side note.
                        i presonaly disable all webapp z-push modules etc.
                        I include these from the “available” folders in my apache setup.
                        then i create an empty the file and put that one in the “enabled” folder.
                        so my /etc/apache2/sites-enabled/webapp.conf is totaly empty.
                        Why i do this? Its just there so webapp wont get enabled as “sites” config after an upgrade, because that sometimes happens.

                        noise 1 Reply Last reply Reply Quote 0
                        • noise
                          noise @thctlo last edited by noise

                          @thctlo

                          could somehow never really make friends with apache :-) and since I’ve dealt with the nginx I only use this.

                          i think is not a nginx problem, webapp login page are showing, only no connection if you want to login. perhaps i go back to the last snapshot reconfigure mapi and search and trying the update again. is not a productive machine.

                          could also almost bet that my umaluts problem, which was still not really solved) is also related with mapi relative php

                          1 Reply Last reply Reply Quote 0
                          • thctlo
                            thctlo last edited by

                            Everyone there own cookie… i never tried nginx…

                            but if you follow the steps i showed, you will find you problem.

                            My first guesss…

                            kopano.ini is not loaded for php-fpm.
                            Sorry i can only show the apache examples, but for nginx its the same on debian/ubuntu… :-)

                            ls -al
                            total 28
                            drwxr-xr-x 7 root root 4096 Jul 22 10:47 .
                            drwxr-xr-x 3 root root 4096 Jul 22 10:47 ..
                            drwxr-xr-x 3 root root 4096 Jul 22 10:48 apache2
                            drwxr-xr-x 3 root root 4096 Jul 22 10:48 cgi
                            drwxr-xr-x 3 root root 4096 Jul 22 10:48 cli
                            drwxr-xr-x 4 root root 4096 Jul 22 10:48 fpm
                            drwxr-xr-x 2 root root 4096 Aug 17 22:13 mods-available
                            

                            Verify that kopano.ini is loaded where its needed.

                            /etc/php/7.3/apache2/conf.d/20-kopano.ini
                            /etc/php/7.3/cli/conf.d/20-kopano.ini
                            

                            i my guest is that you need this.
                            phpenmod -s ALL kopano

                            You can change the ALL also per SAPI…
                            like this :

                            phpenmod -s cli kopano
                            phpenmod -s nginx kopano
                            phpenmod -s fpm kopano
                            
                            noise 1 Reply Last reply Reply Quote 1
                            • noise
                              noise @thctlo last edited by noise

                              @thctlo

                              ok i take a look here.
                              but look on php are kopano ini is loaded
                              screenshot.png

                              i not really shure, but phpenmod is only for apache

                              1 Reply Last reply Reply Quote 0
                              • thctlo
                                thctlo last edited by

                                yeah… your not sure…
                                I am… :-p

                                phpenmod -s nginx kopano ;-) will work.

                                noise 1 Reply Last reply Reply Quote 1
                                • noise
                                  noise @thctlo last edited by noise

                                  @thctlo
                                  ok great :-) i try… many thanks for your support 👍

                                  edit: you totally right

                                  root@smtp:~# phpenmod -s cli kopano
                                  WARNING: Module kopano ini file doesn't exist under /etc/php/7.1/mods-available
                                  
                                  root@smtp:~# phpenmod -s nginx kopano
                                  WARNING: Invalid SAPI (nginx) specified
                                  usage: phpquery [ -d ] [ -q ] -v version_name -s sapi_name [ -m module_name ] [ -M ] [ -S ] [ -V ]
                                  WARNING: Directory /etc/php/7.3/nginx/conf.d doesn't exist, not enabling the module
                                  WARNING: Invalid SAPI (nginx) specified
                                  usage: phpquery [ -d ] [ -q ] -v version_name -s sapi_name [ -m module_name ] [ -M ] [ -S ] [ -V ]
                                  WARNING: Directory /etc/php/7.2/nginx/conf.d doesn't exist, not enabling the module
                                  WARNING: Module kopano ini file doesn't exist under /etc/php/7.1/mods-available
                                  WARNING: Invalid SAPI (nginx) specified
                                  usage: phpquery [ -d ] [ -q ] -v version_name -s sapi_name [ -m module_name ] [ -M ] [ -S ] [ -V ]
                                  WARNING: Directory /etc/php/7.0/nginx/conf.d doesn't exist, not enabling the module
                                  
                                  root@smtp:~# phpenmod -s fpm kopano
                                  WARNING: Invalid SAPI (fpm) specified
                                  usage: phpquery [ -d ] [ -q ] -v version_name -s sapi_name [ -m module_name ] [ -M ] [ -S ] [ -V ]
                                  WARNING: Directory /etc/php/7.3/fpm/conf.d doesn't exist, not enabling the module
                                  WARNING: Module kopano ini file doesn't exist under /etc/php/7.1/mods-available
                                  WARNING: Invalid SAPI (fpm) specified
                                  usage: phpquery [ -d ] [ -q ] -v version_name -s sapi_name [ -m module_name ] [ -M ] [ -S ] [ -V ]
                                  WARNING: Directory /etc/php/7.0/fpm/conf.d doesn't exist, not enabling the module
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • thctlo
                                    thctlo last edited by

                                    Your welkom, and i suggest, use the ALL then your sure you dont miss one.
                                    If you run from php from CLI, then you need the kopano.ini also in php/cli …

                                    If everything works, you can remove one for one, and keep only you really need.

                                    Have a great weekend i hope i helped you.

                                    noise 1 Reply Last reply Reply Quote 0
                                    • noise
                                      noise @thctlo last edited by noise

                                      @thctlo

                                      All is working now with the newest update. but with the above state i was not be able to run, so i go back to the last running state, resolve all mapi problems and search. Removed and reinstalled the kopano server packages with your workaround.

                                      and the update runs…

                                      one thing i notice about sql, but perhaps is only a warning:

                                      ==> /var/log/syslog <==
                                      Sep  8 05:13:03 smtp mysqld[1452]: 2019-09-08  5:13:03 139972050552576 [Warning] Aborted connection 76 to db: 'kopano' user: 'kopano' host: 'localhost' (Got timeout reading communication packets)
                                      
                                      ==> /var/log/syslog <==
                                      Sep  8 06:01:24 smtp mysqld[1452]: 2019-09-08  6:01:24 139972049938176 [Warning] Aborted connection 318 to db: 'kopano' user: 'kopano' host: 'localhost' (Got timeout reading communication packets)
                                      Sep  8 06:05:23 smtp kernel: [  157.543450] nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based  firewall rule not found. Use the iptables CT target to attach helpers instead.
                                      

                                      the umlauts problem is not really solved, but for this i go back to the other topic.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post