Unable to download or enable Community Document Server

Nextcloud version (eg, 12.0.2): 18.0.1
Operating system and version (eg, Ubuntu 17.04): linux x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.1): 7.2.27

The issue you are facing:
Unable to download and enable Community Document Server.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Download the documentserver_community.tar.gz from apps.nextcloud.com
  2. Extract and upload it to /nextcloud/apps
  3. Enabling it on the server resulted in ‘An error occured during the request. Unable to proceed.’ pop-up. Failed to Enable it

The output of your Nextcloud log in Admin > Logging:

Error index Exception: fclose() expects parameter 1 to be resource, null given

0. /home/xiom3155/public_html/cloud/lib/private/AppFramework/App.php - line 125:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")
1. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})
2. <<closure>>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})
3. /home/xiom3155/public_html/cloud/lib/private/Route/Router.php - line 299:call_user_func(OC\AppFramew ... {}, { _route: "s ... "})
4. /home/xiom3155/public_html/cloud/lib/base.php - line 1008:OC\Route\Router->match("/settings/apps/enable")
5. /home/xiom3155/public_html/cloud/index.php - line 38:OC::handleRequest()

Caused by TypeError: fclose() expects parameter 1 to be resource, null given

0. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php - line 66:fclose(null)
1. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/LocalAppData.php - line 78:OCA\DocumentServer\Document\FontManager->OCA\DocumentServer\Document\{closure}("*** sensiti ... *")
2. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php - line 72:OCA\DocumentServer\LocalAppData->getReadLocalPath(OC\Files\Sim ... {}, Closure {})
3. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Migration/RebuildFonts.php - line 46:OCA\DocumentServer\Document\FontManager->rebuildFonts()
4. /home/xiom3155/public_html/cloud/lib/private/Repair.php - line 104:OCA\DocumentServer\Migration\RebuildFonts->run(OC\Repair {})
5. /home/xiom3155/public_html/cloud/lib/private/legacy/app.php - line 981:OC\Repair->run()
6. /home/xiom3155/public_html/cloud/lib/private/Installer.php - line 154:OC_App::executeRepairSteps("documentserver_community", { step: "OCA ... "})
7. /home/xiom3155/public_html/cloud/apps/settings/lib/Controller/AppSettingsController.php - line 443:OC\Installer->installApp("documentserver_community")
8. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:OCA\Settings\Controller\AppSettingsController->enableApps([ "documentserver_community"], [])
9. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")
10. /home/xiom3155/public_html/cloud/lib/private/AppFramework/App.php - line 125:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")
11. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})
12. <<closure>>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})
13. /home/xiom3155/public_html/cloud/lib/private/Route/Router.php - line 299:call_user_func(OC\AppFramew ... {}, { _route: "s ... "})
14. /home/xiom3155/public_html/cloud/lib/base.php - line 1008:OC\Route\Router->match("/settings/apps/enable")
15. /home/xiom3155/public_html/cloud/index.php - line 38:OC::handleRequest() 2020-02-25T13:27:49+0700
Error PHP Undefined offset: 0 at /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php#66 2020-02-25T13:27:49+0700
Error PHP proc_open() has been disabled for security reasons at /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php#64 2020-02-25T13:27:49+0700

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
  ),
  'datadirectory' => '',
  'dbtype' => 'mysql',
  'version' => '18.0.1.3',
  'overwrite.cli.url' => '',
  'dbname' => '',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => '',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'tech',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'updater.release.channel' => 'stable',
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'occweb',
    1 => 'files_frommail',
    2 => 'drawio',
  ),
  'has_rebuilt_cache' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

No access on shared hosting.

Thanks for the link, i’ve followed the solution beforehand, and indeed it didn’t timed out this time. But instead a more obscure error notice, ‘An error has occurred’, appeared.

Bump. Haven’t been able to solve it myself.

Sorry for that, what is the actual Status? You can download and activate the App?

Nope, after the Download finished, the obscure error notice appeared, ‘An error has occurred’. The app itself failed to install and i couldn’t find the downloaded app anywhere. It just, failed.

And the Log say something?

Not a glance, the log i posted above showed nothing about the failed download.

is this not a timeout?

should be solved on nc18.0.1.

18.0.1 didn’t solve the problem, still couldn’t install the Community Document Server. However, i did try to install the app by manually uploading it. Still, when i tried to ‘Enable’ it, and ‘An error occured during the request. Unable to proceed.’ notice popped up again. At least a log appeared. Here it is:

Error index Exception: fclose() expects parameter 1 to be resource, null given

0. /home/xiom3155/public_html/cloud/lib/private/AppFramework/App.php - line 125:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")
1. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})
2. <<closure>>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})
3. /home/xiom3155/public_html/cloud/lib/private/Route/Router.php - line 299:call_user_func(OC\AppFramew ... {}, { _route: "s ... "})
4. /home/xiom3155/public_html/cloud/lib/base.php - line 1008:OC\Route\Router->match("/settings/apps/enable")
5. /home/xiom3155/public_html/cloud/index.php - line 38:OC::handleRequest()

