Kopano(-WebApp) can't Login [was mapi Error]

Hi all,

I’ve got an issue installing Kopano Web-App. First I’ve installed Kopano-Core which went just fine, then I’ve added the WebApp which went fine to, at least on first sight. As soon as I try to add Z-Push the setup fails and when I check the WebIF I get the following error:

Not Found: PHP mapi extension not found
If you have upgraded Kopano Core, please restart Apache
Kopano WebApp can't start because of incompatible configuration.

Please correct above errors, a good start is by checking your '/etc/php/7.0/apache2/php.ini' file.

You can disable this configuration check by editing the file '/usr/share/kopano-webapp/config.php', but this is not recommended.

So I check for the module:

 root@ucs:~# php -m | grep -i mapi                                                                                               
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mapi.so' - /usr/lib/x86_64-linux-gnu/libkcfreebusy.so.0: version `KC_8.7.3' not found (required by /usr/lib/php/20151012/mapi.so) in Unknown on line 0
root@ucs:~# aptitude show libkcfreebusy0
Paket: libkcfreebusy0
Version: 8.7.1.0-0+9.1
Neu: ja
Zustand: Installiert
Automatisch installiert: ja
Priorität: optional
Bereich: mail
Verwalter: Kopano Development <development@kopano.io>
Architektur: amd64
Unkomprimierte Größe: 165 k
Hängt ab von: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libkcutil0, libmapi1, libstdc++6 (>= 5.2)
Beschreibung: Implementation of Free/Busy time scheduling
 RFC 5545

So my version is to old:

root@ucs:~# aptitude reinstall libkcfreebusy0
Die folgenden Pakete werden ERNEUT INSTALLIERT:
  libkcfreebusy0
0 Pakete aktualisiert, 0 zusätzlich installiert, 1 erneut installiert, 0 werden entfernt und 0 nicht aktualisiert.
E: Es konnte keine Quelle gefunden werden, um Version »8.7.1.0-0+9.1« von »libkcfreebusy0:amd64« herunterzuladen.
Nach dem Entpacken werden 0 B zusätzlich belegt sein.
E: Es konnte keine Quelle gefunden werden, um Version »8.7.1.0-0+9.1« von »libkcfreebusy0:amd64« herunterzuladen.
E: Interner Fehler: Liste der herunterzuladenden Pakete konnte nicht erzeugt werden.
E: Perhaps the package lists are out of date, please try 'aptitude update' (or equivalent); otherwise some packages or versions are not available from the current repository sources
root@ucs:~# aptitude install libkcfreebusy0
»libkcfreebusy0« ist bereits in der angeforderten Version (8.7.1.0-0+9.1) installiert.
»libkcfreebusy0« ist bereits in der angeforderten Version (8.7.1.0-0+9.1) installiert.
W: Package libkcfreebusy0 had been marked to reinstall, but the file for the current installed version 8.7.1.0-0+9.1 is not available
Es werden keine Pakete installiert, aktualisiert oder entfernt.
0 Pakete aktualisiert, 0 zusätzlich installiert, 0 werden entfernt und 0 nicht aktualisiert.
0 B an Archiven müssen heruntergeladen werden. Nach dem Entpacken werden 0 B zusätzlich belegt sein.

So let’s check the whole setup:

