Attempted Onlyoffice install broke Nextcloud-Error 500

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 14.0.3
Operating system and version: Ubuntu 16.04 LTS
Apache or nginx version: Apache 2.4.18
PHP version: PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )

Is this the first time you’ve seen this error?: Yes

The issue you are facing:

Attempted to install Onlyoffice Community Document server earlier today. After the command, my terminal stated broken dependencies and packages.
Shortly after noticed nextcloud unable to connect with HTTP 500 Error not connecting on any platform. I did not notice any .htaccess files modified recently.

All errors from access requests were Error 500 Internal Server Error.
Error from web, desktop app, and davdroid sync.
Different ports were still operational such as Emby.

First error in terminal after trying to install OnlyOffice Community Server

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 onlyoffice-communityserver : Depends: mysql-server
                              Depends: mysql-client but it is not going to be installed
                              Depends: nodejs (>= 6.10.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

So I then tried to install mysql-server for onlyoffice which broke nextcloud.
I removed mysql-server and tried to restart mysql when I realized as it displayed this error:

sudo service mysql status
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: inactive (dead) since Sat 2018-12-08 18:05:57 EST; 1h 13min ago
     Docs: man:systemd-sysv-generator(8)

Dec 08 18:05:55 ubserv mysqld[1663]: 181208 18:05:55 [Note] /usr/sbin/mysqld: No
Dec 08 18:05:55 ubserv mysqld[1663]: 181208 18:05:55 [Note] Event Scheduler: Pur
Dec 08 18:05:55 ubserv mysqld[1663]: 181208 18:05:55 [Note] InnoDB: FTS optimize
Dec 08 18:05:55 ubserv mysqld[1663]: 181208 18:05:55 [Note] InnoDB: Starting shu
Dec 08 18:05:55 ubserv mysqld[1663]: 181208 18:05:55 [Note] InnoDB: Waiting for 
Dec 08 18:05:56 ubserv mysqld[1663]: 181208 18:05:56 [Note] InnoDB: Shutdown com
Dec 08 18:05:56 ubserv mysqld[1663]: 181208 18:05:56 [Note] /usr/sbin/mysqld: Sh
Dec 08 18:05:56 ubserv mysqld[1663]: 
Dec 08 18:05:57 ubserv mysql[25618]:    ...done.
Dec 08 18:05:57 ubserv systemd[1]: Stopped LSB: Start and stop the mysql databas

Steps to replicate it:

  1. Removed onlyoffice community server
  2. Removed mysql-server
  3. Rebooted
  4. No changes in .htaccess files logged

Output of Apache2 Error Log:

[Sat Dec 08 18:06:00.356388 2018] [:error] [pid 24620] [client] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Obj in /var/www/nextcloud/lib/private/DB/Connection.php on line 64

So it seems when I tired to install mysql-server for onlyoffice, it redirected or broke apache2 from nextcloud.

The output of your config.php file in /path/to/nextcloud:

$CONFIG = array (
  'instanceid' => 'oc1vu6rggsil',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '[rem]',
    1 => '[rem].io',
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'https://[REMOVED]/nextcloud',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:443',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'filelocking.enabled' => false,
  'theme' => '',
  'updater.secret' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'skeletondirectory' => '/var/opt/ncskeledir',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Memcached',
  'memcached_servers' => 
  array (
    0 => 
    array (
      0 => 'localhost',
      1 => 11211,

If I try to run a mysql command this is the response:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

just reinstalled
and fixed the issue
mod please delete topic


  1. running Onlyoffice Community-/ Document server together with NC server on one machine, doesn’t work currently via packages, as far as I know. Better don’t try that. It might work via manual installation when you setup a proxy server, but not with packages which would install both on default ports 443.
  2. when you uninstalled MySQL, I fear you uninstalled your NC database. Therefor the error message, that NC is not able to connect to the database.

I hope you have a database backup. To solve the problem:

  1. check if a database service is still installed and running
    • if not, install mysql again and set it up accordingly
  2. restore your database backup to get your DB content back
  3. try to access your NC again

For Onlyoffice do one of the following. Install onlyoffice:

  • via docker
  • on a second server
  • manually with a proxy server (apache as proxy for example and nginx as web server for each service) and configure separate tables in the DB for each service (the usual stuff)

damn, too late. Glad you were able to solve your issue.


Right after I fixed I saw you went to reply, I appreciate it though.

Normally I don’t use docker as I don’t trust the packages. I’d rather download any and all packages direct when possible. But I’ll definitely look into the onlyoffice even further before installing.

Luckily my database seems intact and no issues were found when it booted back up.

Do you think installing onlyoffice on a VM may be a better way to go? As to not have conflicts with nextcloud and mysql current database on the host.

With a VM would be a very clean solution as well, I think. Might be totally worth trying. As long as the hardware is powerful enough and performance loss due to the VM environment doesn’t affect the service too much.

That’s how i do it. One vm running nextcloud and one vm running collabora, onlyoffice and coturn.


Which did you prefer, collabora or onlyoffice?
Also any recommendations on VM settings. I have plenty of RAM to spare so that factor isn’t an issue.

Did you go with onlyoffice community edition or document server edition. I had a hard time finding the differences.

I barely use either of them. I like collabora more. But thats only me. Other users say differently.

Using OO CE by the way. The VM has 8GB Ram. I guess 4 would be enough. VM is idle most of the time even though 100 Users use it from time to time.