Caused by TypeError: fclose() expects parameter 1 to be resource, null given

0. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php - line 66:fclose(null)
1. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/LocalAppData.php - line 78:OCA\DocumentServer\Document\FontManager->OCA\DocumentServer\Document\{closure}("*** sensiti ... *")
2. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php - line 72:OCA\DocumentServer\LocalAppData->getReadLocalPath(OC\Files\Sim ... {}, Closure {})
3. /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Migration/RebuildFonts.php - line 46:OCA\DocumentServer\Document\FontManager->rebuildFonts()
4. /home/xiom3155/public_html/cloud/lib/private/Repair.php - line 104:OCA\DocumentServer\Migration\RebuildFonts->run(OC\Repair {})
5. /home/xiom3155/public_html/cloud/lib/private/legacy/app.php - line 981:OC\Repair->run()
6. /home/xiom3155/public_html/cloud/lib/private/Installer.php - line 154:OC_App::executeRepairSteps("documentserver_community", { step: "OCA ... "})
7. /home/xiom3155/public_html/cloud/apps/settings/lib/Controller/AppSettingsController.php - line 443:OC\Installer->installApp("documentserver_community")
8. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:OCA\Settings\Controller\AppSettingsController->enableApps([ "documentserver_community"], [])
9. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")
10. /home/xiom3155/public_html/cloud/lib/private/AppFramework/App.php - line 125:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")
11. /home/xiom3155/public_html/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})
12. <<closure>>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})
13. /home/xiom3155/public_html/cloud/lib/private/Route/Router.php - line 299:call_user_func(OC\AppFramew ... {}, { _route: "s ... "})
14. /home/xiom3155/public_html/cloud/lib/base.php - line 1008:OC\Route\Router->match("/settings/apps/enable")
15. /home/xiom3155/public_html/cloud/index.php - line 38:OC::handleRequest() 2020-02-25T13:27:49+0700
Error PHP Undefined offset: 0 at /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php#66 2020-02-25T13:27:49+0700
Error PHP proc_open() has been disabled for security reasons at /home/xiom3155/public_html/cloud/apps/documentserver_community/lib/Document/FontManager.php#64 2020-02-25T13:27:49+0700

maybe it happens b/c nc 18.x would need php 7.3? at least i read something like this somewhere.

EDIT
i now know better… --> https://docs.nextcloud.com/server/18/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

Do i need to upgrade my PHP to 7.3?

No, running it myself with 7.2 without trouble.

See official docs:

https://docs.nextcloud.com/server/18/admin_manual/installation/system_requirements.html?highlight=requirement

You neee NC 18.0.1 to be able to run the Document Server app for OnlyOffice.

Yep, i’ve upgraded mine to 18.0.1, forgot to update the original post. In this reply i have posted a new log regarding the failed ‘Enable’. I’ve also edited the original post.

@mardijker

thanks for letting us know… and that’s exactly the reason why you shouldn’t crosspost your issues around the forum (and even avoid bringing out links to the original posting)

Anyone happened to know what’s wrong with the log?

I have the same issue as the OP with the same three Admin Logging outputs:

Error	index	Exception: fclose() expects parameter 1 to be resource, null given

Error	PHP	Undefined offset: 0 at /var/www/vhosts/example.com/cloud.example.com/apps/documentserver_community/lib/Document/FontManager.php#66

Error	PHP	proc_open() has been disabled for security reasons at /var/www/vhosts/example.com/cloud.example.com/apps/documentserver_community/lib/Document/FontManager.php#64

My Setup:
Nextcloud 18.03
PHP 7.2.29
Just like the OP his is on shared hosting thus no sudo rights.

Attempts at solution so far:

  1. I have tried extending timeout times at “path/to/nextcloud/lib/private/Http/Client/Client.php” with no difference in the matter.

  2. A manual installation of the app files to nextcloud/apps displays the app in the settings it won’t be enabled and produces an error

@mardijker I believe I have found the source of our problem which is twofold:

Firstly, I solved the curl timeout by modifying the installer.php file ( lib/private/Installer.php) and increasing the timeout value from 120 to something sufficiently high (found this solution in a similar Githib discussion).

The second problem is that the “proc_open” php function is disabled by my shared webhoster by default since “most popular applications do not use these functions and can be operated without limitations”.

Have you checked in your php configuration or with your webhoster if this php setting is enabled?

I can imagine other users that run Nextcloud on shared servers might encounter the same issue. This is a pity since we haven’t been able to use Onlyoffice before either since we do not have root access.
Is there no way to use the Community Document Server without this PHP function?

1 Like