root@ucs:~# dpkg -l | grep 'libkc\|kopano'
ii  kopano-client                                       8.7.5.0-0+43.1                                   amd64        Kopano MAPI provider library
rc  kopano-common                                       8.7.1.0-0+9.1                                    amd64        Shared files for Kopano services
ii  kopano-contacts                                     8.7.5.0-0+43.1                                   amd64        MAPI provider adding contact folders in the addressbook
rc  kopano-dagent                                       8.7.1.0-0+9.1                                    amd64        E-Mail Delivery Agent for Kopano Core
rc  kopano-gateway                                      8.7.1.0-0+9.1                                    amd64        POP3 and IMAP Gateway for Kopano Core
rc  kopano-ical                                         8.7.1.0-0+9.1                                    amd64        ICal and CalDAV Gateway for Kopano Core
ii  kopano-lang                                         8.7.1.0-0+9.1                                    all          Translations for Kopano Core components
rc  kopano-monitor                                      8.7.1.0-0+9.1                                    amd64        Quota Monitor for Kopano Core
rc  kopano-search                                       8.7.1.0-0+9.1                                    amd64        Indexed search engine for Kopano Core
rc  kopano-server                                       8.7.1.0-0+9.1                                    amd64        Server component for Kopano Core
rc  kopano-spooler                                      8.7.1.0-0+9.1                                    amd64        E-mail Spooler for Kopano Core
ii  kopano-webapp                                       3.5.10.2410+106.1                                all          New and improved WebApp for Kopano
ii  kopano-webapp-plugin-desktopnotifications           2.0.3.26+32.1                                    all          Kopano WebApp Desktop notifications plugin
ii  kopano-webapp-plugin-filepreviewer                  2.2.0.26+24.1                                    all          Kopano File previewer plugin
ii  kopano-webapp-plugin-files                          2.1.5.305+101.2                                  all          Adds Files functionality to Kopano enabling access to WebDAV and other files backends.
ii  kopano-webapp-plugin-filesbackend-owncloud          2.1.0.87+42.5                                    all          Adds Owncloud specific functionality to Kopano Files plugin.
ii  kopano-webapp-plugin-filesbackend-smb               2.1.0.50+31.5                                    all          Adds Samba specific functionality to Kopano Files plugin.
ii  kopano-webapp-plugin-folderwidgets                  3.5.10.2410+106.1                                all          Kopano WebApp folder widgets plugin
ii  kopano-webapp-plugin-mdm                            2.1.1.109+38.3                                   all          Kopano WebApp MDM plugin
ii  kopano-webapp-plugin-smime                          2.2.2.240+23.1                                   all          Kopano WebApp S/MIME plugin
ii  kopano-webapp-plugin-spell                          2.0.0.23+41.1                                    all          Kopano WebApp Spellchecker plugin
ii  kopano-webapp-plugin-spell-de-de                    2.0.0.3+38.1                                     all          Kopano WebApp Spellchecker German dictionary plugin
ii  kopano-webapp-plugin-spell-en                       2.0.0.1+38.1                                     all          Kopano WebApp Spellchecker English dictionary plugin
ii  kopano-webapp-plugin-spell-nl                       2.0.0.1+39.1                                     all          Kopano WebApp Spellchecker Dutch dictionary plugin
ii  kopano-webapp-plugin-titlecounter                   3.5.10.2410+106.1                                all          Kopano WebApp Titlecounter plugin
ii  kopano-webapp-plugin-webappmanual                   3.5.10.2410+106.1                                all          Kopano WebApp Manual plugin
rc  kopano4ucs                                          1.5.33                                           all          Kopano4ucs integration package for Univention Corporate Server
ii  kopano4ucs-lib                                      1.5.33                                           all          Library package for common Kopano4ucs functions
ii  kopano4ucs-schema                                   1.5.33                                           all          LDAP schema for the Kopano4ucs integration
ii  kopano4ucs-udm                                      1.5.33                                           all          UDM extensions for the Kopano4ucs integration
ii  kopano4ucs-webapp                                   1.5.33                                           all          Kopano4ucs kopano-webapp integration package for Univention Corporate Server
rc  kopano4ucs-z-push                                   1.5.33                                           all          Meta package for Z-Push installation
ii  libgsoap-kopano-2.8.81                              2.8.81-0+1.1                                     amd64        Runtime libraries for gSOAP
ii  libgsoap-kopano-2.8.86                              2.8.86-0+1.1                                     amd64        Runtime libraries for gSOAP
ii  libkcfreebusy0                                      8.7.1.0-0+9.1                                    amd64        Implementation of Free/Busy time scheduling
ii  libkcicalmapi0                                      8.7.1.0-0+9.1                                    amd64        iCal interface for MAPI
ii  libkcinetmapi0                                      8.7.1.0-0+9.1                                    amd64        Interface between internet e-mail and MAPI
ii  libkcrosie0                                         8.7.1.0-0+9.1                                    amd64        Kopano HTML sanitizer interface
ii  libkcsoap0                                          8.7.1.0-0+9.1                                    amd64        SOAP (de)serializer functions for Kopano's RPCs
ii  libkcutil0                                          8.7.1.0-0+9.1                                    amd64        Miscellaneous utility functions for Kopano Core
ii  libvmime-kopano1                                    0.9.2.50+12.1                                    amd64        Library for working with MIME messages and IMAP/POP/SMTP
ii  php-kopano-smime                                    1.0.00+4.1                                       amd64        PHP Kopano SMIME Extension extends the php-openssl functions.
rc  z-push-backend-kopano                               2.5.1+0-0                                        all          Z-Push Kopano backend
rc  z-push-kopano-gabsync                               2.5.1+0-0                                        all          GAB sync for Kopano

