Nextcloud version: 24.0.2
Operating system and version: Linux 4.18.0-147.8.1.el7h.lve.1.x86_64 x86_64
Apache or nginx version: I don’t know, hosted and installed by a provider
PHP version: 7.4.29
The issue you are facing:
I’m unable to connect to my Nextcloud using Gnome’s “Online Account” integration.
On my Laptop running Fedora36, I use the Online Account setting and try to login:
Each time I try this, the logs in my Nextcloud show this error:
Error: shell_exec() has been disabled for security reasons at /home/*myaccount*/domains/*myserver.fr*/private_html/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#116
<<closure>>
OC\Log\ErrorHandler::onError()
/home/*myaccount*/domains/*myserver.fr*/private_html/apps/serverinfo/lib/OperatingSystems/DefaultOs.php - line 116:
shell_exec()
/home/*myaccount*/domains/*myserver.fr*/private_html/apps/serverinfo/lib/Os.php - line 70:
OCA\ServerInfo\OperatingSystems\DefaultOs->getTime()
/home/*myaccount*/domains/*myserver.fr*/private_html/apps/serverinfo/lib/Controller/ApiController.php - line 139:
OCA\ServerInfo\Os->getTime()
/home/*myaccount*/domains/*myserver.fr*/private_html/lib/private/AppFramework/Http/Dispatcher.php - line 225:
OCA\ServerInfo\Controller\ApiController->BasicData()
/home/*myaccount*/domains/*myserver.fr*/private_html/lib/private/AppFramework/Http/Dispatcher.php - line 133:
OC\AppFramework\Http\Dispatcher->executeController()
/home/*myaccount*/domains/*myserver.fr*/private_html/lib/private/AppFramework/App.php - line 172:
OC\AppFramework\Http\Dispatcher->dispatch()
/home/*myaccount*/domains/*myserver.fr*/private_html/lib/private/Route/Router.php - line 298:
OC\AppFramework\App::main()
/home/*myaccount*/domains/*myserver.fr*/private_html/ocs/v1.php - line 62:
OC\Route\Router->match()
/home/*myaccount*/domains/*myserver.fr*/private_html/ocs/v2.php - line 23:
require_once("/home/*myaccou ... p")
In order to pinpoint the issue, I tried different tricks:
- I installed Nextcloud desktop client on my laptop and logged into my account without any issue. Everything worked as it should.
- I installed a “dummy” Nextcloud, created an account and connected to it via Gnome’s integration. Everything worked as it should.
Since login to my Nextcloud from the Desktop App worked, I assumed it was a Gnome integration problem. But because I can login from Gnome Account to another Nextcloud, I don’t know.
Research on that issue:
The problem looks similar to the one described here.
Like in that situation, my Nextcloud is hosted and installed by a provider (hosting my websites, and offering the Nextcloud hosting). But the conclusion is:
My provider dug into the problem and we came to the conclusion that it’s probably a Gnome bug.
I created a post in Gnome Discourse to ask for clues.
I also searched this forum for the shell_exec() error
But most of the time there is no answer, or it’s on another subject.
In this post I found an interesting response:
The Nextcloud log is spammed with
shell_exec() has been disabled for security reasons at /var/www/www3018/htdocs/nextcloud/apps/serverinfo/lib/OperatingSystems/DefaultOs.php
But that is a know behavior, because the Nextcloud system info uses shell_exec which is not allowed on my server. See Github Issue
And the Github post links to other ones, but it doesn’t offer any workaround or useful information.
My questions
I understand there is a security reason for which shell_exec()
is disabled, but I don’t know why Gnome Integration needs the shell_exec()
command in order to login, while other applications don’t (Phone app, Desktop app) .
Is there a specific reason why Gnome’s Integration needs the shell-exec() command to be enabled on the Nextcloud server in order to login?
Would enabling shell-exec() solve the problem?
If so, how can I do that?
Would it render my Nextcloud less secure?
Is there another way to solve this problem?