Try the fastest and simplest way to install ONLYOFFICE

Error installing OnlyOffice Community Server 8.9.* Debian 8

Issues during installation and related to database

Error installing OnlyOffice Community Server 8.9.* Debian 8

Postby dsi-lille » Thu Aug 25, 2016 8:03 am

Hi,

I have a problem wih APT and Onlyoffice community server 8.9.1.191 on Debian 8.

When i try to upgrade my server (with a simple apt-get dist-upgrade) i ran into this issue with the onlyoffice-communityserver package:

Code: Select all
ERROR 1062 (23000) at line 1: Duplicate entry 'af' for key 'PRIMARY'
dpkg: erreur de traitement du paquet onlyoffice-communityserver (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
Des erreurs ont été rencontrées pendant l'exécution :
 onlyoffice-communityserver
E: Sub-process /usr/bin/dpkg returned an error code (1)


The problem came from your post installation script (/var/lib/dpkg/info/onlyoffice-communityserver.postinst)

in 8.5/8.7, the part of the post installation script use for installing/upgrading the database (function install_db) look like this :

Code: Select all
    if [ "$OLD_VERSION" = "" ]; then
        $MYSQL -e "CREATE DATABASE IF NOT EXISTS $DB_NAME CHARACTER SET utf8 COLLATE 'utf8_general_ci';"
        $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.sql
        $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.data.sql
        $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.resources.sql
    elif dpkg --compare-versions "$OLD_VERSION" ge 8.0 && dpkg --compare-versions "$OLD_VERSION" lt 8.1; then
        $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.upgrade81.sql
    fi
    $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.upgrade85.sql


and now in 8.9, it look like this :

Code: Select all
    # test mysql connection
    $MYSQL -e ";" &>/dev/null || ( service mysql start &>/dev/null && $MYSQL -e ";" >/dev/null )
    $MYSQL -e "CREATE DATABASE IF NOT EXISTS $DB_NAME CHARACTER SET utf8 COLLATE 'utf8_general_ci';"
    $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.sql
    $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.data.sql
    $MYSQL "$DB_NAME" < $DIR/Sql/onlyoffice.resources.sql

    for i in $(ls $DIR/Sql/onlyoffice.upgrade*); do
        $MYSQL "$DB_NAME" < ${i};
    done



So even if it's just an upgrade or just a reconfigure (with dpkg-reconfigure), the script initialize the database.

Can you fix your post installation script ?
Thanks,
Yoann
dsi-lille
 
Posts: 101
Joined: Mon Jul 11, 2016 1:47 pm

Re: Error installing OnlyOffice Community Server 8.9.* Debia

Postby Eugenie » Mon Sep 05, 2016 2:24 pm

Yoann,

we detected the issue and our developers are working on solving it.
Eugenie
 
Posts: 134
Joined: Mon Aug 25, 2014 10:11 am

Re: Error installing OnlyOffice Community Server 8.9.* Debia

Postby Eugenie » Thu Sep 08, 2016 2:13 pm

The issue is solved now. Please use the version from our official site.
Eugenie
 
Posts: 134
Joined: Mon Aug 25, 2014 10:11 am


Return to Installation / Database

Who is online

Users browsing this forum: No registered users and 1 guest