I’m working with Debian since Potato (19 years) ago, but as this is my first UCS and I’ve not yet understood how sources are handled in the app-center I’m kinda lost with this…

Hi @mircsicz,

That hopefully now does not comes across as negative as it may sound, but while UCS is Debian based, for most of your tasks you need to shelve your Debian knowledge and instead use UCS specific tools.

In your package list I see 8.7.3 and 8.7.5 packages, which means that you added our repository to your system. Did you do that manually or through the settings option in the app? How did you update packages after adding the repository? instead of using apt-get/apt/aptitude on ucs system you should use univention-upgrade.

In the end the root cause is probably that you have held back packages because of changed dependencies.

Hi @fbartels,

don’t worry not taking it personal… Got ya, no more apt* on UCS!

root@ucs:~# univention-upgrade

Starting univention-upgrade. Current UCS version is 4.4-1 errata251

Checking for local repository:                          none
Checking for package updates:                           none
Checking for app updates:                               none
Checking for release updates:                           none

Prior to your reply I had already “aptitude purge’d” all kopano related packages and will now reinstall from the App-Center.

Sources.list entrys were added through the check box in the according App Settings…

After installing Kopano-Core through App-Center I see the following Msg’s in my syslog:

Sep 11 14:53:19 ucs kopano-server[6918]: An error occurred: disk error (0x80000007). Please check logfile syslog:- for details.
Sep 11 14:53:19 ucs kopano-search[5960]: [error  ] gsoap connect: ()
Sep 11 14:53:19 ucs kopano-search[5960]: [error  ] HrLogon server "default:" user "SYSTEM": network error
Sep 11 14:53:19 ucs kopano-search[5960]: 2019-09-11 14:53:19,977 - search - WARNING - could not connect to server at 'default:', retrying in 5 sec
Sep 11 14:53:19 ucs systemd[1]: kopano-server.service: Main process exited, code=exited, status=255/n/a
Sep 11 14:53:20 ucs systemd[1]: kopano-server.service: Unit entered failed state.
Sep 11 14:53:20 ucs systemd[1]: kopano-server.service: Failed with result 'exit-code'.

And probably as a consequence I can’t login using IMAP:

Host2: connecting and login on host2 [xx.y.0.10] port [143] with user [username]
Host2 IP address: xx.y.0.10
Host2 banner: * OK [CAPABILITY IMAP4rev1 LITERAL+ AUTH=PLAIN] IMAP gateway ready
Host2 capability before authentication: IMAP4rev1 LITERAL+ AUTH=PLAIN CHILDREN XAOL-OPTION NAMESPACE QUOTA IDLE AUTH
Host2 failure: Error login on [xx.y.0.10] with user [username] auth [LOGIN]: 2 BAD Internal error: OpenECSession failed

And after installing the Kopano WebApp I can’t login to the WebApp:

Cannot connect to Kopano Core.

that was less directed at you, rather the ucs employees reading this :smiley:

I think this needs more logging to really say why it stopped. but when kopano-server has stopped, then naturally search and imap won’t be able to operate (as they need the server for this).

Since you have a subscription I would recommend to talk with our support about this.

I’ll do so… will create a ticket with a reference to this posting

And as I raised the loglevel think I found the root cause:

Wed Sep 11 17:29:16 2019: [=======] Starting kopano-server version 8.7.5 (pid 25902 uid 0)
Wed Sep 11 17:29:16 2019: [=======] Starting kopano-server version 8.7.5 (pid 25902 uid 998)
Wed Sep 11 17:29:16 2019: [error  ] KDatabase::Connect(): database access error Unknown error code (0x80000007), mysql error: Access denied for user 'root'@'localhost' (using password: NO)
Wed Sep 11 17:30:46 2019: [error  ] Previous message logged 9 times
Wed Sep 11 17:30:46 2019: [crit   ] Unable to connect to database: MYSQL not initialized
Wed Sep 11 17:30:46 2019: [=======] Server shutdown complete.

Now I only need to find out how to tackle it! :wink:

Went a bit further by changing the mysql user & passwd in /etc/kopano/server.cfg.Had manually created the db, user and passwd. Kopano created the according tables, but now throw’s the following error:

Wed Sep 11 18:49:28 2019: [notice ] Connection to database 'kopano' succeeded
Wed Sep 11 18:49:28 2019: [error  ] SQL [00000004] Failed: Table 'settings' is read only, Query Size: 60, Query: "REPLACE INTO settings VALUES ('attachment_storage', 'files')"
Wed Sep 11 18:49:28 2019: [error  ] KDatabase::I_Update() query failed: "Table 'settings' is read only", query: REPLACE INTO settings VALUES ('attachment_storage', 'files')
Wed Sep 11 18:49:28 2019: [error  ] Unable to update database settings
Wed Sep 11 18:49:28 2019: [notice ] Waiting for mysql_server_end
Wed Sep 11 18:49:28 2019: [notice ] Waiting for mysql_library_end
Wed Sep 11 18:49:28 2019: [=======] Server shutdown complete.

And file perm’s definitly aren’t the issue:

root@ucs:~# ls -l /var/lib/mysql
insgesamt 176200
-rw-rw---- 1 mysql mysql    16384 Sep 11 18:26 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Sep 11 18:26 aria_log_control
-rw-r--r-- 1 root  root         0 Sep 11 15:58 debian-10.1.flag
-rw-rw---- 1 mysql mysql 79691776 Sep 11 18:26 ibdata1
-rw-rw---- 1 mysql mysql 50331648 Sep 11 18:26 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Sep 10 23:20 ib_logfile1
drwx------ 2 mysql mysql     4096 Sep 11 18:19 kopano
-rw-rw---- 1 mysql mysql        0 Sep 10 23:20 multi-master.info
drwx------ 2 mysql mysql     4096 Sep 11 15:58 mysql
drwx------ 2 mysql mysql     4096 Sep 11 15:58 performance_schema
-rw-rw---- 1 mysql mysql    24576 Sep 11 18:36 tc.log

This should all not be necessary. When the app is installed a mysql user is created with the right permissions (and then kopano-server creates the database and table structure).

THX, but I’ve already had three reinstall through app-center and in non of them it was created…

Maybe it’s because I had to reinstall MySQL after some crashed DB’s as of full HD? If so how can I reinstall from within Univention tools, because I used what I’m used to: apt :wink:

Ah, then you probably remove and reinstalled the packages (and installed the kopano packages, but not the integration packages). To install an app you either use the UCS UI or the ´univention-app´ command.

I’ve removed and reinstalled mariadb using apt, then I purge’d all kopano packages using aptitude and finally I tried (3 times) to reinstall kopano using the portal’s app-center…

So pls tell me how can I check for those inegration packages?

That is exactly what I meant with “you have to shelve your debian knowlege”, by manually removing packages I would say you have brought a lot of the UCS mechanics out of wack. The Kopano integration package is called kopano4ucs (this was already shown as removed in your initial package listing), but there are also integration packages for the database.

By now I would recommend to start over. If this system already provides your user directory there are surely ways to take this over to a new system (someone deeper into UCS would need to help out with that), if you have made your tests on a member or slave system this should be easy to throw away.

THx to @stoeckigt it’s back up and running fine now.

And as a note for anybody stepping into that same trap after me here is what happened:

After crashing the DB by filling HD with imapsync I tried to restore the DB but had no success! And here’s the reason why all the re install’s failed:

I had forgotten to run: “ucr unset mysql/config/mysql/innodb_force_recovery”

And as a long store here’s what @stoeckigt did via TV:

root@ucs:~# univention-app remove kopano-core
root@ucs:~# dpkg -P $( dpkg -l | grep kopano | awk '{print $2}' | tr '\n' ' ' )
root@ucs:~# ucr unset $( ucr search --brief ^kopano | sed -ne 's/\:.*//p' )
root@ucs:~# ucr unset $( ucr search --brief kopano4ucs | sed -ne 's/\:.*//p' )
root@ucs:~# rm -rf /etc/kopano-*.secret; rm -rf /etc/kopano/*
root@ucs:~# rm -rf /var/run/kopano/*
root@ucs:~# rm -rf /var/lib/kopano/*; rm -rf /var/lib/kopano-webapp/*
root@ucs:~# #mysql: drop database kopano;
root@ucs:~# #mysql: DELETE FROM user WHERE user LIKE 'kopanoDbUser%';

root@ucs:~# univention-app install kopano-core

And after the third or fourth round we added:

root@ucs:~# ucr unset mysql/config/mysql/innodb_force_recovery
root@ucs:~# apt install kopano4ucs --reinstall
1 Like
Mastodon